4.5. What goes on in the buildActions method?

In the standard case, the buildActions method has two important components. It creates objects of these two classes.

In the buildActions methods of the Arborgames model, there are plenty of interesting examples. In the observer swarm, for example, there are commands that schedule the updating of the graphical display and also there are commands that instruct the lower level classes to execute their own buildActions methods.

In the ModelSwarm's buildActions method, one typically finds the heart of the substantive action of the simulation. Commands tell agents, or lists of agents, that they should carry out their methods. These commands are placed into instances of the ActionGroup class, which means that they will all be repeated whenever the group is repeated. The repetition is controlled by commands that create schedules and indicate how often those schedules will be repeated.