Skip to main content

PetriNet

Struct PetriNet 

Source
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

Source

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.

Source

pub fn compile_incidence(&mut self)

Compiles the incidence matrix and node index for maximum performance.

Source

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.

Source

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.

Source

pub fn structural_unsoundness_score(&self) -> f32

Computes a smooth unsoundness score using bitset algebra and FxHash.

Source

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|.

Source

pub fn mdl_score_with_ontology(&self, ontology_size: Option<usize>) -> f64

Source

pub fn explain(&self) -> String

Source

pub fn canonical_hash(&self) -> u64

Optimized to use direct ID hashing instead of expensive string formatting.

Trait Implementations§

Source§

impl Clone for PetriNet

Source§

fn clone(&self) -> PetriNet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PetriNet

Source§

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

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

impl Default for PetriNet

Source§

fn default() -> PetriNet

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

impl<'de> Deserialize<'de> for PetriNet

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PetriNet

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PetriNet

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,