These are all the possible causes for events.
- Initialization
- A Study has performed its own initialization and is about to start.
- Triggered
- An event trigger function underwent a monitored sign transition.
- Scheduled
- An integrator reached a previously-scheduled time for the Event to occur.
- TimeAdvanced
- An integrator completed an internal step, meaning that it has reached a point where time has advanced irreversibly.
- Signaled
- A flag in the State has been explicitly set, meaning that a particular Event has occurred. Anyone with write access to a State can set these, but typically they are set in event handlers associated with one of the other kinds of events.
- Termination
- The Study has finished. If a Termination event handler signals more Events, those signaled events are not processed by the Study; that is, the signals remain set in the final State.
In case several of these causes are detected in a single step, they are sequentialized in the order shown, like this:
- The occurrence of triggered events is reported and the triggering state and a list of triggered events are passed to the event handler for processing (meaning the state, but not the time, is modified). Note that simultaneity within the set of triggered events may also require special handling; we're not talking about that here, just simultaneity of causes.
- Next, using the state resulting from step 1, the time is checked to see if scheduled events have occurred. If so, a list of those events is passed to the event handler for processing.
- Next, if this system has requested time-advanced events, the event handler is called with the state that resulted from step 2 and the "time
advanced" cause noted. No event list is passed in that case. The state may be modified.
- Last, if the final time has been reached or if any of the event handlers asked for termination, we pass the state to the event handler again noting that we have reached termination. The state may be modified and the result will be the final state of the simulation.