pub struct StateClassGraph { /* private fields */ }Expand description
State Class Graph implementing the Berthomieu-Diaz (1991) algorithm.
BFS exploration with deduplication by canonical key (marking + firing domain).
Implementations§
Source§impl StateClassGraph
impl StateClassGraph
pub fn new() -> Self
Sourcepub fn build(
net: &PetriNet,
initial_marking: &MarkingState,
max_classes: usize,
) -> Self
pub fn build( net: &PetriNet, initial_marking: &MarkingState, max_classes: usize, ) -> Self
Builds the state class graph for a Time Petri Net using BFS exploration.
Sourcepub fn build_with_env(
net: &PetriNet,
initial_marking: &MarkingState,
max_classes: usize,
env_places: &[&str],
env_mode: &EnvironmentAnalysisMode,
) -> Self
pub fn build_with_env( net: &PetriNet, initial_marking: &MarkingState, max_classes: usize, env_places: &[&str], env_mode: &EnvironmentAnalysisMode, ) -> Self
Builds with environment place support.
Sourcepub fn class_count(&self) -> usize
pub fn class_count(&self) -> usize
Returns the number of state classes.
Sourcepub fn classes(&self) -> &[StateClass]
pub fn classes(&self) -> &[StateClass]
Returns the state classes.
Sourcepub fn edges(&self) -> &[StateClassEdge]
pub fn edges(&self) -> &[StateClassEdge]
Returns all edges.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns whether the graph was fully explored (not truncated).
Sourcepub fn successors(&self, class_idx: usize) -> &[usize]
pub fn successors(&self, class_idx: usize) -> &[usize]
Returns successor class indices for a given class.
Sourcepub fn predecessors(&self, class_idx: usize) -> &[usize]
pub fn predecessors(&self, class_idx: usize) -> &[usize]
Returns predecessor class indices for a given class.
Sourcepub fn is_reachable(&self, marking: &MarkingState) -> bool
pub fn is_reachable(&self, marking: &MarkingState) -> bool
Checks if a marking is reachable (exists in any state class).
Sourcepub fn reachable_markings(&self) -> Vec<&MarkingState>
pub fn reachable_markings(&self) -> Vec<&MarkingState>
Returns all unique reachable markings.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Returns the edge count.
Sourcepub fn enabled_transitions(&self, class_idx: usize) -> &[String]
pub fn enabled_transitions(&self, class_idx: usize) -> &[String]
Returns the enabled transition names for a state class.
Sourcepub fn branch_edges(
&self,
class_idx: usize,
transition_name: &str,
) -> Vec<&StateClassEdge>
pub fn branch_edges( &self, class_idx: usize, transition_name: &str, ) -> Vec<&StateClassEdge>
Returns edges from a given class that fired a specific transition name.
Trait Implementations§
Source§impl Debug for StateClassGraph
impl Debug for StateClassGraph
Auto Trait Implementations§
impl Freeze for StateClassGraph
impl RefUnwindSafe for StateClassGraph
impl Send for StateClassGraph
impl Sync for StateClassGraph
impl Unpin for StateClassGraph
impl UnsafeUnpin for StateClassGraph
impl UnwindSafe for StateClassGraph
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