
public class Coordinator extends AtomicSimulator implements ICoordinator
| Modifier and Type | Class and Description |
|---|---|
static class |
Coordinator.CoordinatorFactory
The factory of the Coordinator class.
|
AtomicSimulator.AtomicSimulatorFactorySimulator.SimulatorFactory| Modifier and Type | Field and Description |
|---|---|
protected static Factory<IAtomicSimulator> |
_coordinatorFactory
The factory for coordinators associated with this instance.
|
protected static Factory<IAtomicSimulator> |
_simulatorFactory
The factory for simulators associated with this instance.
|
protected MultiMap<Map.Entry<INamed,Port>,Map.Entry<INamed,Port>> |
extCoupInfo
The links from outside of this coordinator to itself.
|
protected Map<INamed,IAtomicSimulator> |
internalModelTosim
The internal model, that is to say the
|
_coordinators, _couplingInfo, _IMM_COMPUTE_O, _IMM_DELTFUNC, _inputMessage, _modelsToSimulate, _outputMessage, _parent, _rootParent, _scheduler, _simulators| Modifier | Constructor and Description |
|---|---|
protected |
Coordinator(ICoupledDevs coupledModel,
ICoordinator parent)
Smaller constructor
|
protected |
Coordinator(ICoupledDevs coupledModel,
ICoordinator parent,
IScheduler si)
Biggest constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCoordinator(ICoupledDevs d)
Add a coordinator to the given coupled model.
|
void |
addExtPair(Map.Entry<INamed,Port> cs,
Map.Entry<INamed,Port> cd)
Add an external pairing, that is to say a pairing from an external
model and its Port to this model and a given Port.
|
protected void |
addSimulator(IAtomicDevs d)
Create a simulator and assign it to the atomic model given in
parameter.
|
protected void |
buildImminents(Double t)
Get all imminent transitions from the scheduler.
|
void |
computeOutput(Double time)
Compute model's output message depending on it's state at a given date.
|
MultiMap<INamed,IContent> |
convertInput(Message x)
Converts an input to a map of model names to contents.
|
Set<ICoordinator> |
coordinators()
The set of coordinators in use in this simulation and under the level
of this coordinator.
|
Set<ICoordinator> |
getAllCoordinators()
A getter to the coordinators under this coordinator.
|
Set<IAtomicSimulator> |
getAllSimulators()
Returns all the simulators in use under this coordinator.
|
protected void |
informCoupling()
Creates the coupling information.
|
void |
initialize()
Initialize all subcomponents then itself, at time 0.0.
|
void |
initialize(Double currentTime)
Initialize this coordinator at a given time.
|
Map<INamed,IAtomicSimulator> |
internalModelToSim()
A getter to a dictionary to link the atomic models under the coupled
model associated with this coordinator, and their simulator.
|
ICoupledDevs |
model()
Getter on the simulated model.
|
Double |
nextTN()
Return the simulator real next event occurrence date. considering all
internal model in case of coupled model.
|
protected void |
prepareNextTurn()
Clears the sets of imminent transitions ans advance the time of this
coordinator.
|
void |
routeInMessages()
Route the messages coming from the outside of this model into this
model.
|
protected void |
routeMessages()
Sequentially routes the output messages out of this coordinator, then
the input messages inside of this model.
|
protected void |
setSimulators()
Every model under the coupled model managed by this coordinator is
assigned a Simulator or a Coordinator (depending on the class of the
model).
|
void |
simInject(Double e,
Message m)
Injects a message to this Coordinator.
|
void |
simulate(Integer itNb)
Run the simulation up to a specified iteration count.
|
protected void |
simulatorCreated(IAtomicSimulator s,
IDevs d)
When a simulator or a coordinator has been created by this coordinator,
adds it to the memory linked with their assigned model.
|
Set<IAtomicSimulator> |
simulators()
The set of all the simulators in use in this simulation and under the
level of this coordinator.
|
void |
tellAllRouteInMessages()
This method is only called by the root coordinator.
|
protected void |
tellAllRouteOutMessages()
This method is only called by the root coordinator.
|
protected void |
tellAllSimsSetModToSim(HashMap<INamed,IAtomicSimulator> inFunc)
Assigns models to simulators
|
protected void |
wrapDeltFunc(Double time)
A wrapper for calling all the transition functions of all transitioning
models.
|
addImmDelt, addInInputMessage, addInOutputMessage, addPair, convertMsg, deltFunc, deltFunc, inputMessage, outputMessage, parent, rootParent, routeOutMessages, scheduler, setModelsToSimulate, setParent, setRootParent, timeAdvanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddImmDelt, addInInputMessage, addInOutputMessage, addPair, convertMsg, inputMessage, outputMessage, parent, rootParent, routeOutMessages, scheduler, setModelsToSimulate, setParent, setRootParentdeltFunc, deltFunc, timeAdvance, tL, tNcompareToprotected Map<INamed,IAtomicSimulator> internalModelTosim
protected MultiMap<Map.Entry<INamed,Port>,Map.Entry<INamed,Port>> extCoupInfo
protected static Factory<IAtomicSimulator> _simulatorFactory
protected static Factory<IAtomicSimulator> _coordinatorFactory
protected Coordinator(ICoupledDevs coupledModel, ICoordinator parent, IScheduler si)
coupledModel - the modelparent - the parentsi - the schedulerprotected Coordinator(ICoupledDevs coupledModel, ICoordinator parent)
coupledModel - the modelparent - the parentpublic Map<INamed,IAtomicSimulator> internalModelToSim()
internalModelToSim in interface ICoordinatorprotected void setSimulators()
protected void tellAllSimsSetModToSim(HashMap<INamed,IAtomicSimulator> inFunc)
inFunc - the dictionnary linking models to simulators.public void addCoordinator(ICoupledDevs d)
addCoordinator in interface ICoordinatord - the coupled model.protected void simulatorCreated(IAtomicSimulator s, IDevs d)
s - the created simulator.d - the assigned model.public ICoupledDevs model()
model in interface ISimulatormodel in class Simulatorpublic void addExtPair(Map.Entry<INamed,Port> cs, Map.Entry<INamed,Port> cd)
addExtPair in interface ICoordinatorcs - the source of the pairing.cd - the destination of the pairing.protected void informCoupling()
public MultiMap<INamed,IContent> convertInput(Message x)
convertInput in interface ICoordinatorx - an input message.public void routeInMessages()
routeInMessages in interface ICoordinatorpublic Set<ICoordinator> getAllCoordinators()
getAllCoordinators in interface ICoordinatorprotected void addSimulator(IAtomicDevs d)
d - the atomic model that needs a simulator companion.public void simulate(Integer itNb)
simulate in interface ISimulatorsimulate in class SimulatoritNb - The maximum iteration count.protected void prepareNextTurn()
public Double nextTN()
nextTN in interface IAtomicSimulatornextTN in class AtomicSimulatorprotected void buildImminents(Double t)
t - the time of the imminent event.public void computeOutput(Double time)
computeOutput in interface IAtomicSimulatorcomputeOutput in class AtomicSimulatortime - The date to which compute output message.public void simInject(Double e, Message m)
simInject in interface ISimulatorsimInject in class Simulatore - the time, since the last event, elapsed to this message.m - the message to be injected.protected void routeMessages()
public Set<IAtomicSimulator> simulators()
simulators in interface ICoordinatorpublic Set<ICoordinator> coordinators()
coordinators in interface ICoordinatorprotected void tellAllRouteOutMessages()
public void tellAllRouteInMessages()
tellAllRouteInMessages in interface ICoordinatorprotected void wrapDeltFunc(Double time)
time - the time of the event.public void initialize()
initialize in interface ISimulatorinitialize in class Simulatorpublic void initialize(Double currentTime)
initialize in interface ISimulatorinitialize in class SimulatorcurrentTime - the time of initialization.public Set<IAtomicSimulator> getAllSimulators()
getAllSimulators in interface ICoordinatorCopyright © 2017–2019 UniversitĂ© CĂ´te d'Azur, CNRS, I3S. All rights reserved.