public class Branch extends Expander<java.lang.Double>
Branch has a fixed initial number of ports that can be defined
on construction. The port probability can be defined by
SetProbability. The ports are called "output 1", "output 2", ...
. Moreover, it is possible to add and remove ports dynamically.
Expander,
BinaryBranchEntity.PortAlias| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isNormalized |
protected RandomNumberGenerator |
rng |
inputPort, outputPorts, portParametersportAliases, ports, simNode| Constructor and Description |
|---|
Branch(int nrOfPorts,
SimNode ownNode) |
Branch(SimNode ownNode) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPort(java.lang.Double prob) |
void |
addPort(java.lang.String portName,
java.lang.Double prob) |
void |
equalize() |
double |
getProbabilitySum() |
protected SynchronousOutputPort |
getRandomPort() |
void |
handleMessageIndication(Message msg) |
void |
normalize() |
void |
removePort(java.lang.String portName) |
void |
setProbability(int portNr,
double prob) |
portName2Index, setPortParameteraddPort, aliasPort, aliasPort, connect, disconnect, getName, getNode, getPortByName, getPorts, isPortKnown, unaliasPortprotected boolean isNormalized
protected RandomNumberGenerator rng
public Branch(int nrOfPorts,
SimNode ownNode)
public Branch(SimNode ownNode)
protected SynchronousOutputPort getRandomPort()
public void handleMessageIndication(Message msg)
handleMessageIndication in class Expander<java.lang.Double>public void addPort(java.lang.Double prob)
public void addPort(java.lang.String portName,
java.lang.Double prob)
public void removePort(java.lang.String portName)
removePort in class Expander<java.lang.Double>public void setProbability(int portNr,
double prob)
public double getProbabilitySum()
public void normalize()
public void equalize()