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.
- simulation started
- for each step:
- step started
- for each firing transition:
- for each input place:
- place updated
- transition started
- on timed transition complete
- for each output place:
- place updated
- transition ended
- for each input place:
- step ended
- simulation ended
Required Associated Types§
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§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.