[−][src]Trait pns::SafeNet
A trait to share safe functionality for the default Net
type and the SimulatedNet
Required methods
fn save(&self, filename: &str) -> bool
Save the petri net to a file. Result represents success.
fn transitions(&self) -> &[Node]
A slice of nodes representing the transitions of the petri net.
fn reusable_transition(&self) -> Option<u32>
Returns the index of the next reusable transition.
fn places(&self) -> &[Node]
A slice of nodes representing the places of the petri net.
fn reusable_place(&self) -> Option<u32>
Returns the index of the next reusable place.
fn initial_token_counts(&self) -> &[u32]
A slice of initial token counts for the places of the petri net.
fn add_place(&mut self) -> u32
Add a new place to the petri net and get the index.
fn add_transition(&mut self) -> u32
Add a new transition to the petri net and get the index.
fn add_connected_transition(&mut self, pids: &[u32]) -> u32
Add a new transition to the petri net, connct it to the specified places and get the index.
fn remove_place(&mut self, pid: u32)
Remove a place at index pid
from petri net.
fn connect_out(&mut self, tid: u32, pid: u32) -> bool
Make a connection out from the transitoin with index tid
to place with index pid
.
Result represents success.
fn disconnect_in(&mut self, tid: u32, pid: u32)
Make a connection into transition with index tid
from place with index pid
.
fn duplicate_transition(&mut self, tid: u32) -> u32
Duplicate the transition and get the index of the clone.
fn duplicate_place(&mut self, pid: u32) -> u32
Duplicate the place and get the index of the clone.
fn start(&mut self, pid: u32, count: u32) -> u32
Increase the initial token count in place indexed by pid
.
fn dynamic(self) -> DynamicNet
Creates a dynamic net type from a net.