
public class CoupledDevs extends Devs implements ICoupledDevs
Coupled models are basically sophisticated directed graphs of DEVS models
(Atomic or Coupled). The links in the graph represented by the coupled model
actually represent a communication link between the two components (either
one of the subcomponent of the coupled model or itself). Coupled models are
passive objects (as opposed to atomic models, see AtomicDevs), so
they only help transmitting in and lambda the messages they receive.
They are managed by Coordinator. A DEVS
simulation always begins by
the creation of a root coupled model around which a
Coordinator will
be instantiated.
| Modifier and Type | Class and Description |
|---|---|
static class |
CoupledDevs.CoupledFactory
The default factory of the
CoupledDevs class. |
Devs.DevsFactory| Modifier and Type | Field and Description |
|---|---|
protected Map<String,IDevs> |
_componentDictionary
A dictionary that associates DEVS models to a name.
|
protected Set<IDevs> |
_components
HashSet of DEVS models (atomic and coupled) that compose this model.
|
protected MultiMap<Map.Entry<INamed,Port>,Map.Entry<INamed,Port>> |
_couplingInfo
A MultiMap that contains internal coupling information.
|
_inputMessage, _inputPorts, _name, _output, _outputPorts, _parent, _simulator| Modifier | Constructor and Description |
|---|---|
protected |
CoupledDevs(String name)
Creates a new instance with the passed name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(IDevs iod)
Add a new Devs model (atomic or coupled) into the Devs coupled model
|
void |
addCoupling(IDevs src,
String p1,
IDevs dest,
String p2)
Add a new coupling relation between internal model or between the
coupled model and its internals models.
|
void |
addPair(Map.Entry<INamed,Port> cs,
Map.Entry<INamed,Port> cd)
Add a coupling data represent as a pair of string for the key and a
pair of string for the value.
|
Map<String,IDevs> |
componentDictionary()
Getter on a dictionary associating all internal models to their
names.
|
Set<IDevs> |
components()
Getter on the HashSet that contains all internal models.
|
MultiMap<Map.Entry<INamed,Port>,Map.Entry<INamed,Port>> |
couplingInfo()
Getter on the MultiMap that contains all coupling relation that is to
say associate a pair model/port to
another.
|
void |
initialize()
Iteratively initializes all subcomponents of this coupled model.
|
void |
setSimulator(ICoordinator simulator)
Setter on the model's simulator.
|
ICoordinator |
simulator()
Getter on the model's simulator that is actually a Coordinator for
coupled models.
|
String |
toString()
Generate a String of the instance.
|
addInport, addOutport, compareTo, fullName, makeContent, name, parent, setParent, setSimulatorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitact, addInport, addOutport, deltcon, deltext, deltint, fullName, lambda, parent, setParent, setSimulator, tacompareToprotected Set<IDevs> _components
protected Map<String,IDevs> _componentDictionary
protected CoupledDevs(String name)
name - New model's name.public Map<String,IDevs> componentDictionary()
componentDictionary in interface ICoupledDevspublic ICoordinator simulator()
public void setSimulator(ICoordinator simulator)
setSimulator in interface ICoupledDevssimulator - The new model's simulator.public Set<IDevs> components()
components in interface ICoupledDevspublic MultiMap<Map.Entry<INamed,Port>,Map.Entry<INamed,Port>> couplingInfo()
couplingInfo in interface ICoupledDevspublic void add(IDevs iod)
add in interface ICoupledDevsiod - The new Devs modelpublic void addCoupling(IDevs src, String p1, IDevs dest, String p2)
addCoupling in interface ICoupledDevssrc - The source model (internal model output or coupled model
input).p1 - The source model's port name.dest - The recipient model (internal model input or coupled model
output).p2 - The recipient model's port name.public void addPair(Map.Entry<INamed,Port> cs, Map.Entry<INamed,Port> cd)
cs - Sender data String pair.cd - Receiver data String pair.public String toString()
public void initialize()
initialize in interface IDevsCopyright © 2017–2019 UniversitĂ© CĂ´te d'Azur, CNRS, I3S. All rights reserved.