Skip to main content

3.3) Model Initialization


In the initialization part you include only things which are done once to initialize the model.

These usually include clear-all, which clears everything (plots, agents, etc) from the previous simulation run. You might as well setup the patch variables and for example paint them in a neat colour. You need to create the initial amount of turtles and setup their variables, and you need to reset-ticks (i.e. reset the time counter from the last simulation).

Initialization or setup procedures can, depending on the amount of variables and agents in the model, become quite extensive. For example if you have a large amount of empirical data about your initial model population and their behaviour, all of that will need to go into this code part. In such a case it is worth outsourcing part of the setup into sub-models.

to setup
   clear-all
   setup patches variables
   create turtles
   setup turtle variables
   reset-ticks
end