Class SimulatorDistributed
- java.lang.Object
-
- xdevs.core.simulation.AbstractSimulator
-
- xdevs.core.simulation.Simulator
-
- xdevs.core.simulation.distributed.SimulatorDistributed
-
public class SimulatorDistributed extends Simulator
Simulator for distributed simulation. This class implements a simulator for distributed simulation. It contains a coupled parent and a boolean to indicate if the simulation has finished.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleangetOutBoolean to indicate if the simulation has finished.protected CoupledDistributedparentParent coupled model for the simulator.-
Fields inherited from class xdevs.core.simulation.AbstractSimulator
clock, tL, tN
-
-
Constructor Summary
Constructors Constructor Description SimulatorDistributed(CoupledDistributed parent, String name)Constructor for the distributed simulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageDistributedinterpreter(MessageDistributed md)This function interprets the message and executes the command.booleanisGetOut()Gets the boolean to indicate if the simulation has finished.voidpropagateOutput()Propagates the output of the model to the input of the connected models.voidpropagateOutputN2N(Collection valuesPort, String portName)Propagates the output of the model to the input of the connected models.voidrun()Run the simulator.-
Methods inherited from class xdevs.core.simulation.Simulator
clear, deltfcn, exit, getModel, initialize, lambda, ta
-
-
-
-
Field Detail
-
parent
protected CoupledDistributed parent
Parent coupled model for the simulator.
-
getOut
protected boolean getOut
Boolean to indicate if the simulation has finished.
-
-
Constructor Detail
-
SimulatorDistributed
public SimulatorDistributed(CoupledDistributed parent, String name)
Constructor for the distributed simulator.- Parameters:
parent- Parent coupled model for the simulator.name- Name of the model to simulate, child of this parent.
-
-
Method Detail
-
isGetOut
public boolean isGetOut()
Gets the boolean to indicate if the simulation has finished.- Returns:
- Boolean to indicate if the simulation has finished.
-
propagateOutput
public void propagateOutput()
Propagates the output of the model to the input of the connected models.
-
propagateOutputN2N
public void propagateOutputN2N(Collection valuesPort, String portName)
Propagates the output of the model to the input of the connected models.- Parameters:
valuesPort- Collection of values for the message.portName- Name of the port for the message.
-
interpreter
public MessageDistributed interpreter(MessageDistributed md)
This function interprets the message and executes the command.- Parameters:
md- Message to interpret.- Returns:
- Message with the response.
-
run
public void run()
Run the simulator.
-
-