Skip to main content

3.4) Scheduled Actions


This is the main execution procedure in your model, in Netlogo it is called “go” procedure and is repeated over and over to execute model. Include only stuff to be executed each time step.

The usual stuff included here is tick (increase the tick counter), include a termination (e.g. if ticks > 500 [stop]), ask turtles to do something (e.g. move, sell, buy, eat, etc ), and ask patches to update their variables based on what just happened (e.g. an agent just bought a house on this patch). You might as well update certain global variables (e.g. cumulative functions of what happen each time step).

Keeping the “go” procedure simple and neat, and call sub-models for complicated stuff, allows for a quick overview of what the model generally does, and simplifies debugging.

to go
   tick
   if ticks > 500 [stop]
   ask turtles [do-something]
   ask patches [do-something]
   update global variables
end