Struct process_mining::PetriNet
source · pub struct PetriNet {
pub places: HashMap<Uuid, Place>,
pub transitions: HashMap<Uuid, Transition>,
pub arcs: Vec<Arc>,
pub initial_marking: Option<Marking>,
pub final_markings: Option<Vec<Marking>>,
}Expand description
A Petri net of Places and Transitions
Bipartite graph of Places and Transitions with Arcs connecting them, as well as initial and final Markings
Fields§
§places: HashMap<Uuid, Place>Places
transitions: HashMap<Uuid, Transition>Transitions
arcs: Vec<Arc>Arcs
initial_marking: Option<Marking>Initial marking
final_markings: Option<Vec<Marking>>Final markings (any of them are accepted as a final marking)
Implementations§
source§impl PetriNet
impl PetriNet
sourcepub fn add_place(&mut self, place_id: Option<Uuid>) -> PlaceID
pub fn add_place(&mut self, place_id: Option<Uuid>) -> PlaceID
Add a place (with an optional passed UUID)
If no ID is passed, a new UUID will be generated
sourcepub fn add_transition(
&mut self,
label: Option<String>,
transition_id: Option<Uuid>
) -> TransitionID
pub fn add_transition( &mut self, label: Option<String>, transition_id: Option<Uuid> ) -> TransitionID
Add a transition with an label (and with an optional passed UUID)
If no ID is passed, a new UUID will be generated
sourcepub fn preset_of(&self, id: Uuid) -> PetriNetNodes
pub fn preset_of(&self, id: Uuid) -> PetriNetNodes
Get the preset of a PetriNet node referred to by passed id
sourcepub fn preset_of_place(&self, p: PlaceID) -> Vec<TransitionID>
pub fn preset_of_place(&self, p: PlaceID) -> Vec<TransitionID>
Get the preset of a PetriNet place
sourcepub fn preset_of_transition(&self, t: TransitionID) -> Vec<PlaceID>
pub fn preset_of_transition(&self, t: TransitionID) -> Vec<PlaceID>
Get the preset of PetriNet transition referred to by passed id
sourcepub fn postset_of(&self, id: Uuid) -> PetriNetNodes
pub fn postset_of(&self, id: Uuid) -> PetriNetNodes
Get postset of PetriNet node referred to by passed id
sourcepub fn postset_of_place(&self, p: PlaceID) -> Vec<TransitionID>
pub fn postset_of_place(&self, p: PlaceID) -> Vec<TransitionID>
Get postset of PetriNet place referred to by passed id
sourcepub fn postset_of_transition(&self, t: TransitionID) -> Vec<PlaceID>
pub fn postset_of_transition(&self, t: TransitionID) -> Vec<PlaceID>
Get postset of PetriNet transition referred to by passed id
sourcepub fn is_in_initial_marking(&self, p: &PlaceID) -> bool
pub fn is_in_initial_marking(&self, p: &PlaceID) -> bool
Check if place is in initial marking
sourcepub fn is_in_a_final_marking(&self, p: &PlaceID) -> bool
pub fn is_in_a_final_marking(&self, p: &PlaceID) -> bool
Check if place is in any final marking