Skip to main content

8.2) Temporal Extent


There is one important piece of go still missing. This is where, in NetLogo, we control a model’s “temporal extent”: the number of time steps it executes before stopping. In the ODD description of model state variables and scales, we see that the model simulations last for 50 time steps.

Read the documentation for the primitive stop and modify the go procedure as follows to stop the model after 50 ticks:

to go
   tick
   if ticks >= 50 [stop]
   ask turtles with [PV = false] [determine-idea-to-install-PV]
   ask turtles with [PV-building-decision] [calculate-balance-and-decide]
end

Add a go button to the Interface. Do this just as you added the setup button, except: enter “go” as the command that the button executes, and activate the “Forever” tick box so hitting the button makes the observer repeat the go procedure over and over.

If you click go, nothing happens except that the tick counter goes up to 50. NetLogo is executing our go procedures 50 times but the procedures that it calls is still just a skeleton. Nevertheless, we verified that the overall structure of our program is still correct. And we added a technique very often used in the go procedure: using the tick primitive and ticks variable to keep track of simulation time and make a model stop when we want it to.

Have you been saving your new NetLogo file frequently?