OSU 2010 ABM Workshop

Category: Presentations
Posted by: Aaron

Thursday 12/9/2010

9:30 10:00 Coffee and Bagels
10:00 12:00 Session I: Introducing NetLogo: the interface, finding help, loading and running models.
12:00 1:00 Lunch provided
1:00 3:00 Session II: In-depth look at the Schelling Segregation model's code and implementing extensions.

Friday 12/10/2010

9:30 10:00 Coffee and Bagels
10:00 12:00 Session III: Demonstrate extensions, review/correct code, more helpful modeling skills, advice, and examples.
12:00 1:00 Lunch provided
1:00 3:00 Session IV: Advanced modeling capabilities with NetLogo.

First you need to install NetLogo.

Then download the initial model file: SegregationEnhanced v00.nlogo (right-click and "save target as")

Presentation: Day 1 Slides - First some introductory remarks about the relationship between complex systems and agent-based modeling. Then a description of the famous Schelling segregation model. I show you around the Netlogo interface and some resources, then open the Segregation Enhanced base model that you can download above. Then we examine the code for the model and understand what each part is doing. After we've gone through these steps you're ready to start editing and writing code of your own. So the slides take you through 7 extensions of the model (also described below) and shows how to do them (which I will do in person in the workshop with further explanation). We may not get through all of them, so complete the remaining ones on your own. For your "homework", either 1) add even more capabilities to this model, or 2) change the model in a significant way in a different directions (e.g. towards your own research).

Presentation: Day 2 Slides - We will start off with some presentations of workshop attendees who managed to do something pretty spiffy with their Netlogo model. Then I will demonstrate some advanced features in Netlogo such as: Behavior Space, Shapes Editor, network models, importing data and images, sound, 3D models, and more.

Segregation Model and Extensions

WHAT IS IT?

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.


HOW TO USE IT

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.


THINGS TO NOTICE

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.


THINGS TO TRY

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?


EXTENDING THE MODEL

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


CREDITS AND REFERENCES

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