NetLogo: Experimental Worlds in Silico

by Owen Densmore

While at the Santa Fe Institute's Complex Systems Summer School in June of 2000, I was introduced to the fascinating world of Agent Modeling Systems.  There are several of these, such as, Swarm, the grandfather of them all, Repast and Ascape, two modern Java based systems, and StarLogo and NetLogo, the entry level but still powerful systems.

All of them have two interesting features:

  1. World: a grid of patches which can independently hold variables and have their own colors, and 

  2. Turtles: agents which roam the patches and have their own properties.

Northwestern University just released their new NetLogo 1.1 system, so lets play with it a bit to see how it works. Simply download the application from their website, installing as indicated.  To the right, you see the initial layout.  We'll start by playing with its command center, the blue type-in area below the black display area. Note: click on small images for full size.

The command center accepts commands for the global Observer, or for each of the individual turtles or patches.  You choose which sort via the small dropdown menu.  In the image below left we show the patches being selected. The center image shows the result of one command: "set pcolor (pxcor + pycor)" which simply sets the color (a number between 0 and 140) to the sum of the x and y coordinates.  Silly but illustrative! We then switch to Observer mode and reset the display and create 36 turtles: "clear-patches" and "create-turtles 36".  We then switch to Turtle mode, and do "set heading who * 10" and "forward 15" which turns the turtles in all directions ("who" is the number of the turtle from 0 to 35) then has them moves them forward one unit, resulting in the image on the right.

Programs are run using a very simple Logo-like language, along with an easy to use GUI for building sliders, buttons, and graphs.

To the right is an image of Thomas Schelling's famous segregation experiment (click to enlarge). To run this in NetLogo, click on the Models Library entry of the File menu and look at the Segregation model under the Social Science folder.

This run has a preference of 30% neighbors "like me".  It resulted in a ghastly 73% segregation! Below is the "before" and "after"; note the considerable increase in islands of segregated neighborhoods.

The NetLogo documentation which is included in the download, both the pdf manual and the html pages, provide very useful programming help.

Well, I hope this quick drive through has motivated you, gentle reader, to check out NetLogo and/or one of the other modeling systems. They offer truly surprising ways to investigate complex systems. We use them in Sun Labs to evaluate security models for one of our peer document systems, and to prove the closure property for peer networks .. among other things.  I hope you get a chance to try these nifty tools.

Let me know about your experiences with NetLogo or other agent modeling systems