Package xdevs.core.simulation.profile
Class CoordinatorProfile
- java.lang.Object
-
- xdevs.core.simulation.AbstractSimulator
-
- xdevs.core.simulation.Coordinator
-
- xdevs.core.simulation.profile.CoordinatorProfile
-
public class CoordinatorProfile extends Coordinator
Coordinator to perform a profiling of the simulation. This class implements a coordinator to perform a profiling of the simulation.
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleexecutionTimeprotected longnumCallsToClearprotected longnumCallsToDeltFcnprotected longnumCallsToExitprotected longnumCallsToGetClockprotected longnumCallsToGetSimulatorsprotected longnumCallsToGetTLprotected longnumCallsToGetTNprotected longnumCallsToInitializeprotected longnumCallsToLambdaprotected longnumCallsToPropagateInputprotected longnumCallsToPropagateOutputprotected longnumCallsToSetTLprotected longnumCallsToSetTNprotected longnumCallsToTaprotected longtimeUsedByClearprotected longtimeUsedByDeltFcnprotected longtimeUsedByExitprotected longtimeUsedByGetClockprotected longtimeUsedByGetSimulatorsprotected longtimeUsedByGetTLprotected longtimeUsedByGetTNprotected longtimeUsedByInitializeprotected longtimeUsedByLambdaprotected longtimeUsedByPropagateInputprotected longtimeUsedByPropagateOutputprotected longtimeUsedBySetTLprotected longtimeUsedBySetTNprotected longtimeUsedByTa-
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 CoordinatorProfile(Coupled model)Constructor for the profile coordinator.CoordinatorProfile(SimulationClock clock, Coupled model)Constructor for the profile coordinator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildHierarchy()Builds the hierarchy of simulators for the model.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.SimulationClockgetClock()Gets the simulation clock of the simulator.Collection<AbstractSimulator>getSimulators()Returns the simulators of the components of the model.doublegetTL()doublegetTN()Gets the time of the next event.voidinitialize()Initializes the simulator and the associated model.voidlambda()Executes the output function of the DEVS simulation.static voidmain(String[] args)voidpropagateInput()Propagates the input of the model.voidpropagateOutput()Propagates the output of the model.voidsetTL(double tL)Sets the time of the last event.voidsetTN(double tN)Sets the time of the next event.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.doubleta()Executes the time advance mechanism of the DEVS simulation.StringtoString()
-
-
-
Field Detail
-
numCallsToInitialize
protected long numCallsToInitialize
-
timeUsedByInitialize
protected long timeUsedByInitialize
-
numCallsToExit
protected long numCallsToExit
-
timeUsedByExit
protected long timeUsedByExit
-
numCallsToTa
protected long numCallsToTa
-
timeUsedByTa
protected long timeUsedByTa
-
numCallsToDeltFcn
protected long numCallsToDeltFcn
-
timeUsedByDeltFcn
protected long timeUsedByDeltFcn
-
numCallsToLambda
protected long numCallsToLambda
-
timeUsedByLambda
protected long timeUsedByLambda
-
numCallsToClear
protected long numCallsToClear
-
timeUsedByClear
protected long timeUsedByClear
-
numCallsToGetTN
protected long numCallsToGetTN
-
timeUsedByGetTN
protected long timeUsedByGetTN
-
numCallsToGetTL
protected long numCallsToGetTL
-
timeUsedByGetTL
protected long timeUsedByGetTL
-
numCallsToSetTN
protected long numCallsToSetTN
-
timeUsedBySetTN
protected long timeUsedBySetTN
-
numCallsToSetTL
protected long numCallsToSetTL
-
timeUsedBySetTL
protected long timeUsedBySetTL
-
numCallsToGetClock
protected long numCallsToGetClock
-
timeUsedByGetClock
protected long timeUsedByGetClock
-
numCallsToGetSimulators
protected long numCallsToGetSimulators
-
timeUsedByGetSimulators
protected long timeUsedByGetSimulators
-
numCallsToPropagateOutput
protected long numCallsToPropagateOutput
-
timeUsedByPropagateOutput
protected long timeUsedByPropagateOutput
-
numCallsToPropagateInput
protected long numCallsToPropagateInput
-
timeUsedByPropagateInput
protected long timeUsedByPropagateInput
-
executionTime
protected double executionTime
-
-
Constructor Detail
-
CoordinatorProfile
public CoordinatorProfile(SimulationClock clock, Coupled model)
Constructor for the profile coordinator.- Parameters:
clock- Simulation clockmodel- Coupled model
-
CoordinatorProfile
public CoordinatorProfile(Coupled model)
Constructor for the profile coordinator.- Parameters:
model- Coupled model
-
-
Method Detail
-
buildHierarchy
protected void buildHierarchy()
Description copied from class:CoordinatorBuilds the hierarchy of simulators for the model.- Overrides:
buildHierarchyin classCoordinator
-
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
-
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
-
getTL
public double getTL()
- Overrides:
getTLin classAbstractSimulator
-
setTL
public void setTL(double tL)
Description copied from class:AbstractSimulatorSets the time of the last event.- Overrides:
setTLin classAbstractSimulator- Parameters:
tL- the time of the last event.
-
getTN
public double getTN()
Description copied from class:AbstractSimulatorGets the time of the next event.- Overrides:
getTNin classAbstractSimulator- Returns:
- the time of the next event.
-
setTN
public void setTN(double tN)
Description copied from class:AbstractSimulatorSets the time of the next event.- Overrides:
setTNin classAbstractSimulator- Parameters:
tN- the time of the next event.
-
getClock
public SimulationClock getClock()
Description copied from class:AbstractSimulatorGets the simulation clock of the simulator.- Overrides:
getClockin classAbstractSimulator- Returns:
- the simulation clock of the simulator.
-
getSimulators
public Collection<AbstractSimulator> getSimulators()
Description copied from class:CoordinatorReturns the simulators of the components of the model.- Overrides:
getSimulatorsin classCoordinator- Returns:
- the simulators of the components of the model.
-
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
-
propagateInput
public void propagateInput()
Description copied from class:CoordinatorPropagates the input of the model. This method is called before the delta function of the simulators, and it propagates the input of the models to the input of the components connected to the previuous input ports.- Overrides:
propagateInputin 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)
-
-