NetLogo tools

MODELS    HOME     TOP          

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 tools...

link description
general utils a collection of small NetLogo utilities we use in many models
state transitions a state transition engine for NetLogo
agent messaging two solutions (i) an include file (ii) a NetLogo extension both of which allow 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
path finding a NetLogo breadth first search, an A* search from one patch to another and other state space searches (search mechanisms, examples and utilities)
string extension Netlogo extension for handling strings
independent JFrames how to open independent JFrames from a Netlogo extension
sock1 a (simple) example using sockets communication between NetLogo and Java
sock2 another socket extension -- more developed than sock1

 

For more NetLogo resources check the NetLogo site: ccl.northwestern.edu/netlogo.

To cite the work on these pages please quote the web address and use S.C.Lynch as the author name.

 

 

utils
A .nls include file of small utilities we use in many models.

Get the .nls file here sxl-utils.nls

utils.nls includes the following...

wiggle -- turn randomly +/- 45 degrees
trigger p -- probabilistically report true/false
nearest-of b -- report nearest of breed b
mutate v m -- modifies variable named v by +/- m
smooth-value -- used in plotting smooth graph data
bounds lo x hi -- return x bounded by lo & hi

 

 

state transition engine
A .nls include file which allows you to specify agents as state transition devices.

state transition engine...

 

 

agent-agent messaging
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.

messaging.nls...

 

nlboris resources...

nlboris examples & models

 

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...

 

Netlogo breadth-first search & best-first search


 

sock1


an example of a simple socket extension for NetLogo which allows netlogo to communicate with other (Java) applications via a socket.

 

sock2


The sock2 extension which we now use in preference to sock1
this is used for most of our socket-based communication between Netlogo & Clojure and Netlogo & Java.

 

JFrames from extensions


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).

 

other extensions


(see above for nlboris, NLoops, etc) * because I get asked often... here is an example of using jar to create a jar for NetLogo from within a NetBeans folder. For netLogo extensions I usually place files in the default (un-named) package).