NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".

Try It in NetLogo Web


This is a simple model of natural selection based on survival differences. There are two populations, the REDS and the BLUES. Each has settable survival rates. The reds and blues move around and reproduce with the same birth rates. However, when the carrying capacity of the terrain is exceeded, some agents die. But the chance that of blue organism dying relative to the chance a red organism dies is set by the blue-survival-advantage.


Each pass through the GO function represents a generation in the time scale of this model.

The CARRYING-CAPACITY slider sets the carrying capacity of the terrain. The model is initialized to have a total population of CARRYING-CAPACITY with half the population reds and half blues.

The BLUE-SURVIVAL-ADVANTAGE sets the relative probability of a blue organism dying, compared to a red organism. If that parameter is below 1, then the blue organisms are at a disadvantage, and if it is above one, the blue organisms have survival advantage.

The Startig-number-of-blues sets how many of the initial organisms will be blue. You can enter a number to try staring with a single blue or with many.

The # BLUES and # REDS monitors display the number of reds and blues respectively.

The GO button runs the model. A running plot is also displayed of the number of reds, blues and total population (in green).

The RUN-EXPERIMENT button lets you experiment with many trials at the same settings. This button outputs the number of ticks it takes for either the reds or the blues to die out (and the other color reaches fixation), given a particular set of values for the sliders. After each extinction occurs, the world is cleared and another run begins with the same settings.

So far, we have only simulated selection based on reproductive/fertility differences. But survival is also important in natural selection. In this model, you can set the relative survival probability of the blues compared to the reds. Set the starting proportion of blues to 0.5 (half), the carrying capacity to 100, and the blue survival advantage to 1.1 (maximum). Run an experiment (at least 5 runs). How often do reds go extinct and blues go to fixation?

Now set the blue survival advantage to 1.01 and rerun an experiment (at least 5 runs). How often does blue go to fixation?

If there is a difference between an advantage of 1.1 versus 1.01, what explains that difference?

Come up with an experiment to test your explanation. Can you set the parameters of the model to gain evidence either for or against your explanation/hypothesis? Describe your experiment, the results, and your conclusions (in a few sentences).


Carlo Maley wrote this model in 2018 as an extension of Wilensky's Simple Birth Rates model.

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

* Wilensky, U. (1997). NetLogo Simple Birth Rates model. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Please cite the NetLogo software as:

* Wilensky, U. (1999). NetLogo. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.


Copyright 1997 Uri Wilensky.

![CC BY-NC-SA 3.0](

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.

<!-- 1997 2001 -->

(back to the NetLogo User Community Models)