Does spatial segregation of ethnic groups in cities imply intolerant individuals?

We will explore how we might use agent-based modelling to think about this question, following in the footsteps of Thomas Schelling.

Presentation slides here.

Step 1. Let's think about a hypothetical city neighbourhood with households on a grid. How might we define 'happiness' of a household with reference to the similarity of its neighbours (i.e. its spatial context).

1a Download this model code to the D: drive [you may need to right-click and 'Save Link As'], open in NetLogo, and work your way through the Info tab. Make sure you understand how happiness is defined.

1b To see how happiness is calculated by the model, go to the Code tab and find the answer procedure (all the code between 'to answer' and 'end').

Step 2. Now that we understand how happiness is defined in this model, let's consider how we might make the model dynamic by allowing households to move location if they are 'unhappy'. Households move until they find a location where they are 'happy'. If all households can find a location at which they are happy, the simulation stops and we can assess segregation.

2a Download this model code, open in NetLogo, and read the 'What is it?' and 'How to use it' sections in the Info tab.

2b Open the Code tab. You will see that we have more code in this model than the first. Look at how the setup procedure is similar (but slightly different) to the setup procedure in the first model.

2c Go back to the Interface tab. Note how the 'Go' button has two arrows pointing to one another in the bottom left. This means all code in the procedure called by the button will be continuously repeated until the code tells it to stop. The 'Go' button calls the go procedure, which is the dynamic part of the model code - find the go procedure in the code. 

2d The go procedure calls the update-happiness procedure - note how this is similar to the answer procedure in the first model.

2e Next in the go procedure, there's a check to see if all turtles are happy - if so, the model stops, otherwise the move-unhappy-turtles procedure is called. Find the move-unhappy-turtles procedure and check you understand what it does.

2f After the move-unhappy-turtles procedure, the timestep is increased by 1 and then the go procedure starts all over again from the update-happiness procedure. Each time the go procedure is repeated is known as an iteration

Step 3. Experiment with the model. Work through the instructions in the 'Things to Try' section of the Info tab. Record your results  in an Excel spreadsheet. Setup your results table as shown in the image below - your results will be typed into the shaded (green) cells. 

  1. For 2000 households but different values for %-SIMILAR-WANTED, how does the overall degree of segregation change?
  2. If each household wants at least 10% same-shape neighbors, what percentage (on average) do they end up with? What does this imply about drivers of segregation?
  3. For different values of %-SIMILAR-WANTED, how many iterations does it take before everyone is happy?
  4. Does the number of households in the space influence the patterns you found above? (e.g. repeat the experiment above of different %-SIMILAR-WANTED values but for a different number of households)

Online Resources
NetLogo Home :
NetLogo Modelling Commons:

Further Reading
Grimm, V. and Railsback S.F. (2012) Agent and Individual Based Modelling: A Practical Introduction. Princeton NJ: Princeton University Press
O’Sullivan, D. and Perry, G.L.W. (2013) Spatial Simulation: Exploring Pattern and Process. Chichester, U.K.: Wiley-Blackwell.
James Millington,
19 Jan 2017, 02:40
James Millington,
9 Jul 2014, 06:49
James Millington,
9 Jul 2014, 04:30