Module sim::simulator

source ·
Expand description

The simulator module provides the mechanics to orchestrate the models and connectors via discrete event simulation. The specific formalism for simulation execution is the Discrete Event System Specification. User interaction is also captured in this module - simulation stepping and input injection.

Simulation and WebSimulation are used for Rust- and npm-based projects, respectively. The Simulation methods use the associated struct types directly, while the WebSimulation provides an interface with better JS/WASM compatibility.

Most simulation analysis will involve the collection, transformation, and analysis of messages. The step, step_n, and step_until methods return the messages generated during the execution of the simulation step(s), for use in message analysis.




  • The Simulation struct is the core of sim, and includes everything needed to run a simulation - models, connectors, and a random number generator. State information, specifically global time and active messages are additionally retained in the struct.