Schelling's Segregation Model

In 1969 Thomas Schelling (winner of the 2005 Nobel Prize in Economics) wrote an influential paper called Models of Segregation. In this paper Schelling created a CA model to explain the seemingly paradoxical observation that segregated neighborhoods could arise even if the residents were relatively tolerant of neighbors of a different race.

We can recreate Schelling's model by modifying Life. We begin by replacing the notion of ambience with two Boolean variables:

patches-own [ state black-acceptable white-acceptable]

The state of the cell indicates the race of the cell's occupant:

0 = black occupied
1 = white occupied
2 = gray = unoccupied

A cell is white acceptable if a white occupant would be happy with the percentage of black neighbors. A patch is black acceptable if a black occupant would be happy with the percentage of white neighbors.  In both cases, an occupant would be happy if the percentage of neighbors of a different race is less than or equal to the global variable max-percent-different.

The black-acceptable and white-acceptable variables are set during the observation phase. During the update phase the unhappy occupant of a cell moves to an unoccupied cell where he will be happy. If no such place exists, then the occupant disappears (i.e., moves to a different city).

Here's a screen shot of the segregation model's interface after 96 ticks starting from a random distribution of states. Notice that stable segregated neighborhoods have already formed despite the fact that the slider control indicates that as much as a 40% difference in race would be tolerated by inhabitants:

Here's a fragment of update-patch:

if state = 0 and not black-acceptable
[
   set-state 2 ; cell becomes unoccupied
   let new-location
      one-of patches with [state = 2 and black-acceptable]
   if new-location != nobody [ask new-location [set-state 0]]
]

Note that we are using NetLogo's one-of procedure:

one-of agents with [condition]

This will return a random member of a set of agents that satisfies a specified condition, or nobody if no such agent exists. In our case a random unoccupied patch is returned where a black occupant would be happy.

Unlike the other models discussed in this chapter in which cells only know about the states of their neighbors (local knowledge), the segregation model requires the occupant to have global knowledge, because he needs to know about the acceptability of all of the cells in the city.model.

Lab

Complete the implementation of Shelling's Segregation Model.