Skip to content
Romain Franceschini edited this page Apr 27, 2020 · 7 revisions

Quartz features a multiscale representation of simulated time, as described in the following paper. The approach addresses the drawbacks of fixed-point or floating-point numbers while having restrained performances penalty compared to full arbitrary-precision approaches.

Without going into too much details, the idea is that the simulator keeps a reference to a precise representation of the current simulated time while models perceive and express time relative to their associated precision level, with duration values.

A precise point in simulated time is implemented as an arbitrary-precision integer under the TimePoint class. Its main purpose is to describe event times as offsets from a common reference point and it is meant to be used internally. The modeller should not directly manipulate such values. Instead, modellers may perturbate simulated time through Duration values.

Duration

A Duration is a fixed-point time data type which encapsulates a multiplier and a precision level (a Scale value).

Models express time values relative to the current simulated time. If an event is measured from the most recent past event, a duration value can express the elapsed time since this past event. Similarly, a duration can represent a time value from the current point in simulated time to an imminent future event, a.k.a. as a planned duration.

Clone this wiki locally