Libraries‎ > ‎

Sugarscape Library

BehaviourComposer: ignore everything before this.
Micro-behaviours needed in building Sugarscape models
This page contains links to micro-behaviours that can be used to construct the Sugarscape model. For other micro-behaviours visit the full library of micro-behaviours.

We recommend you use this guide to building Sugarscape using the Behaviour Composer.

Appearance behaviours

Agent initialisation behaviours

Initialise agent -- initialises the metabolism, vision, initial sugar endowment, and life expectancy:
  1. Sugar consumption rate - initialises an agent's metabolism rate
  2. Vision level - initialises an agent's level of vision
  3. Sugar endowment - initialises an agent's initial store of sugar
  4. Initial age - initialises an agent's age to zero
  5. Life expectancy - initialises the lifespan of an agent (if it doesn't starve or the like)
Movement behaviours
Jump to any unoccupied patch - Useful for initialising the locations of agents.
Jump to a random unoccupied location in the lower left quadrant of Sugarscape - This is useful for exploring migration when used instead of Jump to any unoccupied location.
Move to the patch with the most sugar that is visible and unoccupied - The default manner that Sugarscape agents move.

Sugarscape environment behaviours

Define the capacity of each patch to hold sugar - sets up the topography of the landscape.
Grow sugar - Each patch repeatedly grows sugar until reaching its capacity.
Update patch color - Each patch repeatedly updates its color depending upon how much sugar remains.
Sugar growth produces pollution - Each patch increases the amount of pollution proportional to how much sugar it has grown.
Rate sugar growth produces pollution - Defines a parameter.
Diffuse pollution - each patch becomes the average of itself and four of its neighbours.

Agent behaviours

Collect sugar - makes an agent collect all the sugar at the patch where it is.
Consume sugar - makes an agent reduce its sugar by its metabolism rate.
Die if no sugar - removes an agent from the model if it has no sugar.
Replace when dead - creates a fresh agent whenver an agent dies.
Age - the age of the agent increases each tick.
Die of old age - removes an agent when its age exceeds its life expectancy.
Sugar consumption produces pollution - Agents increase the amount of pollution of the patch when they consume sugar.

Observer behaviours

Plot the population - sets up and maintains a plot of population over time.
Create a wealth histogram - sets up a histogram of accumulated sugar (wealth).
Update histogram - updates the range and interval of the wealth histogram.
Empty Lorenz curve - sets up an area where the following micro-behaviour can draw the Lorenz curves.
Draw Lorenz curve - repeatedly draws a Lorenz curve of the sugar distribution.
Gini coefficient monitor - adds a monitor that displays the current Gini coefficient.
Vison monitor - adds a monitor that display the current mean vision level.
Metabolism monitor - adds a monitor that displays the current mean sugar consumption rate.

BehaviourComposer: ignore everything after this.