pub struct PetriNet {
pub places: Vec<Place>,
pub transitions: Vec<Transition>,
pub arcs: Vec<Arc>,
pub initial_marking: PackedKeyTable<String, usize>,
pub final_markings: Vec<PackedKeyTable<String, usize>>,
pub cached_incidence: Option<FlatIncidenceMatrix>,
pub cached_index: Option<DenseIndex>,
}Fields§
§places: Vec<Place>§transitions: Vec<Transition>§arcs: Vec<Arc>§initial_marking: PackedKeyTable<String, usize>§final_markings: Vec<PackedKeyTable<String, usize>>§cached_incidence: Option<FlatIncidenceMatrix>Cached flat incidence matrix
cached_index: Option<DenseIndex>Cached dense index for fast node lookups
Implementations§
Source§impl PetriNet
impl PetriNet
Sourcepub fn is_structural_workflow_net(&self) -> bool
pub fn is_structural_workflow_net(&self) -> bool
Evaluates if the net is a structurally valid workflow net. Highly optimized with pre-calculated indices and bitset algebra.
Sourcepub fn compile_incidence(&mut self)
pub fn compile_incidence(&mut self)
Compiles the incidence matrix and node index for maximum performance.
Sourcepub fn incidence_matrix(&self) -> FlatIncidenceMatrix
pub fn incidence_matrix(&self) -> FlatIncidenceMatrix
Generates the Incidence Matrix (W) in a flat representation. Returns the cached matrix if available, otherwise computes it on the fly.
Sourcepub fn verifies_state_equation_calculus(&self) -> bool
pub fn verifies_state_equation_calculus(&self) -> bool
Verifies the structural bounds of the workflow net state equation. A transition must have at least one input place and one output place.
Sourcepub fn structural_unsoundness_score(&self) -> f32
pub fn structural_unsoundness_score(&self) -> f32
Computes a smooth unsoundness score using bitset algebra and FxHash.
Sourcepub fn mdl_score(&self) -> f64
pub fn mdl_score(&self) -> f64
Computes the MDL score of the model as: transitions + (arcs * log2(vocabulary_size)) AC 3.1: Ontology size |O*| is treated as the theoretical upper bound for |T|.
pub fn mdl_score_with_ontology(&self, ontology_size: Option<usize>) -> f64
pub fn explain(&self) -> String
Sourcepub fn canonical_hash(&self) -> u64
pub fn canonical_hash(&self) -> u64
Optimized to use direct ID hashing instead of expensive string formatting.