Simulator class Null safety

A functional event-based static simulator for logic behavior.

Each tick of the simulator steps through the following events and phases:

Functional behavior modelling subscribes to Simulator events and/or queries the SimulatorPhase.




hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.

Static Properties

clkStable Stream<void>
Emits an event when most events are complete, and clocks are stable.
logger Logger
A global logger object for the Simulator.
phase SimulatorPhase
Gets the current SimulatorPhase of the Simulator.
postTick Stream<void>
Emits an event after all events are completed.
preTick Stream<void>
Emits an event before any other actions take place on the tick.
simulationEnded Future<void>
Completes when the simulation has completed.
simulationHasEnded bool
Returns true iff the simulation has completed.
startTick Stream<void>
Emits an event at the start of actions within a tick.
time int
The current time in the Simulator.

Static Methods

endSimulation() → void
Halts the simulation. Allows the current tick to finish, if there is one.
hasStepsRemaining() bool
Returns true iff there are more steps for the Simulator to tick through.
injectAction(dynamic action()) → void
Adds an arbitrary action to be executed as soon as possible, during the current simulation tick if possible.
registerAction(int timestamp, void action()) → void
Registers an abritrary action to be executed at timestamp time.
registerEndOfSimulationAction(dynamic action()) → void
Registers an arbitrary action to be executed at the end of the simulation.
reset() Future<void>
Resets the entire Simulator back to its initial state.
run() Future<void>
Starts the simulation, executing all pending actions in time-order until it finishes or is stopped.
setMaxSimTime(int newMaxSimTime) → void
Sets a time, after which, the Simulator will halt processing of new actions.
tick() Future<void>
A single simulation tick.
tickExecute(void toExecute()) Future<void>
Performs the actual execution of a collection of actions for a tick().