SimulationTracer

Trait SimulationTracer 

Source
pub trait SimulationTracer {
    type Place: Place;
    type Transition: Transition;
    type Arc: Arc;
    type Net: Net<Place = Self::Place, Transition = Self::Transition, Arc = Self::Arc>;
    type Tokens: Tokens;
    type Marking: Marking<Tokens = Self::Tokens>;
    type Simulation: Simulation<Place = Self::Place, Transition = Self::Transition, Arc = Self::Arc, Tokens = Self::Tokens, Marking = Self::Marking>;

    // Provided methods
    fn started(&self, sim: &Self::Simulation) { ... }
    fn step_started(&self, step: Step, sim: &Self::Simulation) { ... }
    fn place_updated(&self, place: NodeId, sim: &Self::Simulation) { ... }
    fn transition_started(&self, transition: NodeId, sim: &Self::Simulation) { ... }
    fn transition_ended(&self, transition: NodeId, sim: &Self::Simulation) { ... }
    fn step_ended(&self, step: Step, sim: &Self::Simulation) { ... }
    fn ended(&self, sim: &Self::Simulation) { ... }
}
Expand description

This trait is implemented to listen to events generated by the simulation as it executes.

  1. simulation started
  2. for each step:
    1. step started
    2. for each firing transition:
      1. for each input place:
        1. place updated
      2. transition started
      3. on timed transition complete
      4. for each output place:
        1. place updated
      5. transition ended
    3. step ended
  3. simulation ended

Required Associated Types§

Source

type Place: Place

Source

type Transition: Transition

Source

type Arc: Arc

Source

type Net: Net<Place = Self::Place, Transition = Self::Transition, Arc = Self::Arc>

Source

type Tokens: Tokens

Source

type Marking: Marking<Tokens = Self::Tokens>

Source

type Simulation: Simulation<Place = Self::Place, Transition = Self::Transition, Arc = Self::Arc, Tokens = Self::Tokens, Marking = Self::Marking>

Provided Methods§

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_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 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 ended(&self, sim: &Self::Simulation)

This event is generated if, and when, the simulation determines that the net is terminated.

Implementors§

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