pub struct PetriNet {
pub places: HashMap<String, Place>,
pub transitions: HashMap<String, Transition>,
pub arcs: Vec<Arc>,
pub token: Vec<String>,
}Expand description
A complete Petri net model.
Fields§
§places: HashMap<String, Place>§transitions: HashMap<String, Transition>§arcs: Vec<Arc>§token: Vec<String>Implementations§
Source§impl PetriNet
impl PetriNet
Sourcepub fn add_place(
&mut self,
label: impl Into<String>,
initial: Vec<f64>,
capacity: Vec<f64>,
x: f64,
y: f64,
label_text: Option<String>,
) -> &Place
pub fn add_place( &mut self, label: impl Into<String>, initial: Vec<f64>, capacity: Vec<f64>, x: f64, y: f64, label_text: Option<String>, ) -> &Place
Adds a place to the net.
Sourcepub fn add_transition(
&mut self,
label: impl Into<String>,
role: impl Into<String>,
x: f64,
y: f64,
label_text: Option<String>,
) -> &Transition
pub fn add_transition( &mut self, label: impl Into<String>, role: impl Into<String>, x: f64, y: f64, label_text: Option<String>, ) -> &Transition
Adds a transition to the net.
Sourcepub fn add_arc(
&mut self,
source: impl Into<String>,
target: impl Into<String>,
weight: Vec<f64>,
inhibit_transition: bool,
)
pub fn add_arc( &mut self, source: impl Into<String>, target: impl Into<String>, weight: Vec<f64>, inhibit_transition: bool, )
Adds an arc to the net.
Sourcepub fn input_arcs(&self, transition_label: &str) -> Vec<&Arc>
pub fn input_arcs(&self, transition_label: &str) -> Vec<&Arc>
Returns all arcs that lead into the given transition.
Sourcepub fn output_arcs(&self, transition_label: &str) -> Vec<&Arc>
pub fn output_arcs(&self, transition_label: &str) -> Vec<&Arc>
Returns all arcs that lead out from the given transition.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PetriNet
impl RefUnwindSafe for PetriNet
impl Send for PetriNet
impl Sync for PetriNet
impl Unpin for PetriNet
impl UnsafeUnpin for PetriNet
impl UnwindSafe for PetriNet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more