pub struct MatrixTracer<P, T, A, N, C, M, S>where
P: Place,
T: Transition,
A: Arc,
N: Net<Place = P, Transition = T, Arc = A>,
C: Tokens,
M: Marking<Tokens = C>,
S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M>,{ /* private fields */ }Expand description
This type implements the tracer trait to output a matrix which contains the tokens value for each place, and a flag for enabled transitions, on completion of each step.
§Example
Given the simple net \(\circ\rightarrow\rule[-1pt]{3pt}{0.75em}\rightarrow\circ\), the matrix is as follows:
| # | p0 | p1 | t0 |
|---|---|---|---|
| 0 | ● | Y | |
| 1 | ● |
Implementations§
Source§impl<P, T, A, N, C, M, S> MatrixTracer<P, T, A, N, C, M, S>where
P: Place,
T: Transition,
A: Arc,
N: Net<Place = P, Transition = T, Arc = A>,
C: Tokens,
M: Marking<Tokens = C>,
S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M>,
impl<P, T, A, N, C, M, S> MatrixTracer<P, T, A, N, C, M, S>where
P: Place,
T: Transition,
A: Arc,
N: Net<Place = P, Transition = T, Arc = A>,
C: Tokens,
M: Marking<Tokens = C>,
S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M>,
Trait Implementations§
Source§impl<P, T, A, N, C, M, S> Debug for MatrixTracer<P, T, A, N, C, M, S>
impl<P, T, A, N, C, M, S> Debug for MatrixTracer<P, T, A, N, C, M, S>
Source§impl<P, T, A, N, C, M, S> Default for MatrixTracer<P, T, A, N, C, M, S>where
P: Place,
T: Transition,
A: Arc,
N: Net<Place = P, Transition = T, Arc = A>,
C: Tokens,
M: Marking<Tokens = C>,
S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M>,
impl<P, T, A, N, C, M, S> Default for MatrixTracer<P, T, A, N, C, M, S>where
P: Place,
T: Transition,
A: Arc,
N: Net<Place = P, Transition = T, Arc = A>,
C: Tokens,
M: Marking<Tokens = C>,
S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M>,
Source§impl<P, T, A, N, C, M, S> SimulationTracer for MatrixTracer<P, T, A, N, C, M, S>where
P: Place,
T: Transition,
A: Arc,
N: Net<Place = P, Transition = T, Arc = A>,
C: Tokens,
M: Marking<Tokens = C>,
S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M>,
impl<P, T, A, N, C, M, S> SimulationTracer for MatrixTracer<P, T, A, N, C, M, S>where
P: Place,
T: Transition,
A: Arc,
N: Net<Place = P, Transition = T, Arc = A>,
C: Tokens,
M: Marking<Tokens = C>,
S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M>,
type Place = P
type Transition = T
type Arc = A
type Net = N
type Tokens = C
type Marking = M
type Simulation = S
Source§fn started(&self, sim: &Self::Simulation)
fn started(&self, sim: &Self::Simulation)
This event is generated when the simulation takes its first step, but before the
step_started event.Source§fn step_ended(&self, step: Step, sim: &Self::Simulation)
fn step_ended(&self, step: Step, sim: &Self::Simulation)
This event is generated when the simulation completes a step. It is generated after all
enabled transitions have fired.
Source§fn step_started(&self, step: Step, sim: &Self::Simulation)
fn step_started(&self, step: Step, sim: &Self::Simulation)
This event is generated when the simulation takes a step. It is generated before any
evaluation of the net marking.
Source§fn place_updated(&self, place: NodeId, sim: &Self::Simulation)
fn place_updated(&self, place: NodeId, sim: &Self::Simulation)
This is generated for any place that has had its tokens updated, either added or
subtracted.
Source§fn transition_started(&self, transition: NodeId, sim: &Self::Simulation)
fn transition_started(&self, transition: NodeId, sim: &Self::Simulation)
This is generated when a transition is fired. At this point all input tokens have been
consumed from the preset but no output tokens have been transmitted.
Source§fn transition_ended(&self, transition: NodeId, sim: &Self::Simulation)
fn transition_ended(&self, transition: NodeId, sim: &Self::Simulation)
This is generated when a transition has been completed. At this point all output tokens
have been transmitted to the postset.
Source§fn ended(&self, sim: &Self::Simulation)
fn ended(&self, sim: &Self::Simulation)
This event is generated if, and when, the simulation determines that the net is
terminated.
Auto Trait Implementations§
impl<P, T, A, N, C, M, S> Freeze for MatrixTracer<P, T, A, N, C, M, S>
impl<P, T, A, N, C, M, S> RefUnwindSafe for MatrixTracer<P, T, A, N, C, M, S>where
N: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, T, A, N, C, M, S> Send for MatrixTracer<P, T, A, N, C, M, S>
impl<P, T, A, N, C, M, S> Sync for MatrixTracer<P, T, A, N, C, M, S>
impl<P, T, A, N, C, M, S> Unpin for MatrixTracer<P, T, A, N, C, M, S>
impl<P, T, A, N, C, M, S> UnwindSafe for MatrixTracer<P, T, A, N, C, M, S>where
N: UnwindSafe,
S: UnwindSafe,
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