Skip to main content

PrecompiledNet

Struct PrecompiledNet 

Source
pub struct PrecompiledNet<'c> { /* private fields */ }
Expand description

Precompiled flat-array net representation for the super::precompiled_executor::PrecompiledNetExecutor.

Compiles the net topology into flat arrays and operation sequences that eliminate HashMap lookups and enum pattern matching from the hot path.

Implementations§

Source§

impl<'c> PrecompiledNet<'c>

Source

pub fn from_compiled(compiled: &'c CompiledNet) -> Self

Compiles using an existing CompiledNet to reuse its masks and indices.

Source

pub fn compiled(&self) -> &'c CompiledNet

Returns the underlying CompiledNet.

Source

pub fn net(&self) -> &PetriNet

Returns the underlying PetriNet.

Source

pub fn place(&self, pid: usize) -> &PlaceRef

Returns the place at the given ID.

Source

pub fn transition(&self, tid: usize) -> &Transition

Returns the transition at the given compiled ID.

Source

pub fn place_id(&self, name: &str) -> Option<usize>

Returns the place ID for a given place name.

Source

pub fn place_count(&self) -> usize

Returns the number of places.

Source

pub fn transition_count(&self) -> usize

Returns the number of transitions.

Source

pub fn word_count(&self) -> usize

Returns the word count for bitmaps.

Source

pub fn can_enable_bitmap(&self, tid: usize, marking_snapshot: &[u64]) -> bool

Sparse bitmap enablement check for a transition.

Trait Implementations§

Source§

impl<'c> Debug for PrecompiledNet<'c>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'c> Freeze for PrecompiledNet<'c>

§

impl<'c> !RefUnwindSafe for PrecompiledNet<'c>

§

impl<'c> Send for PrecompiledNet<'c>

§

impl<'c> Sync for PrecompiledNet<'c>

§

impl<'c> Unpin for PrecompiledNet<'c>

§

impl<'c> UnsafeUnpin for PrecompiledNet<'c>

§

impl<'c> !UnwindSafe for PrecompiledNet<'c>

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.