Package org.oristool.simulator
Class Sequencer
java.lang.Object
org.oristool.simulator.Sequencer
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionSequencer
(PetriNet net, Marking initialMarking, SimulatorComponentsFactory<PetriNet, Transition> componentsFactory, AnalysisLogger logger) Builds a new instance for a given Petri net and initial marking. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCurrentRunObserver
(SequencerObserver observer) Adds an observer of the current simulation run.void
addObserver
(SequencerObserver observer) Adds an observer of the simulation.long
long
void
removeCurrentRunObserver
(SequencerObserver observer) Removes an observer of the current simulation run.void
removeObserver
(SequencerObserver observer) Removes an observer of the simulation.void
simulate()
Starts the simulation, running until all observers have completed.
-
Constructor Details
-
Sequencer
public Sequencer(PetriNet net, Marking initialMarking, SimulatorComponentsFactory<PetriNet, Transition> componentsFactory, AnalysisLogger logger) Builds a new instance for a given Petri net and initial marking.- Parameters:
net
- Petri netinitialMarking
- initial marking for the simulation runscomponentsFactory
- helper components driving the simulationlogger
- logger used during the simulation
-
-
Method Details
-
simulate
public void simulate()Starts the simulation, running until all observers have completed. -
addObserver
Adds an observer of the simulation.- Parameters:
observer
- simulation observer
-
removeObserver
Removes an observer of the simulation.- Parameters:
observer
- simulation observer
-
addCurrentRunObserver
Adds an observer of the current simulation run.- Parameters:
observer
- simulation observer
-
removeCurrentRunObserver
Removes an observer of the current simulation run.- Parameters:
observer
- simulation observer
-
getCurrentRunElapsedTime
-
getCurrentRunFirings
public long getCurrentRunFirings() -
getCurrentRunNumber
public long getCurrentRunNumber() -
getLastSuccession
-
getInitialMarking
-