Segregation Model and Extensions

created with NetLogo

view/download model file (right-click as "save target as"): SegregationEnhanced v00.nlogo

Presentation:  PDF Slideshow


This model is a version of Thomas Schelling's famous segregation model from his book Micromotives and Macrobehavior. He originally presented the model using pennies and dimes on a checkers board, but the rules and behaviors are roughly the same. There are two types of agents (represented by two colors) and they each have a percentage of neighboring agents that they want to be of the same color. The neighbors are agents in any of the 8 surrounding spaces of the grid, but some spaces might be empty. Unhappy agents move around to empty spaces until they are happy with their percentage of similar neighboring agents. Once all the agents are happy the model stops running.


Click the SETUP button to set up the agents. There are equal numbers of red and green agents. The agents move around until there is at most one agent on a patch. Click GO to start the simulation. If agents don't have enough same-color neighbors, they jump to a nearby patch.

The NUMBER slider controls the total number of agents. (It takes effect the next time you click SETUP.) The %-SIMILAR-WANTED slider controls the percentage of same-color agents that each agent wants among its neighbors. For example, if the slider is set at 30, each green agent wants at least 30% of its neighbors to be green agents.

The % SIMILAR monitor shows the average percentage of same-color neighbors for each agent. It starts at about 50%, since each agent starts (on average) with an equal number of red and green agents as neighbors. The % UNHAPPY monitor shows the percent of agents that have fewer same-color neighbors than they want (and thus want to move). Both monitors are also plotted.


When you execute SETUP, the red and green agents are randomly distributed throughout the pond. But many agents are "unhappy" since they don't have enough same-color neighbors. The unhappy agents jump to new locations in the vicinity. But in the new locations, they might tip the balance of the local population, prompting other agents to leave. If a few red agents move into an area, the local green agents might leave. But when the green agents move to a new area, they might prompt red agents to leave that area.

Over time, the number of unhappy agents decreases. But the space becomes more segregated, with clusters of red agents and clusters of green agents.

In the case where each agent wants at least 30% same-color neighbors, the agents end up with (on average) 70% same-color neighbors. So relatively small individual preferences can lead to significant overall segregation.


Try different values for %-SIMILAR-WANTED. How does the overall degree of segregation change?

If each agent wants at least 40% same-color neighbors, what percentage (on average) do they end up with?


1) To change the model to Schelling's "Surfers and Swimmers" model add another slider for %-similar-wanted. Make one for red agents and the other for green agents so they can have different tolerance levels.
SegregationEnhanced v01.nlogo

2) Add another type of agent and assign it a new color. Change the setup procedure so that there are equal numbers of each type of agent.
SegregationEnhanced v02.nlogo

3) Change the agents' shape so that it's easier to see the distribution of agents. Go to the tools menu and select the Shapes Editor and then choose the shape that makes sense to you.
SegregationEnhanced v03.nlogo

4) Add sliders for the number of each type of agent so you can have an uneven distribution of agent types. Run some experiments on different mixes and note any qualitative changes that result.
SegregationEnhanced v04.nlogo

5) Add a mutation rate so that unhappy agents have a percentage of changing their type rather than moving. Note that changing thier type may not make them happy depending on the percentage required. Does this speed up or slow down the time to universal happiness?
SegregationEnhanced v05.nlogo

6) Change the mutation rule into a learning rule so that agents copy the type of turtle that has the highest percentage of happiness among its neighbors. That is, find which type of agent among the neighboring agents has the highest percentage of happy agents and copy that type.
SegregationEnhanced v06.nlogo

7) Instead of just the Moore neighborhood, add a radius slider and have agents calculate happiness based on all the agents within that radius. Does this make it easier are harder to be happy? What effects does this have on the distribution of agents?
SegregationEnhanced v07.nlogo


Schelling, T. (1978). Micromotives and Macrobehavior. New York: Norton.

This little thing marks the end of the page.