Events

Event-based programming is a style of computer programming where parts of the code respond to events being triggered by other sections of the code (see Fundamentals). In simulation models, events are generally linked to a simulation clock that is responsible for moving through the simulation period required and repeatedly triggering events at set times and in a predefined order. However, events can also be triggered when something happens (e.g. CropHarvestedEvent, PaddockBurnedEvent or RuminantsWeanedEvent) and may not necessarily be performed in a simulation, thus not triggering the associated code and actions. This allows for a modular style of programming where code is only used as needed.

The APSIM Next generation modelling environment is responsible for providing a simulation clock that controls the timing of all processes in all the APSIM models. At present CLEM operates on a monthly time-step while APSIM is based on a daily time-step. While CLEM is able to respond to any event triggered by the APSIM environment or other APSIM models, it triggers a series of its own events to control the simulation. These events are either triggered at the start (setup) of the simulation or at the end of every month for all the monthly processes.

See next section - Features