pub struct Simulation {
    pub state: State,
    pub scheduler: Scheduler,
    pub components: Components,
}
Expand description

Simulation struct that puts different parts of the simulation together.

See the crate-level documentation for more information.

Fields

state: State

Simulation state.

scheduler: Scheduler

Event scheduler.

components: Components

Component container.

Implementations

Performs one step of the simulation. Returns true if there was in fact an event available to process, and false otherwise, which signifies that the simulation ended.

👎 Deprecated since 0.2.0:

Handling this in Simulation is susceptible to API breaks and/or making it messy. Use execute instead, which delegates the logic to an external executor.

Runs the entire simulation from start to end. This function might not terminate if the end condition is not satisfied.

Runs the entire simulation.

The stopping condition and other execution details depend on the executor used. See Execute and Executor for more details.

Adds a new component.

Adds a new unbounded queue.

Schedules a new event to be executed at time time in component component.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.