Trait AbstractSimulator

Source
pub unsafe trait AbstractSimulator: Component {
    // Required methods
    fn start(&mut self, t_start: f64) -> f64;
    fn stop(&mut self, t_stop: f64);
    fn lambda(&mut self, t: f64);
    fn delta(&mut self, t: f64) -> f64;
}
Expand description

Interface for simulating DEVS models. All DEVS models must implement this trait.

§Safety

This trait must be implemented via macros. Do not implement it manually.

Required Methods§

Source

fn start(&mut self, t_start: f64) -> f64

It starts the simulation, setting the initial time to t_start. It returns the time for the next state transition of the inner DEVS model.

Source

fn stop(&mut self, t_stop: f64)

It stops the simulation, setting the last time to t_stop.

Source

fn lambda(&mut self, t: f64)

Executes output functions and propagates messages according to EOCs. Internally, it checks that the model is imminent before executing.

Source

fn delta(&mut self, t: f64) -> f64

Propagates messages according to ICs and EICs and executes model transition functions. It also clears all the input and output ports. Internally, it checks that the model is imminent before executing. Finally, it returns the time for the next state transition of the inner DEVS model.

Implementors§