pub struct ElementarySimulation { /* private fields */ }Implementations§
Source§impl ElementarySimulation
impl ElementarySimulation
pub fn new(net: Rc<ElementaryNet>, initial: SimpleMarking) -> Self
Trait Implementations§
Source§impl Debug for ElementarySimulation
impl Debug for ElementarySimulation
Source§impl Simulation for ElementarySimulation
impl Simulation for ElementarySimulation
type Place = SimplePlace
type Transition = SimpleTransition
type Arc = SimpleArc
type Net = ElementaryNet
type Tokens = Dot
type Marking = SimpleMarking
Source§fn current_marking(&self) -> &Self::Marking
fn current_marking(&self) -> &Self::Marking
Return a reference to the current marking of the net. If the simulation has not been
advanced by calling
step or steps this is the initial marking.Source§fn current_step(&self) -> Step
fn current_step(&self) -> Step
Return the current step in the simulation. If the simulation has not been advanced by
calling
step or steps this is Step::ZERO.Source§fn step(&mut self) -> Result<(), Error>
fn step(&mut self) -> Result<(), Error>
Advance the simulation by one step returning the marking after the step has been taken.
Source§fn steps(&mut self, steps: Duration) -> Result<(), Error>
fn steps(&mut self, steps: Duration) -> Result<(), Error>
Advance the simulation by
steps returning the marking after all steps were taken.Source§fn enabled(&self) -> Vec<NodeId>
fn enabled(&self) -> Vec<NodeId>
Return a list of node identifiers corresponding to all the enabled transitions at this
step.
Source§fn is_enabled(&self, transition: &Self::Transition) -> bool
fn is_enabled(&self, transition: &Self::Transition) -> bool
Return
true if transition is enabled at this step, else false.Source§fn is_complete(&self) -> Option<bool>
fn is_complete(&self) -> Option<bool>
Not all nets can determine termination, if it is possible to determine termination return
Some(...), else None.Source§impl TraceableSimulation for ElementarySimulation
impl TraceableSimulation for ElementarySimulation
Source§fn add_tracer<Tracer>(&mut self, tracer: Rc<Tracer>)where
Tracer: SimulationTracer<Place = SimplePlace, Transition = Self::Transition, Arc = Self::Arc, Net = Self::Net, Tokens = Self::Tokens, Marking = Self::Marking, Simulation = Self> + 'static,
fn add_tracer<Tracer>(&mut self, tracer: Rc<Tracer>)where
Tracer: SimulationTracer<Place = SimplePlace, Transition = Self::Transition, Arc = Self::Arc, Net = Self::Net, Tokens = Self::Tokens, Marking = Self::Marking, Simulation = Self> + 'static,
Add a tracer to this simulation.
Source§fn remove_tracer(&mut self)
fn remove_tracer(&mut self)
Remove any tracer associated with this simulation. If no tracer is associated this method
does nothing.
Auto Trait Implementations§
impl Freeze for ElementarySimulation
impl !RefUnwindSafe for ElementarySimulation
impl !Send for ElementarySimulation
impl !Sync for ElementarySimulation
impl Unpin for ElementarySimulation
impl !UnwindSafe for ElementarySimulation
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