Package xdevs.core.simulation.parallel
Class CoordinatorParallel
- java.lang.Object
-
- xdevs.core.simulation.AbstractSimulator
-
- xdevs.core.simulation.Coordinator
-
- xdevs.core.simulation.parallel.CoordinatorParallel
-
- Direct Known Subclasses:
RTCentralCoordinator
public class CoordinatorParallel extends Coordinator
Parallel coordinator This class implements a parallel coordinator for DEVS models.
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkedList<TaskDeltFcn>deltfcnTasksprotected ExecutorServiceexecutorprotected LinkedList<TaskLambda>lambdaTasksprotected intnumberOfThreads-
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 CoordinatorParallel(Coupled model)Constructor for the parallel coordinator.CoordinatorParallel(Coupled model, int numberOfThreads)Constructor for the parallel coordinator.CoordinatorParallel(SimulationClock clock, Coupled model)Constructor for the parallel coordinator.CoordinatorParallel(SimulationClock clock, Coupled model, int numberOfThreads)Constructor for the parallel coordinator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildHierarchy()Builds the hierarchy of simulators for the 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.voidlambda()Executes the output function of the DEVS simulation.static voidmain(String[] args)voidsimulate(double timeInterval)This function is used to simulate the model for a given time interval.voidsimulate(long numIterations)This function is used to simulate the model for a given number of iterations.-
Methods inherited from class xdevs.core.simulation.Coordinator
clear, exit, getModel, getSimulators, initialize, propagateInput, propagateOutput, simInject, simInject, simInject, simInject, ta
-
-
-
-
Field Detail
-
numberOfThreads
protected int numberOfThreads
-
lambdaTasks
protected LinkedList<TaskLambda> lambdaTasks
-
deltfcnTasks
protected LinkedList<TaskDeltFcn> deltfcnTasks
-
executor
protected ExecutorService executor
-
-
Constructor Detail
-
CoordinatorParallel
public CoordinatorParallel(SimulationClock clock, Coupled model, int numberOfThreads)
Constructor for the parallel coordinator.- Parameters:
clock- Simulation clockmodel- Coupled modelnumberOfThreads- Number of threads
-
CoordinatorParallel
public CoordinatorParallel(Coupled model, int numberOfThreads)
Constructor for the parallel coordinator.- Parameters:
model- Coupled modelnumberOfThreads- Number of threads
-
CoordinatorParallel
public CoordinatorParallel(Coupled model)
Constructor for the parallel coordinator. It uses the number of available processors.- Parameters:
model- Coupled model
-
CoordinatorParallel
public CoordinatorParallel(SimulationClock clock, Coupled model)
Constructor for the parallel coordinator. It uses the number of available processors.- Parameters:
clock- Simulation clockmodel- Coupled model
-
-
Method Detail
-
buildHierarchy
public void buildHierarchy()
Description copied from class:CoordinatorBuilds the hierarchy of simulators for the model.- Overrides:
buildHierarchyin classCoordinator
-
lambda
public void lambda()
Description copied from class:AbstractSimulatorExecutes the output function of the DEVS simulation.- Overrides:
lambdain 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
-
simulate
public void simulate(long numIterations)
Description copied from class:CoordinatorThis function is used to simulate the model for a given number of iterations.- Overrides:
simulatein classCoordinator- Parameters:
numIterations- the number of iterations to simulate.
-
simulate
public void simulate(double timeInterval)
Description copied from class:CoordinatorThis function is used to simulate the model for a given time interval.- Overrides:
simulatein classCoordinator- Parameters:
timeInterval- the time interval to simulate.
-
main
public static void main(String[] args)
-
-