new Ticker()
A (low) resolution clock and event queue that has the ability to queue events based on tick count and absolute time. Tickers can also
sync with other "master" clocks through the use of a catch-up/slowdown algorithm.
Members
-
target_tps :number
-
Ticks per second this clock should operate at in the long-term. If this value gets changed, catch-up algorithm precalc values will need to be changed accordingly as well.
- Default Value:
- classes.common.Ticker.TickerConstants#tps
- See:
-
- classes.common.Ticker#fast_forward_to_tick
-
target_tps :number
-
Ticks per second this clock should operate at in the long-term. If this value gets changed, catch-up algorithm precalc values will need to be changed accordingly as well.
- Default Value:
- classes.common.Ticker.TickerConstants#tps
- See:
-
- classes.common.Ticker#fast_forward_to_tick
-
tps :number
-
Ticks per second this clock is currently operating at. This value may be used as an external reference value but the most accurate measure is 1000/
classes.common.Ticker.Ticker#simulation_timestep- Default Value:
- classes.common.Ticker.TickerConstants#tps
Methods
-
__init__(idopt, opts) → {classes.common.Ticker.Ticker}
-
Default initializer for a Ticker.
Parameters:
Name Type Attributes Default Description idstring <optional>
nanotime._str The ID of this Ticker. optsObject Options for this Ticker. Properties
Name Type Attributes Default Description tpsnumber <optional>
classes.common.Ticker.TickerConstants.tps Ticks per second to operate the ticker. simulation_timestepnumber <optional>
1000/opts.tps Timestep (ms) per tick. See classes.common.Ticker.Ticker#simulation_timesteptps_alphanumber <optional>
classes.common.Ticker.TickerConstants.tps_alpha Ticks per second to operate the ticker. Returns:
classes.common.Ticker.Ticker - The initialised Ticker object. -
package, inner DefaultExports(deps) → {classes.common.Ticker.Ticker}
-
Generates a Ticker class. Called internally within the Ticker sub-folder assembly.
Parameters:
Name Type Description depsObject Dependencies of the Ticker. Properties
Name Type Description IDCreatableinterfaces.IDCreatable Ticker's super interface. TickerConstantsclasses.common.Ticker.TickerConstants Default values for a Ticker object. TickerDataManagerclasses.common.Ticker.TickerDataManager Provides data gets/sets for tickers. TickerDateTimeUpdateManagerclasses.common.Ticker.TickerDateTimeUpdateManager Manages absolute/IRL time-based timers. TickerTickCountUpdateManagerclasses.common.Ticker.TickerTickCountUpdateManager Manages tick-count-based timers. Returns:
classes.common.Ticker.Ticker - The Ticker class