[][src]Struct pns::State

#[repr(C)]
pub struct State<'net> { pub net: &'net Net, // some fields omitted }

The state of the petri net used for simulation.

Fields

net: &'net Net

A reference to the petri net

Methods

impl<'net> State<'net>
[src]

pub fn new(net: &'net Net) -> State<'net>
[src]

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

pub fn load(net: &'net Net, filename: &str) -> Option<State<'net>>
[src]

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

pub fn save(&self, filename: &str) -> bool
[src]

Save the current state of the simulation.

pub fn call_counts(&self) -> &[u32]
[src]

List the current call counts of all transitions. Counts are counted down again when playing backwards.

pub fn token_counts(&self) -> &[u32]
[src]

List the current token counts of all transitions.

pub fn fire<'state>(&'state mut self) -> FireState<'net, 'state>
[src]

Generate a FireState to fire a transition later.

pub fn reverse(&mut self) -> bool
[src]

Reverse the play direction. Result represents forward.

Trait Implementations

impl<'_> Drop for State<'_>
[src]

impl<'net> Debug for State<'net>
[src]

Auto Trait Implementations

impl<'net> !Send for State<'net>

impl<'net> !Sync for State<'net>

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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