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 voidclear()Empties the event list at the ports of the associated model.voiddeltfcn()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.voidexit()This is a special function, out of the DEVS formalism, that allows to realize some actions when the simulation ends.AtomicgetModel()Gets the associated model of the simulator.voidinitialize()Initializes the simulator and the associated model.voidlambda()Executes the output function of the DEVS simulation.doubleta()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:AbstractSimulatorInitializes 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:
initializein classAbstractSimulator
-
exit
public void exit()
Description copied from class:AbstractSimulatorThis is a special function, out of the DEVS formalism, that allows to realize some actions when the simulation ends.- Specified by:
exitin classAbstractSimulator
-
ta
public double ta()
Description copied from class:AbstractSimulatorExecutes the time advance mechanism of the DEVS simulation.- Specified by:
tain classAbstractSimulator- Returns:
- the new DEVS sigma.
-
deltfcn
public void deltfcn()
Description copied from class:AbstractSimulatorExecutes 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:
deltfcnin classAbstractSimulator
-
lambda
public void lambda()
Description copied from class:AbstractSimulatorExecutes the output function of the DEVS simulation.- Specified by:
lambdain classAbstractSimulator
-
clear
public void clear()
Description copied from class:AbstractSimulatorEmpties the event list at the ports of the associated model.- Specified by:
clearin classAbstractSimulator
-
getModel
public Atomic getModel()
Description copied from class:AbstractSimulatorGets the associated model of the simulator.- Specified by:
getModelin classAbstractSimulator- Returns:
- the associated model of the simulator.
-
-