Package xdevs.core.simulation
Class Simulator
- java.lang.Object
-
- xdevs.core.simulation.AbstractSimulator
-
- xdevs.core.simulation.Simulator
-
- Direct Known Subclasses:
SimulatorDistributed
,SimulatorProfile
public class Simulator extends AbstractSimulator
This class represents a parallel DEVS simulator, in xDEVS style. The simulator is responsible for the simulation of a DEVS model, and it is composed of a simulation clock and the model to simulate. The simulator is responsible for the initialization, execution and termination of the simulation.
-
-
Constructor Summary
Constructors Constructor Description Simulator(SimulationClock clock, Atomic model)
Creates a new simulator with the given simulation clock and model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Empties the event list at the ports of the associated model.void
deltfcn()
Executes one of the transition functions of the DEVS simulation, depending on the current state of the model and whether there are new events or not.void
exit()
This is a special function, out of the DEVS formalism, that allows to realize some actions when the simulation ends.Atomic
getModel()
Gets the associated model of the simulator.void
initialize()
Initializes the simulator and the associated model.void
lambda()
Executes the output function of the DEVS simulation.double
ta()
Executes the time advance mechanism of the DEVS simulation.
-
-
-
Field Detail
-
model
protected Atomic model
The model to simulate.
-
-
Constructor Detail
-
Simulator
public Simulator(SimulationClock clock, Atomic model)
Creates a new simulator with the given simulation clock and model.- Parameters:
clock
- the simulation clock of the simulator.model
- the model to simulate.
-
-
Method Detail
-
initialize
public void initialize()
Description copied from class:AbstractSimulator
Initializes the simulator and the associated model. This is not part of the DEVS formalism, but it is a necessary step to prepare the simulator for the simulation.- Specified by:
initialize
in classAbstractSimulator
-
exit
public void exit()
Description copied from class:AbstractSimulator
This is a special function, out of the DEVS formalism, that allows to realize some actions when the simulation ends.- Specified by:
exit
in classAbstractSimulator
-
ta
public double ta()
Description copied from class:AbstractSimulator
Executes the time advance mechanism of the DEVS simulation.- Specified by:
ta
in classAbstractSimulator
- Returns:
- the new DEVS sigma.
-
deltfcn
public void deltfcn()
Description copied from class:AbstractSimulator
Executes one of the transition functions of the DEVS simulation, depending on the current state of the model and whether there are new events or not.- Specified by:
deltfcn
in classAbstractSimulator
-
lambda
public void lambda()
Description copied from class:AbstractSimulator
Executes the output function of the DEVS simulation.- Specified by:
lambda
in classAbstractSimulator
-
clear
public void clear()
Description copied from class:AbstractSimulator
Empties the event list at the ports of the associated model.- Specified by:
clear
in classAbstractSimulator
-
getModel
public Atomic getModel()
Description copied from class:AbstractSimulator
Gets the associated model of the simulator.- Specified by:
getModel
in classAbstractSimulator
- Returns:
- the associated model of the simulator.
-
-