Event ordering is a part of the event registry meant to sort the future events.
It is especially important to manage simultaneous events. These events does not exists in the real life, but the.
Date ordering is sorting events by date
It could be done with compare-field
on the date field of the event (typically ::sim-engine/date
)
A simultaneous event ordering apply user defined decision on which event should be executed first
It could leverage compare-types
and compare-field
or what user defined functions
Two or more events are simultaneous if they happen at the same date in the scheduler.
Event ordering is a part of the event registry meant to sort the future events. It is especially important to manage simultaneous events. These events does not exists in the real life, but the. * [See entity](docs/archi/ordering_entity.png) ## Date ordering Date ordering is sorting events by date It could be done with `compare-field` on the date field of the event (typically `::sim-engine/date`) ## Simultaneous event ordering A simultaneous event ordering apply user defined decision on which event should be executed first It could leverage `compare-types` and `compare-field` or what user defined functions ## Simultaneous events Two or more events are simultaneous if they happen at the same date in the scheduler.
(compare-field field)
Returns a function to compare e1
and e2
based on values of field field
. nil
values are accepted.
Returns a function to compare `e1` and `e2` based on values of field `field`. `nil` values are accepted.
(compare-types evt-type-priorities)
Compares two events e1
and e2
with their types, based on their ordering in evt-type-priorities
, list of event priorities, ordered with higher priority first in the list.
Returns the difference of their position in the evt-type-priorities
, which is 0
in case of equality, negative if e1
is before e2
.
Compares two events `e1` and `e2` with their types, based on their ordering in `evt-type-priorities`, list of event priorities, ordered with higher priority first in the list. Returns the difference of their position in the `evt-type-priorities`, which is `0` in case of equality, negative if `e1` is before `e2`.
(data-to-fn [kind data :as _ordering-data])
(sorter orderings)
Returns a function with two events as parameters and returning the comparison of them, according to event-orderings.
Returns a function with two events as parameters and returning the comparison of them, according to event-orderings.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close