[−][src]Struct pns::SimulatedNet
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]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Deref for SimulatedNet
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
impl SafeNet for SimulatedNet
[src]
fn save(&self, filename: &str) -> bool
[src]
fn transitions(&self) -> &[Node]
[src]
fn reusable_transition(&self) -> Option<u32>
[src]
fn places(&self) -> &[Node]
[src]
fn reusable_place(&self) -> Option<u32>
[src]
fn initial_token_counts(&self) -> &[u32]
[src]
fn add_place(&mut self) -> u32
[src]
fn add_transition(&mut self) -> u32
[src]
fn add_connected_transition(&mut self, pids: &[u32]) -> u32
[src]
fn remove_place(&mut self, pid: u32)
[src]
fn connect_out(&mut self, tid: u32, pid: u32) -> bool
[src]
fn disconnect_in(&mut self, tid: u32, pid: u32)
[src]
fn duplicate_transition(&mut self, tid: u32) -> u32
[src]
fn duplicate_place(&mut self, pid: u32) -> u32
[src]
fn start(&mut self, pid: u32, count: u32) -> u32
[src]
fn dynamic(self) -> DynamicNet
[src]
Auto Trait Implementations
impl RefUnwindSafe for SimulatedNet
impl !Send for SimulatedNet
impl !Sync for SimulatedNet
impl Unpin for SimulatedNet
impl UnwindSafe for SimulatedNet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
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, 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>,