Package org.oristool.simulator
Class Sequencer
java.lang.Object
org.oristool.simulator.Sequencer
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSequencer(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 TypeMethodDescriptionvoidaddCurrentRunObserver(SequencerObserver observer) Adds an observer of the current simulation run.voidaddObserver(SequencerObserver observer) Adds an observer of the simulation.longlongvoidremoveCurrentRunObserver(SequencerObserver observer) Removes an observer of the current simulation run.voidremoveObserver(SequencerObserver observer) Removes an observer of the simulation.voidsimulate()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
-