[−][src]Struct pns::Net
A type representing a petri net. It only stores the initial state, not the state used for simulatoin.
Fields
transition_count: u32
The count of transitions of the petri net
place_count: u32
The count of places of the petri net
Methods
impl Net
[src]
pub fn new() -> Net
[src]
Create a new, empty petri net.
pub fn load(filename: &str) -> Option<Net>
[src]
Load a petri net from a file.
pub fn remove_transition(&mut self, tid: u32)
[src]
Remove a transition at index tid
from petri net.
pub fn connect_in(&mut self, tid: u32, pid: u32) -> bool
[src]
Make a connection into transition with index tid
from place with index pid
.
Result represents success.
pub fn disconnect_out(&mut self, tid: u32, pid: u32)
[src]
Remove the connection out from transition with index tid
to place with index pid
.
Trait Implementations
impl Clone for Net
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Net
[src]
impl Drop for Net
[src]
impl SafeNet for Net
[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]
Auto Trait Implementations
impl RefUnwindSafe for Net
impl !Send for Net
impl !Sync for Net
impl Unpin for Net
impl UnwindSafe for Net
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>,