agent-based modelling with NetLogo

TOOLS    HOME     TOP          

For our NetLogo tools (extensions & include files) see TOOLS


Please note: we use sxl-utils.nls (a small collection of utility procedures) in many of our models.
This should be placed in the same folder as any models that need it and loaded into the model using an include statement at the start of your model code...

__includes [ "sxl-utils.nls" ]


NetLogo models...

link description
Life Workshop examples used in the workshop at the Centre for Life
foxes & rabbits a simple series of models if you are just starting with NetLogo - similar to the Life Workshop models
Maker Faire 2014 some of the models from the Maker Faire 2014
Maker Faire 2016 some models from the 2016 Maker Faire
Malaria Models models representing the transmission of malaria and the way different gene types respond to infection
Speciation Models models representing the transmission of malaria and the way different gene types respond to infection
path finding a NetLogo breadth first search an A* search from one patch to another and other state space searches (a search mechanism, examples and utilities)
L-systems model morphogenesis of 2D shapes using context free grammar rules
fox & hounds a competition based on a chase scenario
NetLogo tasks a discussion of tasks and how to use them (NetLogo 5 onwards)
adaptive models this section is developing. It includes simple adaptation models, genetic drift, speciation and the "evolution lab" models. The BuzzBug models are also here for now.
other models models not included elsewhere
intro.ppt a few slides used to introduce modelling biological & physical systems
Complexity.ppt an introduction to complexity & emergence, etc,
modelling with cellular automata & state machines


other links


foxes and rabbits

This is a good place to start if you are new to NetLogo. These are a series of models which build on each other to progress from a simple to a more complex model. See brief.pdf for an explanation.

fox & rabbit models...

Note: to run these models you must download sxl-utils.nls -- put it in the same folder as your .nlogo source files.

If you want to write your own model from scratch you can start with the following blank1.nlogo


Netlogo breadth-first search & best-first search



Morphogenesis is concerned with the "creation of shape". It normally refers to the development of shape/structure in a biological entity. Computer Science also has had an interest since Lindenmayer proposed "L-systems", a formal system for describing morphogenesis.

An L-system is a 'language' defined by a set of production rules. These production rules are initially applied over a sequence of start symbols (an "axiom") expanding them into a new sequence of symbols which are then used for further expansions (more information is readily available on the web).

In a computational model, the resulting sequences (after multiple applications of production rules) can be interpreted as sequences of instructions. With our model here, we use a common approach which is to interpret the symbols as instructions to move a turtle (the turtle draws with its pen).

The model can be tailored expanded by adding new L-systems descriptions into the code.

the model: l-system1.nlogo

model images...

external links...


models used to introduce NetLogo

The models present a simple world inhabited by foxes and rabbits. When the foxes land on a rabbit, the rabbit dies.

The models progress from "fox-n-rabbits-0.nlogo" to "fox-n-rabbits-5.nlogo" with additional capability/complexity added at each stage (see version details below). There is also a model demonstrating simple adaptation (called "fox-n-rabbits-adapting.nlogo") where rabbits & foxes learn to spend less time sleeping and more time chasing each other or running away.

Note that all models need to use the file called "sxl-utils.nls" so make sure this is in the same folder as your NetLogo models. You can get "sxl-utils.nls" here sxl-utils.nls

The best way to learn NetLogo is to experiment with the models - download them then open them with NetLogo - do not try to cut & paste model code from a text editor into NetLogo because this does not work.

NetLogo comments start with a semi-colon ";" and end at the end of a line so any text after a semi-colon is used to explain the model code but does not affect how it operates.



the fox and hounds example



Tasks are introduced in NetLogo 5 - here are some examples/discussions of their use.


adaptive models


other models