Trait Atomic

Source
pub trait Atomic: PartialAtomic {
    // Required methods
    fn delta_int(state: &mut Self::State);
    fn delta_ext(state: &mut Self::State, e: f64, x: &Self::Input);
    fn lambda(state: &Self::State, output: &mut Self::Output);
    fn ta(state: &Self::State) -> f64;

    // Provided methods
    fn start(state: &mut Self::State) { ... }
    fn stop(state: &mut Self::State) { ... }
    fn delta_conf(state: &mut Self::State, x: &Self::Input) { ... }
}
Expand description

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

Required Methods§

Source

fn delta_int(state: &mut Self::State)

Internal transition function. It modifies the state of the model when an internal event happens.

Source

fn delta_ext(state: &mut Self::State, e: f64, x: &Self::Input)

External transition function. It modifies the state of the model when an external event happens. The time elapsed since the last state transition is e.

Source

fn lambda(state: &Self::State, output: &mut Self::Output)

Output function. It triggers output events when an internal event is about to happen.

Source

fn ta(state: &Self::State) -> f64

Time advance function. It returns the time until the next internal event happens.

Provided Methods§

Source

fn start(state: &mut Self::State)

Method for performing any operation before simulating. By default, it does nothing.

Source

fn stop(state: &mut Self::State)

Method for performing any operation after simulating. By default, it does nothing.

Source

fn delta_conf(state: &mut Self::State, x: &Self::Input)

Confluent transition function. It modifies the state of the model when an external and an internal event occur simultaneously. By default, it calls Atomic::delta_int and Atomic::delta_ext with e = 0, in that order.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§