Package xdevs.core.modeling.distributed
Class CoupledDistributed
- java.lang.Object
-
- xdevs.core.modeling.Component
-
- xdevs.core.modeling.Coupled
-
- xdevs.core.modeling.distributed.CoupledDistributed
-
public class CoupledDistributed extends Coupled
This class represents a distributed coupled model. The model is defined in an XML file with the following structure:<coupled name="GPT" class="xdevs.core.examples.efp.Efp" host="192.168.1.3" mainPort="5000" auxPort="6000"> <atomic name="processor" class="xdevs.core.examples.efp.Processor" host="192.168.1.4" mainPort="5001" auxPort="6001"> <constructor-arg value="3.0"/> </atomic> <atomic name="generator" class="xdevs.core.examples.efp.Generator" host="192.168.1.5" mainPort="5002" auxPort="6002"> <constructor-arg value="1.0"/> </atomic> <atomic name="transducer" class="xdevs.core.examples.efp.Transducer" host="192.168.1.6" mainPort="5003" auxPort="6003"> <constructor-arg value="100.0"/> </atomic> <connection componentFrom="processor" portFrom="oOut" componentTo="transducer" portTo="iSolved"/> <connection componentFrom="generator" portFrom="oOut" componentTo="processor" portTo="iIn"/> <connection componentFrom="generator" portFrom="oOut" componentTo="transducer" portTo="iArrived"/> <connection componentFrom="transducer" portFrom="oOut" componentTo="generator" portTo="iStop"/> </coupled>
-
-
Field Summary
Fields Modifier and Type Field Description protected HashMap<String,Integer>
auxPorts
Auxiliary ports of the components.protected HashMap<String,String>
hosts
Hosts of the components.protected HashMap<String,Integer>
mainPorts
Main ports of the components.protected Element
xmlCoupled
XML element with the model definition.-
Fields inherited from class xdevs.core.modeling.Coupled
components, eic, eoc, ic
-
-
Constructor Summary
Constructors Constructor Description CoupledDistributed(Element xmlCoupled)
Constructor of the class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getAuxPort(String componentName)
Get the auxiliary port of a component.String
getHost(String componentName)
Get the host of a component.Integer
getMainPort(String componentName)
Get the main port of a component.static void
main(String[] args)
-
Methods inherited from class xdevs.core.modeling.Coupled
addComponent, addComponentsAndCouplings, addCoupling, addCoupling, addCoupling, addCoupling, addInPort, addOutPort, countAtomicComponents, exit, flatten, getComponentByName, getComponents, getEIC, getEOC, getIC, getParent, initialize, removeComponent, setParent, structuralTransition, toXml
-
Methods inherited from class xdevs.core.modeling.Component
getInPort, getInPorts, getName, getOutPort, getOutPorts, isInputEmpty, toString
-
-
-
-
Field Detail
-
xmlCoupled
protected Element xmlCoupled
XML element with the model definition.
-
-
Constructor Detail
-
CoupledDistributed
public CoupledDistributed(Element xmlCoupled)
Constructor of the class.- Parameters:
xmlCoupled
- XML element with the model definition.
-
-
Method Detail
-
getHost
public String getHost(String componentName)
Get the host of a component.- Parameters:
componentName
- Name of the component.- Returns:
- Host of the component.
-
getMainPort
public Integer getMainPort(String componentName)
Get the main port of a component.- Parameters:
componentName
- Name of the component.- Returns:
- Main port of the component.
-
getAuxPort
public Integer getAuxPort(String componentName)
Get the auxiliary port of a component.- Parameters:
componentName
- Name of the component.- Returns:
- Auxiliary port of the component.
-
main
public static void main(String[] args)
-
-