pub struct CompiledNet { /* private fields */ }Expand description
Integer-indexed, precomputed representation of a PetriNet for bitmap-based execution.
Uses u64 bitmasks (64 bits per word) for O(W) enablement checks where W = ceil(place_count / 64).
Implementations§
Source§impl CompiledNet
impl CompiledNet
Sourcepub fn compile(net: &PetriNet) -> Self
pub fn compile(net: &PetriNet) -> Self
Compiles a PetriNet into an optimized bitmap representation.
Sourcepub fn transition(&self, tid: usize) -> &Transition
pub fn transition(&self, tid: usize) -> &Transition
Returns the transition at the given compiled ID.
Sourcepub fn place_id(&self, name: &str) -> Option<usize>
pub fn place_id(&self, name: &str) -> Option<usize>
Returns the place ID for a given place name.
Sourcepub fn place_id_or_panic(&self, name: &str) -> usize
pub fn place_id_or_panic(&self, name: &str) -> usize
Returns the place ID, panicking if not found.
Sourcepub fn affected_transitions(&self, pid: usize) -> &[usize]
pub fn affected_transitions(&self, pid: usize) -> &[usize]
Returns affected transition IDs for a place.
Sourcepub fn consumption_place_ids(&self, tid: usize) -> &[usize]
pub fn consumption_place_ids(&self, tid: usize) -> &[usize]
Returns consumption place IDs for a transition.
Sourcepub fn cardinality_check(&self, tid: usize) -> Option<&CardinalityCheck>
pub fn cardinality_check(&self, tid: usize) -> Option<&CardinalityCheck>
Returns the cardinality check for a transition, if any.
Sourcepub fn has_guards(&self, tid: usize) -> bool
pub fn has_guards(&self, tid: usize) -> bool
Returns whether a transition has guard predicates.
Sourcepub fn needs_mask(&self, tid: usize) -> &[u64]
pub fn needs_mask(&self, tid: usize) -> &[u64]
Returns the needs mask slice for a transition.
Sourcepub fn inhibitor_mask(&self, tid: usize) -> &[u64]
pub fn inhibitor_mask(&self, tid: usize) -> &[u64]
Returns the inhibitor mask slice for a transition.
Sourcepub fn can_enable_bitmap(&self, tid: usize, marking_snapshot: &[u64]) -> bool
pub fn can_enable_bitmap(&self, tid: usize, marking_snapshot: &[u64]) -> bool
Two-phase bitmap enablement check for a transition:
- Presence check: verifies all required places have tokens
- Inhibitor check: verifies no inhibitor places have tokens
This is a necessary but not sufficient condition — cardinality and guard checks are performed separately by the executor for transitions that pass this fast path.
Trait Implementations§
Source§impl Clone for CompiledNet
impl Clone for CompiledNet
Source§fn clone(&self) -> CompiledNet
fn clone(&self) -> CompiledNet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more