GEOG3150 - GIS, Geocomputation and Geoplanning - Semster 2


Table of Contents

1. Running an example model
2. The Basics
3. Using ask

Practical 1, Part 1 - Running Two Example Models


To start off, we'll just look at two models so that you can get an idea about how NetLogo works.

Example 1: Schelling's Model of Residential Segregation

The first thing to do is start NetLogo. You can find the it by going to Start - All Programs - Departmental Software - Environment - Geography - NetLogo 5.0.2 > NetLogo 5.0.2 (or type 'NetLogo' into the search box).

NetLogo ships with a variety of ready-made models in the 'Models Library'. To see a list of the models that are available go to File -> Models Library.

To begin, we will use a version of Schelling's famous model of residential segregation. The model is listed under Social Science -> Segregation. Start that model now. At each iteration of the model, each agent looks at its 8 neighbours and works out how many are the same colour as itself. If fewer than a certain percentage.

Schelling's segregation model implemented in NetLogo

The model has the following graphical elements:

For more information about the model, or the function of the sliders and graphs, you can click on the 'Info' tab.

Spend a few minutes experimenting with the model and think about the following questions:

  1. Slowly increase the peoples' preference for living next to the same type ('%-similar-wanted'). What happens to the spatial structure of the population as it increases?
  2. What would you expect to see if '%-similar-wanted' was set to 100%? What actually happens?
  3. How does the amount of time taken to reach equilibrium change as you increase and decrease the number of people in the model (e.g. the residential density)?

Finally, have a look at the code that underpins the model (click on the 'Code' tab). NetLogo code has been designed to be easy to use; you can accomplish a lot without having to become a fully-fledged computer programmer. The whole Schelling model has been written using only 79 lines.

Example 2: Virus!

Now have a look at another model called 'Virus' which is under 'Biology'. This model simulates the spread of a virus through a population as people come into contact with each other. Start by clicking on the Info tab and reading about how the model works.

Over the next few practicals we are going to build a model that looks similar to this one so play around with some of the settings to see how the model behaves.

  1. What happens as the chance of recovering decreases? What happens when it gets to 0 (i.e. everyone who becomes infected dies)?
  2. Does the same thing happen every time you run the model? If not, what might account for these differences?

When you have finished experimenting with different parameter values, move onto the next part of this practical to learn more about the basics of the NetLogo program.


[School of Geography homepage] [Leeds University homepage]