This page was automatically generated by NetLogo 4.0.4. 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 (lineages.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.)

powered by NetLogo

view/download model file: lineages.nlogo


This is an abstract model to explore the different evolutionary trajectories that might occur in the presence of severe disasters. The model forces the individuals to compromise between getting food and avoiding the disasters, since these have a tendancy to occur in the same places. The geneone and environment is deliberately sufficiently complex to allow an open-ended evolutionary debvelopment of genes. Species here are those with the same geneone.


The environment is a set of niches, labelled by the non-negative integers: 0, 1, 2, 3, ..., max-pxcor. Any number of individuals exist at these locations.

Each individual has an energy level and a gene. When evaluated the gene specifies the niche it occupies. The gene is of the form of an arithmetic expression using: *, +, -, /, iflz, binRand plus a number of common environmental inputs and a set of constants.

(env 1, env 2, ... env numEnvInputs) are the environmental inputs, representing some common but varying input from the environment - these are randomly determined as a random integer drawn from {0, 1, ... max-pxcor} at the start of each tick. "iflz" (if less than zero) takes 2 arguments - it evaluates the first and if the result is less than 0 if returns the result of evaluating the second argument else the result of evaluating the third. binRand randomly returns 0 or 1 independently each time its called. The constants are {0 1 2 3 4 5 6 7 8 9 10 20 30 40 50 100}.

Every time period: an integer, i, is chosen, indicating the set I={0, i, 2i, 3i, ...}. With a probability of "disaster-prob" all individuals at any of these locations are killed - otherwise "food" about of energy is distributed to the locations in I, which are, in turn, divided up between those individuals at those locations; energy of value "life-tax" is subtracted from all; those with energy < 0 die; those with energy >= reproduce-level reproduce once - creating a new turtle with the same gene as them (but mutated with a probabiliby of "mut-prob") and initial energy of "initial-energy"; "initial-energy"+"birth-cost" is subtracted from the parent.


The top line shows the niches and (the topmost which is arbitrary) individual there with a different colour for each species (whilst discernable colours are enough, thereafter white for any additional species).

Graphs are shown that display: the population level over time; the current number of species alive; the average number of occurences of the "bindRand" primitive in the genes over all individuals; the average "riskiness" of individuals - measured by the probability of their location being selected in the set I each time; and a chart showing the number of individuals in the most populous species (ranked in order of size).

There is also a display indicating the genetic lineages as they develop over time, with a darker line for more populous lines and a "branch" each time a new species is created by mutation - its show starting just above the parent species from the time it starts existing.

Due to the computation required to calculate the lineages and hence the numbers of each species, this is switchable using the "lineagesOn?" switch. This switch does not affect the model in any way other than the ways the output is displayed.

Statistics collected from "statStart" to the end include:
avPop sdPop avAvNumRand sdAvNumRand avAvRiskiness sdAvRiskiness avNumSpecies sdNumSpecies avSpeciesNum sdSpeciesNum avNumMostCommon sdNumMostCommon avMostCommonRiskiness sdMostCommonRiskiness avNumPosMostCommon sdNumPosMostCommon avNumRandMostCommon sdNumRandMostCommon ticks