Ordered list of middlewares
Ordered list of middlewares * [See entity](docs/archi/middlewares_entity.png)
A simulation model gathers information required to run the simulation.
A simulation model gathers information required to run the simulation.
Scheduler The scheduler is creating the next scheduler snapshot, until the stopping criteria are met. It is executing scheduler middleware with each scheduler snapshot.
For each scheduler snapshot created, the scheduleris sorting the future events based on the event ordering defined in the event-registry. The first event of that order is executed (see event execution). The resulting new values of state, past events, future events are used to create the new scheduler snapshot.
An event has three parameters (event-execution current-event state new-future-events)
:
current-event
which is the current event to executestate
which is the state value before the event executionnew-future-events
which is the list of future events without the current eventThe returned value is a event-return
, which future events have no needs to be sorted, they will be by the scheduler.
This event-return
contains the stop reason, that could be:
::no-future-events
when no future events exists
::causality-broken
when the date of the event is in the past
::execution-not-found
when the type is unknown
::failed-event-execution
when the execution of the event if raising an exception
::nil-handler
when the handler is not given
::max-iteration-number
the maximum iteartion number is reached
Causality is a property of the simulation model stating that a future event cannot change what has been done in the past already, so all changes in the state should not contradict any past event. For instance, anticipating an event would lead to causality violation.
Scheduler The scheduler is creating the next scheduler snapshot, until the stopping criteria are met. It is executing scheduler middleware with each scheduler snapshot. For each scheduler snapshot created, the scheduleris sorting the future events based on the event ordering defined in the event-registry. The first event of that order is executed (see event execution). The resulting new values of state, past events, future events are used to create the new scheduler snapshot. An event has three parameters `(event-execution current-event state new-future-events)`: * `current-event` which is the current event to execute * `state` which is the state value before the event execution * `new-future-events` which is the list of future events without the current event The returned value is a `event-return`, which future events have no needs to be sorted, they will be by the scheduler. This `event-return` contains the stop reason, that could be: * `::no-future-events` when no future events exists * `::causality-broken` when the date of the event is in the past * `::execution-not-found` when the type is unknown * `::failed-event-execution` when the execution of the event if raising an exception * `::nil-handler` when the handler is not given * `::max-iteration-number` the maximum iteartion number is reached * [See entity](docs/archi/scheduler_entity.png) * [See aggregate](docs/archi/scheduler_aggregate.png) * [See state diagram](docs/archi/scheduler_state.png) ### Causality Causality is a property of the simulation model stating that a future event cannot change what has been done in the past already, so all changes in the state should not contradict any past event. For instance, anticipating an event would lead to causality violation.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close