Skip to main content

SimBootstrap

Trait SimBootstrap 

Source
pub trait SimBootstrap:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn props(&self) -> Vec<(String, String)> { ... }
    fn build_sim(&self, config: SimConfig) -> SimConfig { ... }
    fn init(&self) { ... }
    fn on_start(&self, sim: &mut impl Sim) { ... }
    fn on_step(&self, sim: &mut impl Sim) { ... }
    fn on_end(&self, sim: &mut impl Sim) { ... }
}
Expand description

Trait for bootstrapping and configuring simulations.

Implement this trait to customize simulation behavior at various lifecycle points. All methods have default implementations that do nothing.

Provided Methods§

Source

fn props(&self) -> Vec<(String, String)>

Returns custom properties to include in simulation output.

Source

fn build_sim(&self, config: SimConfig) -> SimConfig

Modifies the simulation configuration before the simulation starts.

Source

fn init(&self)

Called once before any simulation runs begin.

Source

fn on_start(&self, sim: &mut impl Sim)

Called when a simulation run starts.

Source

fn on_step(&self, sim: &mut impl Sim)

Called on each simulation step.

Source

fn on_end(&self, sim: &mut impl Sim)

Called when a simulation run ends.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§