This page was automatically generated by NetLogo 4.0.2. Questions, problems? Contact

The applet requires Java 1.4.1 or higher. It will not run on Windows 95 or Mac OS 8 or 9. Mac users must have OS X 10.2.6 or higher and use a browser that supports Java 1.4. (Safari works, IE does not. Mac OS X comes with Safari. Open Safari and set it as your default web browser under Safari/Preferences/General.) On other operating systems, you may obtain the latest Java plugin from Sun's Java site.

In order for this to work, this file, your model file (geneticdrift.nlogo), and the file NetLogoLite.jar must all be in the same directory. (You can copy NetLogoLite.jar from the directory where you installed NetLogo.)

On some systems, you can test the applet locally on your computer before uploading it to a web server. It doesn't work on all systems, though, so if it doesn't work from your hard drive, please try uploading it to a web server.

You don't need to include everything in this file in your page. If you want, you can just take the HTML code beginning with <applet> and ending with </applet>, and paste it into any HTML file you want. It's even OK to put multiple <applet> tags on a single page.

If NetLogoLite.jar and your model are in different directories, you must modify the archive= and value= lines in the HTML code to point to their actual locations. (For example, if you have multiple applets in different directories on the same web server, you may want to put a single copy of NetLogoLite.jar in one central place and change the archive= lines of all the HTML files to point to that one central copy. This will save disk space for you and download time for your users.)

created with NetLogo

view/download model file: geneticdrift.nlogo


This model is an example of random selection. It shows that turtles that randomly exchange colors converge on a single color. The idea, explained in more detail in Dennett's "Darwin's Dangerous Idea", is that trait drifts can occur without any particular purpose or "selective pressure".


The model starts with a random distribution of colored agents. Turtles move by wiggling randomly across the world. When two turtles are next to each other, one turtle changes its color to the color of the other one. Note that if a color dies out, it can never come back.


The NUMBER slider sets the number of turtles. The COLORS slider selects the number of competing colors, up to ten.

The SETUP button initializes the model, and GO runs the model.

A monitor shows the percentage of turtles sharing the most common color. When this reaches 100%, the model stops.

After pressing PLACE-WALLS, the user can "draw" walls in the world at the location where the user clicks with the mouse. By pressing REMOVE-WALLS, the user can remove added walls. The REMOVE-ALL-WALLS button removes all walls including the border. (The SETUP button does not remove walls.)


Gradually a color will gain a slight dominance. By statistical advantage, a dominant color becomes more likely to have more colors like it. However, because the process is random, there will usually be a series of dominant colors before one color finally wins.


Experiment with adding walls.

When walls are added, groups of individuals can be geographically isolated so that they can not interact with their neighbors on the other side of the wall. Groups that are geographically isolated with walls will often end up with a different dominant color than the larger population. A group of individuals that is walled off becomes a "founding group". The founding group of individuals has a different genetic variability and distribution than the main population, so the frequency of certain traits may end up drifting in a different direction compared with the much larger population.


In this model, a turtle looks one patch to its right. If there's another turtle there, the "looking" turtle changes to that turtle's color. Since the turtles move randomly about the world, it's a matter of chance which turtle will change to the color of its neighbor.

Think of other rules for turtle interactions, random or otherwise, by which a turtle color might "take over".


GenDrift (P Global)
GenDrift (P local)
GenDrift (T reproduce)


To refer to this model in academic publications, please use: Wilensky, U. (1997). NetLogo GenDrift T interact model. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

In other publications, please use: Copyright 1997 Uri Wilensky. All rights reserved. See for terms of use.