Once all of the simulated objects are created in buildObjects, the next task is to schedule them in the method buildActions.
modelActions = [ActionGroup create: [self getZone]];
[modelActions createActionTo: heat message: M(stepRule)];
[modelActions createActionForEach: heatbugList message: M(step)];
[modelActions createActionTo: heat message: M(updateLattice)];
modelSchedule = [Schedule createBegin: [self getZone]];
[modelSchedule setRepeatInterval: 1];
modelSchedule = [modelSchedule createEnd];
[modelSchedule at: 0 createAction: modelActions];
|
The heatbug model schedule actually consists of two components: an ActionGroup called modelActions and a Schedule called modelSchedule. The ActionGroup is a tightly coupled list of three messages: every time the action group is executed, it will send three messages in a row:
[heat stepRule];
[heatbugList forEach: step];
[heat updateLattice];
|