Skip to main content

Simulation

Trait Simulation 

Source
pub trait Simulation {
    // Required methods
    fn advance(&mut self) -> Result<()>;
    fn step(&self) -> u64;
}
Expand description

Store parameters, the model and the microstate(s) it acts on.

A Simulation type stores the microstate, all model actors, and any macrostate parameters in fields. A given Simulation can be advanced forward one step at a time via the advance method.

Required Methods§

Source

fn advance(&mut self) -> Result<()>

Advance the simulation forward one step.

§Errors

When an error occurs, return an Err with any type that implements Error. The caller will catch the error and display it when exiting.

Source

fn step(&self) -> u64

Get the simulation step.

Implementors§