Netlogo models, Netlogo Extensions and other NetLogo resources...
- 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
- NetLogo breadth first search and other state space searches (a search mechanism, examples and utilities
- string extension -- Netlogo extension for handling strings
- foxes and 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
- the fox and hounds problems
- 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
- other models -- including the "evolution lab" model
- intro.ppt - a few slides used to introduce modelling biological & physical systems
- 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
other links
also...
nlboris
nlboris is a netlogo extension which allows netlogo agents to communicate by sending eachother messages.
nlboris resources...
- the .jar extension nlboris.jar for NetLogo 4.x
- a new .jar extension nlboris.jar
partially tested with NetLogo5.0RC1 & NetLogo5.0RC2
- 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
follower-1a.nlogo
follower-2a.nlogo
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.
- ant-food-s2a.nlogo
-- 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
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 resources...
- NLoops-lite
- the include file -- nloops-lite.nls
- a quick tutorial -- nloops-lite-tutorial.pdf
- examples used in the tutorial: NLoops-Lite-model1 NLoops-Lite-eg1 NLoops-Lite-eg2
- 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)
Netlogo breadth-first search & best-first search
- 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
- 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...
- fox-n-rabbits-0.nlogo
- fox-n-rabbits-1.nlogo
- fox-n-rabbits-2.nlogo
- fox-n-rabbits-3.nlogo
- fox-n-rabbits-4.nlogo
- fox-n-rabbits-5.nlogo
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...
- 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
- outline -- to follow
- rules for coding
- skeleton netlogo model
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)
- string
-- this provides a link to some basic Java.String methods (replace, split, trim, etc). For a full list see string extension Javadoc- the .jar extension file
- a NetLogo test harness -- check here to see how to call the string methods
- StringExtension.java -- the Java source (please let us know if you add to it)
- friends-of-friends
"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. - evolab
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.