Skip to main content

StateClassGraph

Struct StateClassGraph 

Source
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

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

pub fn class_count(&self) -> usize

Returns the number of state classes.

Source

pub fn classes(&self) -> &[StateClass]

Returns the state classes.

Source

pub fn edges(&self) -> &[StateClassEdge]

Returns all edges.

Source

pub fn is_complete(&self) -> bool

Returns whether the graph was fully explored (not truncated).

Source

pub fn successors(&self, class_idx: usize) -> &[usize]

Returns successor class indices for a given class.

Source

pub fn predecessors(&self, class_idx: usize) -> &[usize]

Returns predecessor class indices for a given class.

Source

pub fn is_reachable(&self, marking: &MarkingState) -> bool

Checks if a marking is reachable (exists in any state class).

Source

pub fn reachable_markings(&self) -> Vec<&MarkingState>

Returns all unique reachable markings.

Source

pub fn edge_count(&self) -> usize

Returns the edge count.

Source

pub fn enabled_transitions(&self, class_idx: usize) -> &[String]

Returns the enabled transition names for a state class.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StateClassGraph

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.