Struct desim::Simulation [] [src]

pub struct Simulation { /* fields omitted */ }

This struct provides the methods to create and run the simulation in a single thread.

It provides methods to create processes and finite resources that must be shared among them.

See the crate-level documentation for more information about how the simulation framework works

Methods

impl Simulation
[src]

[src]

[src]

Returns the current simulation time

[src]

Returns the log of processed events

[src]

Create a process. That is a generator that can Yield Effects. An effect may be a new Event to schedule, a Timeout after which the same process should be executed, or a Request to hold an instance of a finite resource.

Returns the identifier of the process.

[src]

Create a new finite resource, of which n instancies are available.

The resource can be requested by a process yielding a Request. If the requested resource is not available at that time, the process is enqueued until one instance of the resource is freed.

When the process has done with the resource, it has to yield Release, so that other processes can use that.

The queue has a FIFO (first in first out) policy.

Returns the identifier of the resource

[src]

Schedule a process to be executed. Another way to schedule events is yielding Effect::Event from a process during the simulation.

[src]

Proceed in the simulation by 1 step

[src]

Run the simulation until and ending condition is met.

Trait Implementations

impl Default for Simulation
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl !Send for Simulation

impl !Sync for Simulation