MatrixTracer

Struct MatrixTracer 

Source
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:

#p0p1t0
0Y
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>,

Source

pub fn new(show_empty: bool) -> Self

Trait Implementations§

Source§

impl<P, T, A, N, C, M, S> Debug for MatrixTracer<P, T, A, N, C, M, S>
where P: Place + Debug, T: Transition + Debug, A: Arc + Debug, N: Net<Place = P, Transition = T, Arc = A> + Debug, C: Tokens + Debug, M: Marking<Tokens = C> + Debug, S: Simulation<Place = P, Transition = T, Arc = A, Tokens = C, Marking = M> + Debug,

Source§

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

Formats the value using the given formatter. Read more
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>,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
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>,

Source§

type Place = P

Source§

type Transition = T

Source§

type Arc = A

Source§

type Net = N

Source§

type Tokens = C

Source§

type Marking = M

Source§

type Simulation = S

Source§

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)

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)

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)

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)

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)

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)

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>

§

impl<P, T, A, N, C, M, S> Send for MatrixTracer<P, T, A, N, C, M, S>
where N: Send, S: Send,

§

impl<P, T, A, N, C, M, S> Sync for MatrixTracer<P, T, A, N, C, M, S>
where N: Sync, S: Sync,

§

impl<P, T, A, N, C, M, S> Unpin for MatrixTracer<P, T, A, N, C, M, S>
where N: Unpin, S: Unpin,

§

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> 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.