pub struct MarkingState { /* private fields */ }Expand description
Immutable snapshot of a Petri net marking for state space analysis.
Maps places by name to integer token counts. Only stores places with count > 0.
Implementations§
Source§impl MarkingState
impl MarkingState
pub fn new() -> Self
pub fn from_map(tokens: HashMap<String, usize>) -> Self
Sourcepub fn places(&self) -> impl Iterator<Item = (&str, usize)>
pub fn places(&self) -> impl Iterator<Item = (&str, usize)>
Returns all places with non-zero counts.
Sourcepub fn total_tokens(&self) -> usize
pub fn total_tokens(&self) -> usize
Returns the total number of tokens across all places.
Sourcepub fn has_tokens_in_any(&self, place_names: &[&str]) -> bool
pub fn has_tokens_in_any(&self, place_names: &[&str]) -> bool
Returns true if this marking has tokens in any of the named places.
Sourcepub fn canonical_key(&self) -> String
pub fn canonical_key(&self) -> String
Generates a canonical key for deduplication.
Trait Implementations§
Source§impl Clone for MarkingState
impl Clone for MarkingState
Source§fn clone(&self) -> MarkingState
fn clone(&self) -> MarkingState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarkingState
impl Debug for MarkingState
Source§impl Default for MarkingState
impl Default for MarkingState
Source§impl PartialEq for MarkingState
impl PartialEq for MarkingState
impl Eq for MarkingState
impl StructuralPartialEq for MarkingState
Auto Trait Implementations§
impl Freeze for MarkingState
impl RefUnwindSafe for MarkingState
impl Send for MarkingState
impl Sync for MarkingState
impl Unpin for MarkingState
impl UnsafeUnpin for MarkingState
impl UnwindSafe for MarkingState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more