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 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.LinkedList<DistributedTask>executeTasksList(int command)Execute a list of tasks in the distributed simulation.voidexit()This is a special function, out of the DEVS formalism, that allows to realize some actions when the simulation ends.voidinitialize()Initializes the simulator and the associated model.voidlambda()Executes the output function of the DEVS simulation.voidpropagateOutput()Propagates the output of the model.doubleta()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: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.- Overrides:
initializein classCoordinator
-
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.- Overrides:
exitin classCoordinator
-
ta
public double ta()
Description copied from class:AbstractSimulatorExecutes the time advance mechanism of the DEVS simulation.- Overrides:
tain classCoordinator- Returns:
- the new DEVS sigma.
-
lambda
public void lambda()
Description copied from class:AbstractSimulatorExecutes the output function of the DEVS simulation.- Overrides:
lambdain classCoordinator
-
propagateOutput
public void propagateOutput()
Description copied from class:CoordinatorPropagates 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:
propagateOutputin classCoordinator
-
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.- Overrides:
deltfcnin classCoordinator
-
clear
public void clear()
Description copied from class:AbstractSimulatorEmpties the event list at the ports of the associated model.- Overrides:
clearin classCoordinator
-
-