[−][src]Struct pns::State
The state of the petri net used for simulation.
Fields
net: &'net Net
A reference to the petri net
forward: bool
Check if current play direction is forward.
Methods
impl<'_> State<'_>
[src]
pub fn added_transitions(&mut self, forward: bool) -> Box<[u32]>
[src]
Get a list of newly fireable transitions in the specified direction since the last call of this method. Automatically clears that list.
pub fn removed_transitions(&mut self, forward: bool) -> Box<[u32]>
[src]
Get a list of nomore fireable transitions in the specified direction since the last call of this method. Automatically clears that list.
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<'_> Clone for State<'_>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<'net> !Send for State<'net>
impl<'net> Unpin for State<'net>
impl<'net> !Sync for State<'net>
impl<'net> RefUnwindSafe for State<'net>
impl<'net> UnwindSafe for State<'net>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,