Netlogo models, Extensions and other NetLogo resources...
|Life Workshop||examples used in the workshop at the Centre for Life|
|NLBoris||a NetLogo extension which allows NetLogo agents to exchange messages (updates, user guides and examples)|
|NLoops||a partial objects layer for NetLogo (a step towards NetLogo++) - user guides and examples|
|Malaria 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)|
|string extension||Netlogo extension for handling strings|
|foxes & rabbits||a simple series of models if you are just starting with NetLogo|
|L-systems model||morphogenesis of 2D shapes using context free grammar rules|
|fox & hounds||a competition based on a chase scenario|
|independent JFrames||how to open independent JFrames from a Netlogo extension|
|NetLogo tasks||a discussion of tasks and how to use them (NetLogo 5 onwards)|
|sock1||a (simple) example using sockets communication between NetLogo and Java|
|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|
- a nice collection of NetLogo Models for Artificial Intelligence from W. J. Teahan Models for AI -- highly recommended.
- for more NetLogo resources check the NetLogo site: ccl.northwestern.edu/netlogo.
- for a short but useful summary for writing NetLogo check: NetLogo-4-0-QuickGuide.pdf.
- work from Michael Gizzi (Illinois State University) recommended: The NetLogo learning Lab.
- models from Tom Carter (California State University Stanislaus) - recommended:
Tom's NetLogo Models.
(Tom's pages have lots of useful information relevant to modelling, AI, linguistics, complexity, etc. Well worth a look, see Tom's Pages)
- ccl evolution pages ccl beagle
- Computational Modeling in Cognitive and Social Science from Stanford -- their home page or check one of their couse pages here
- we welcome contributions from others so please contact us if you build models with either nlboris or nloops and would like to share them
- to cite the work on these pages please quote the web address and use S.C.Lynch as the author name
nlboris is a netlogo extension which allows netlogo agents to communicate by sending each other messages, it also allows agents to communicate between NetLogo and other Boris agents.
We recently found that most users are only really interested in communicating between NetLogo agents running in the same NetLogo world so we have also built messaging.nls a simple messaging system for NetLogo agents which does not need an extension to be installed. messaging.nls provides the same kind of functionality as nlboris but only supports communication within a single NetLogo world (ie: it does not allow NetLogo agents to communicate with boris agents in other subsystems). See below for both nlboris and the smaller messaging system.
- the .nls file messaging.nls
- documentation reference guide
see also the nlboris tutorial for an explanation of some of the example models nlboris tutorial
mine-clear -- 1d(m2).nlogo
path -- 1a(m2).nlogo -- Ants (turtles) find paving slabs and use them to construct a path. Paving slabs come in three colors (red, green & blue) and are scattered around the world at the start. The path is constructed so that the paving slabs are placed in a strict sequence red then green then blue. Ants communicate to achieve this.
ant-food-s1a(m2).nlogo -- this model examines group behaviour and coordination based on messaging. Check the information provided with the model for more details.
NB: this model provides an example of writing move procedures (and others) based on a turtles status.
- the .jar extension nlboris.jar for NetLogo 4.x
- a new .jar extension nlboris.jar
tested with NetLogo5+
- all extensions are called "nlboris", take care not to mix them up, they are not compatible with other versions of NetLogo
- check here for a short tutorial nlboris tutorial
- documentation reference guide
- examples used in the tutorial
mine-clear -- 1d.nlogo
- path -- 1a.nlogo -- Ants (turtles) find paving slabs and use them to construct a path. Paving slabs come in three colors (red, green & blue) and are scattered around the world at the start. The path is constructed so that the paving slabs are placed in a strict sequence red then green then blue. Ants communicate to achieve this.
- ant-food-s1a.nlogo -- this model examines group behaviour and coordination based on messaging. It is a cut-down version of the larger scale model with a similar name (see below). The notes describe the behaviour in terms of foraging ants but the behaviour may also be applicable to fashions, viral messaging, memes, etc. Check the information provided with the model for more details.
-- a fuller version of the model above with a similar name.
This model examines group behaviour and coordination based on messaging.
Check the information provided with the model for more details.
NB: ant-food models above provide an example of writing move procedures (and others) based on a turtles status.
NLoops is a partial objects layer for NetLogo, it is written in NetLogo script (not as a Java extension) so it is used as a .nls include file.
We have a couple of versions of NLoops, if you don't need many features and want something which will easily integrate with existing NetLogo code start with NLoops-lite.
- NLoops (full version)
- for NetLogo-4 NLoops-4b.nls
- for NetLogo-5 NLoops-5.nls -- see here for notes about changes for the new version.
- a short tutorial: NLoops tutorial
- brief reference guide
- examples used in the tutorial
for NetLogo-4: example 4.1 example 4.2 example 4.3
for NetLogo-5: example 5.1 example 5.2 example 5.3 example 5.4
(last example demonstrates NLoops5 used with patches)
- search routines & utilities
- check breadth-search(1a).nlogo for a generalised search routine and an example based on a numbers puzzle, read the info tab for an explanation.
- check also breadth-search(1a)-eg2.nlogo for a second example based on a word transformation problem, as before read the info tab for details.
- to help set up an environment with hills/cost gradients for other types of search see hill-diffusion.nlogo
- see maze(1b).nls for an include file to draw mazes and maze-test(1a).nlogo for a simple model which demonstrates the maze drawing.
- see also patch-to-patch-search(1a).nls for an include file containing a search mechanism to find a path from one patch to another and maze-search-test(1a).nlogo for a simple model which demonstrates the use of the patch-to-patch search.
- some example implementations of search (now upgraded to netlogo 5)
- patches - no obstacles search operating on a blank background of patches. ie: no obstacles, no costs
- patches with obstacles as the previous versions but patches may be marked as "walls" which act as barriers for search paths
- patches with costs this model allows patches to be given costs and implements a best first search
- walk a marked path
this model allows patches to marked as being part of a path and uses a breadth first search
to find a route on the path from a start patch to a goal patch. It looks like this...
- maze traversal
-- this model was developed after a Programming Interest Group competition.
There is a partial maze environment containing pigs (lost and need rescuing), pig stys and
golf carts (mobile agents that find pigs and return them to a sty). The controller for golf-carts
(or maybe they are shopping trollys) is based on search. For more details check the info
tab on the model. It looks like this...
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...
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
- algorithmic botany -- pages from the University of Calgary
- algorithmic beauty of plants -- a (free) online book
- links to an Lparser package
- L-systems -- an applet runner from university of Calgary
- kevs3d -- an L-system runner in html5 from Kevin Roach
- Tickle Trunk -- brief discussion of L-systems and an applet to run them
Tasks are introduced in NetLogo 5 - here are some examples/discussions of their use.
- task-test(1a).pdf - for some comments about referencing tasks in NetLogo5, see also test1a.nlogo for the test model
- task-test-2.pdf - some experiments using task closures to define stack functions (updated 23/10/11)
an example of a simple socket extension for NetLogo which allows netlogo to communicate with other (Java) applications via a socket.
- netlogo socket example.pdf -- a v.brief overview outlining how to use the example
- sock1.zip -- a zipped bundle containing the extension jar and the source files used to build it
For more complex models & extensions you may want to have some kind of dialog with users or pass them information. This example opens a JFrame from a Java extension. The JFrame allows users to communicate with a NetLogo model. Note that you can also use this kind of approach to output debuggging information from your extensions.
The extension and a sample model is wrapped up in test.zip which you should unpack into an extension folder called "test". The (v.simple) example model to demonstrate the idea is called "test.nlogo" and is also contained in test.zip. NB: the extension will run on NetLogo5 (not on earlier versions).
(see above for nlboris, NLoops, etc)
-- this provides a link to some basic Java.String methods (replace, split, trim, etc). For a full list see string extension Javadoc
- fox & rabbit speed
a simple model showing co-evolution/adaption of the speed of movement of rabbits & foxes
- vectors on diffused space
adaptive entities (each defined by a collection of [x y] vectors) aim to occupy optimal positions in a search space than contains multiple (partial-)optima
- multi-facet v.2
this model shows evolution/adaption of multiple variables over time. The model uses a fixed size population with a simple "survival of the fitest" approach.
the evolution lab model. The version here uses a binary genome & a rule-based phenome. For details of parenting strategy, etc. please check the model code.
- genetic drift on patches
-- a model showing genetic drift occuring over patches.
-- a more complex model which pushes genetic drift to illustrate speciation. I am still working on modelling speciation, if you are also working in this area please get in contact.
- cloud formation
-- demonstrates cloud formation using cellular automata which operate in a similar way to genetic dift.
-- this model investigates the way in which simple genetic operators (cross-over
& mutation) effect inheritance. The model holds a small population of "bugs", each defined by
a short digital gene sequence. A bug's genome define its shape and the sound it makes.
You can select parents to breed new off-spring with modified genomes.
- make sure you have the sound on!
- click [setup] to start
- the grid shows 25 "bugs" (shape & sound defined by their unique digital genome)
- listen to bugs by clicking the [play] button then clicking the mouse on the bug shape in the grid
- breed new bugs using [select P1] and [select P2] to choose 2 parents (click the button then click on the shape you want in the grid), use [select NEW] to identify which bug you want to replace and [breed(P1,P2)=>NEW] to get the breeding to take place
- to see all genomes press [print genomes]
- for more details check the info tab on the model
The model world looks like this...
"Six degrees of separation" is the notion that, on average, everyone is connected to everyone else on the planet by 6 friendship links. This model explores a similar idea.
a code anti-pattern?
demonstrates how NOT to code up selection mechanisms if you want even/fair distribution.
- test page