[][src]Struct pns::SimulatedNet

pub struct SimulatedNet {
    pub states: Vec<State>,
    // some fields omitted
}

A wrapper type for net to support managing multiple states for simulations.

Fields

states: Vec<State>

The states of the net. Cannot be changed directly.

Implementations

impl SimulatedNet[src]

pub fn new() -> SimulatedNet[src]

Create a new, empty petri net in simulated state.

pub fn load(filename: &str) -> Option<SimulatedNet>[src]

Load a petri net from a file in simulated state.

pub fn from_net(net: Net) -> SimulatedNet[src]

Convert a Net to a SimulatedNet for advanced simulation.

pub fn add_state(&mut self)[src]

Add a new, empty state for simulation of a petri net. The state is bound to the lifetime of the simulated net.

#[must_use]pub fn load_state(&mut self, filename: &str) -> Option<()>[src]

Load a simulation state from a file. Using the wrong file layout will fail or create confusing state.

pub fn state<'net>(&'net self, index: usize) -> SimulationState<'net>[src]

Get the simulation state of a net at the specified index.

pub fn state_mut<'net>(&'net mut self, index: usize) -> SimulationStateMut<'net>[src]

Get the simulation state of a net at the specified index.

pub fn len(&self) -> usize[src]

Calculate the number of states.

pub fn release(self) -> Net[src]

Release the Net from the SimulatedNet again. Destroys the simulation state.

Methods from Deref<Target = Net>

Trait Implementations

impl Clone for SimulatedNet[src]

impl Deref for SimulatedNet[src]

type Target = Net

The resulting type after dereferencing.

impl<'net> IntoIterator for &'net SimulatedNet[src]

type Item = SimulationState<'net>

The type of the elements being iterated over.

type IntoIter = Iter<'net>

Which kind of iterator are we turning this into?

impl<'net> IntoIterator for &'net mut SimulatedNet[src]

type Item = SimulationStateMut<'net>

The type of the elements being iterated over.

type IntoIter = IterMut<'net>

Which kind of iterator are we turning this into?

impl SafeNet for SimulatedNet[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.