BehaviourComposer: ignore everything before this.
The behaviours in this library have been placed in these categories:
Movement | Attributes | Appearance | Parameters | Scheduling | Interacting | Linking | Layout | Adding agents | Removing | Social network | World | Images | User input | NetLogo interface gadgets | Graphs | Logging events | Miscellaneous | NetLogo programming
These special purpose micro-behaviours libraries are also available:
Sample models are available to explore.
Here how to make a movie of your model.
Here are micro-behaviours for setting or changing the position of agents:
Go forward in the direction of my heading.
Turn a specified number of degrees to change my heading.
Turn towards a given location.
Move to another agent or patch.
Turn towards another agent or a patch.
Move horizontally or vertically towards another agent.
Jump to a random unoccupied location in region.
Move to a patch that has nothing there.
Place a set of agents in a rectangular grid.
Place a set of agents in a rectangular prism.
Update the heading and position of the agent immediately.
Useful micro-behaviour built by customising and combining other micro-behaviours:
Repeatedly go forward in the direction of my heading.
Repeatedly turn a random number of degrees to change my heading.
Wander forward by repeatedly turning small random amounts.
Set my-heading to a random angle.
Repeatedly wander to a random unoccupied location if one is nearby.
Set the pen mode to 'down' so a trail is left as this agent moves.
Set an attribute, parameter, or Netlogo variable to a new value.
Set two attributes, parameters, or NetLogo variables to new values.
Useful micro-behaviours that customise this include:
Increase the age attribute on every tick.
Set my-heading to a random angle.
Set the pen mode to 'down' so a trail is left as this agent moves.
Set the value of an attribute of all patches.
Example:
Set the color of each patch to a random color.
Change the appearance to one of the defined shapes.
Change the color of this agent.
Change the color of the patch under this agent.
Become invisible and continue to run behaviours.
Define a new parameter (optionally controlled by a slider or input box).
Add a list of behaviours (a convenient way to package up several behaviours into a single unit).
Add a list of behaviours to another agent, patch, set of agents or set of patches.
Add behaviours to a link or links.
Remove behaviours from a specified agent or set of agents.
Remove all behaviours from this agent.
Remove all behaviours from the specified agent or agents.
Adds behaviours depending upon how a random number compares with the given odds.
Delays the execution of a list of micro-behaviours until after setup completes.
Conditionally adds one of two lists of micro-behaviours.
Repeatedly run behaviours with an interval that is re-computed each time.
Run a list of behaviours a specified number of times now.
Interact with anyone who meets the specified conditions.
Compute the heading needed to turn towards other agents.
Compute the heading needed to turn away from other agents.
Turn toward the desired-direction computed by other behaviours.
Add an undirected link with another.
Add a directed link from another.
Add a directed link to another.
Add undirected links with a set of agents.
Add directed links to a set of agents.
Add behaviours to a link or links.
Place a set of agents on a circle.
Place a set of agents in a rectangular grid.
Place a set of agents in a rectangular prism.
Create exact copies of this agent. The newly created copies can be given any additional behaviours.
Make exact copies of another agent at the location of this agent.
Examples:
With 90% probability produce between 1 and 3 offspring after a gestation period of 10 ticks.
Produce a random number of seeds at random locations.
Remove this agent from the model.
Examples:
Cause another agent to be removed from the model.
Eat by killing another and reducing hunger.
Constant: Create a social network where everyone has the same number of bi-directional links.
Behaviours useful for viewing the network:
Set size proportional to the number of links.
Set the initial size of the world where the model runs.
3D version: Set the initial dimensions of the 3D world where the model runs.
Set the initial size in pixels of each patch of the world.
Set the location of the display of the world.
Change the initial geometry of the world.
Set the way NetLogo updates the view.
Set the value of an attribute of all patches.
Examples:
Set the color of all the patches of the world.
Set the color of each patch to a random color.
Pause the execution of the simulation.
Example:
Add a log message that time has been exceeded to the output area
Add behaviours to all patches.
Import patch colors from an image file.
Import patch red/green/blue colors from an image file.
Import drawing from an image file.
in order to
Create a button with associated micro-behaviours.
Create a button with associated NetLogo code.
Create a button with associated observer-context micro-behaviours.
Create a chooser of values for a parameter.
Define a parameter controlled by a slider or input box.
Define a parameter controlled by a toggle switch.
Create a chooser of values for a parameter.
Create a monitor to display the current value of an attribute, parameter, or computation.
Add some text to the NetLogo interface.
Set up and maintain a plot of two variables, e.g. hunger versus time.
Set up an area for other micro-behaviours to draw graphs.
Graph data on top of a plot with a fresh pen.
Plot data on top of a plot using a previously defined pen.
Add a new graph to the previous graphs each time the model is set up.
Set up and maintain a histogram.
Plot the logarithm of frequency of data versus the logarithm of data values.
Draw Lorenz curve and update Gini coefficient.
Add a log message to the log area.
Add the area where messages can be added.
Add to the log area all changes to any of the attributes of this agent.
Add to the log area changes to the values of the listed attributes of this agent.
Add to the log area changes to any patch attribute.
Add to log area all attribute changes to any patch.
Add to the log area changes to any of the listed patch attributes.
Record a snapshot of the current view to the file system.
Record a snapshot of the entire interface to the file system.
Add notes or comments to a prototype or list of micro-behaviours.
Specifies declarations for adding extensions or other advanced NetLogo features.
To add any NetLogo code to your model use the 'Micro-behaviour scratch pages' button in the Composer area.
This is the new library of micro-behaviours authored by the Modelling4All team. An older version of the library is still available.
A specialised library of swarming micro-behaviours is available to build models found in Couzin, I. D., Krause, J., Franks, N. R. & Levin, S.A.(2005) Effective leadership and decision making in animal groups on the move Nature 433, 513-516.
Here is a simple swarming model using some of these micro-behaviours. Here is three-dimensional version of the model.
A library of opinion dynamics micro-behaviours inspired by the paper "How can extremism prevail? A study based on the relative agreement interaction model" by Guillaume Deffuant, Frédéric Amblard, Gérard Weisbuch and Thierry Faure (2002); Journal of Artificial Societies and Social Simulation vol. 5, no. 4; <http://jasss.soc.surrey.ac.uk/5/4/1.html> can be used to explore modelling opinion dynamics.
Here is a relative agreement model
The library of epidemic micro-behaviours were designed to explore the SVIR model as presented in "Mathematical models of vaccination", Almut Scherer and Angela McLean, British Medical Bulletin 2002;62 187-199. Here are some suggestions for exploring vaccination models.
Here is a step-by-step guide to modelling epidemics
Click to load a simple model of an epidemic spreading over a social network
Click to load a model of an epidemic spreading at home, school, and work
Click to try the Epidemic Game Maker which automates much of the construction of epidemics spreading in home, schools, and work.
You can compose the elements of the Sugarscape library of micro-behaviours to recreate the models in Growing Artificial Societies by Joshua M. Epstein and Robert Axtell, Brookings Institute Press, The MIT Press, 1996.
Here is a step-by-step guide to building Sugarscape models.
Click here to load a Sugarscape model using these micro-behaviours
Use this library of network formation micro-behaviours to model economic agents forming a network.
Here is a sample predator-prey model created using this step-by-step guide to building an ecosystem. And here is that model extended to model heterogeneity in prey and geography using this guide to extending the predator prey model.
Here is a model of the Spanish Flu Pandemic and here is a guide to its use. The model does not run in the web version of NetLogo.
Here are the links to orbits models and documentation. And here is the orbital mechanics micro-behaviour library.
Links to models and their documentation.
Exploring probabilities
A collection of models for exploring probabilistic reasoning.
Acknowledgements
The micro-behaviours listed here were constructed for the BehaviourComposer as part of the Modelling4All Project at Oxford University originally funded by the Eduserv Foundation.
BehaviourComposer: ignore everything after this.