Class CoordinatorDistributed
- java.lang.Object
-
- xdevs.core.simulation.AbstractSimulator
-
- xdevs.core.simulation.Coordinator
-
- xdevs.core.simulation.distributed.CoordinatorDistributed
-
public class CoordinatorDistributed extends Coordinator
Coordinator for distributed simulation This class implements the coordinator for a distributed simulation. It extends the Coordinator class and implements the methods to execute the simulation in a distributed way.
-
-
Field Summary
-
Fields inherited from class xdevs.core.simulation.Coordinator
model, simulators
-
Fields inherited from class xdevs.core.simulation.AbstractSimulator
clock, tL, tN
-
-
Constructor Summary
Constructors Constructor Description CoordinatorDistributed(CoupledDistributed model)
Constructor for the distributed coordinator.CoordinatorDistributed(SimulationClock clock, CoupledDistributed model)
Constructor for the distributed coordinator.
-
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.LinkedList<DistributedTask>
executeTasksList(int command)
Execute a list of tasks in the distributed simulation.void
exit()
This is a special function, out of the DEVS formalism, that allows to realize some actions when the simulation ends.void
initialize()
Initializes the simulator and the associated model.void
lambda()
Executes the output function of the DEVS simulation.void
propagateOutput()
Propagates the output of the model.double
ta()
Executes the time advance mechanism of the DEVS simulation.-
Methods inherited from class xdevs.core.simulation.Coordinator
buildHierarchy, getModel, getSimulators, main, propagateInput, simInject, simInject, simInject, simInject, simulate, simulate
-
-
-
-
Constructor Detail
-
CoordinatorDistributed
public CoordinatorDistributed(SimulationClock clock, CoupledDistributed model)
Constructor for the distributed coordinator.- Parameters:
clock
- Simulation clockmodel
- Coupled model
-
CoordinatorDistributed
public CoordinatorDistributed(CoupledDistributed model)
Constructor for the distributed coordinator.- Parameters:
model
- Coupled model
-
-
Method Detail
-
executeTasksList
public LinkedList<DistributedTask> executeTasksList(int command)
Execute a list of tasks in the distributed simulation.- Parameters:
command
- Command to execute- Returns:
- List of distributed tasks
-
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.- Overrides:
initialize
in classCoordinator
-
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.- Overrides:
exit
in classCoordinator
-
ta
public double ta()
Description copied from class:AbstractSimulator
Executes the time advance mechanism of the DEVS simulation.- Overrides:
ta
in classCoordinator
- Returns:
- the new DEVS sigma.
-
lambda
public void lambda()
Description copied from class:AbstractSimulator
Executes the output function of the DEVS simulation.- Overrides:
lambda
in classCoordinator
-
propagateOutput
public void propagateOutput()
Description copied from class:Coordinator
Propagates the output of the model. This method is called after the lambda function of the simulators, and it propagates the output of the models to the input of the components connected to the previuous output ports.- Overrides:
propagateOutput
in classCoordinator
-
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.- Overrides:
deltfcn
in classCoordinator
-
clear
public void clear()
Description copied from class:AbstractSimulator
Empties the event list at the ports of the associated model.- Overrides:
clear
in classCoordinator
-
-