[−][src]Struct pns::SimulatedNet
A wrapper type for net to support managing multiple states for simulations.
Methods
impl SimulatedNet
[src]
pub fn new(net: Net) -> SimulatedNet
[src]
Convert a Net
to a SimulatedNet
for advanced simulation.
pub fn with_ref<'net, F: FnMut(&'net Net, &Vec<State<'net>>)>(&self, f: F) where
Self: 'net,
[src]
Self: 'net,
Call methods on the net and and a vector of states of it.
To fill the vector use with
.
pub fn with<'net, F: FnMut(&'net Net, &mut Vec<State<'net>>)>(&mut self, f: F) where
Self: 'net,
[src]
Self: 'net,
Call methods on the net and and a mutable vector of states of it. This way new states can be added to the vector.
pub fn add<'net, F: FnMut(&'net Net) -> State<'net>>(&mut self, f: F) where
Self: 'net,
[src]
Self: 'net,
Supply a closure to it, which takes a reference to a net nad create a state to be added. This way it's even easier to add elements to a net.
pub fn add_state<'net>(&mut self) where
Self: 'net,
[src]
Self: 'net,
A simple way to add a default state to the net.
pub fn len(&self) -> usize
[src]
Calculate the number of states.
pub fn states<'net>(&'net self) -> &[State<'net>]
[src]
Access all states.
pub fn states_mut<'net>(&'net mut self) -> &mut [State<'net>]
[src]
Access all states mutable.
pub fn release(self) -> Net
[src]
Release the Net
from the SimulatedNet
again.
Methods from Deref<Target = Net>
Trait Implementations
impl SafeNet for SimulatedNet
[src]
fn save(&self, filename: &str) -> bool
[src]
fn transitions(&self) -> &[Node]
[src]
fn places(&self) -> &[Node]
[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]
impl Deref for SimulatedNet
[src]
Auto Trait Implementations
impl !Send for SimulatedNet
impl !Sync for SimulatedNet
impl Unpin for SimulatedNet
impl UnwindSafe for SimulatedNet
impl RefUnwindSafe for SimulatedNet
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,