Package jline.lang
Class RoutingMatrix
java.lang.Object
jline.lang.RoutingMatrix
- All Implemented Interfaces:
Serializable
Class representing a probabilistic routing matrix
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classReturn value ofrtnodes2rtorig(NetworkStruct), twin of the MATLAB[rtorigcell, rtorig]pair. -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddConnection(JobClass originClass, JobClass targetClass, Node sourceNode, Node destNode, double probability) voidaddConnection(Node sourceNode, Node destNode) voidaddConnection(Node sourceNode, Node destNode, double probability) voidaddConnection(Node sourceNode, Node destNode, JobClass jobClass) voidaddConnection(Node sourceNode, Node destNode, JobClass jobClass, double probability) voidaddConnection(Node sourceNode, Node destNode, JobClass originClass, JobClass targetClass) voidaddConnection(Node sourceNode, Node destNode, JobClass originClass, JobClass targetClass, double probability) voidget(int jobclass1, int jobclass2) doubleget(int jobclass1, int jobclass2, int node1, int node2) doublegetCell()Returns the routing probabilities as a class-by-class table of node-by-node matrices, twin of MATLABgetCell.getClass(int classIndex) intgetClassIndex(JobClass jobClass) intgetNodeIndex(Node node) voidprint()voidvoidstatic RoutingMatrix.RtOrigResultRecovers the routing matrix as declared by the user, before the class switch nodes were materialised, by stochastic complementation ofsn.rtnodeson the nodes preceding the firstCS_node.voidset(int classIndex1, int classIndex2, int nodeIndex1, int nodeIndex2, double probability) Sets a single routing probability, given class and node indices.voidSets the whole node-by-node routing from one class to another, given the class indices.voidSets the whole node-by-node routing of a class onto itself, given the class index.voidvoidset(JobClass jobclass1, JobClass jobclass2, RoutingMatrix rt) voidvoidvoidset(JobClass jobclass, RoutingMatrix rt) voidvoidvoidvoidsetRouting(Network model)
-
Constructor Details
-
RoutingMatrix
public RoutingMatrix() -
RoutingMatrix
-
-
Method Details
-
addClass
-
addConnection
-
addConnection
-
addConnection
-
addConnection
-
addConnection
-
addConnection
-
addConnection
-
addNode
-
get
-
get
-
get
-
get
public double get(int jobclass1, int jobclass2, int node1, int node2) -
getClass
-
getClassIndex
-
getNodeIndex
-
print
public void print() -
resolveClassSwitches
public void resolveClassSwitches() -
resolveUnappliedConnections
public void resolveUnappliedConnections() -
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
Sets the whole node-by-node routing from one class to another, given the class indices. The int-indexed family is 1-based throughout, as theget(int, int)readers and MATLABrt{r,s}are.- Parameters:
classIndex1- the 1-based index of the departing classclassIndex2- the 1-based index of the arriving classrt- the node-by-node routing probabilities
-
set
-
setRouting
-
set
Sets the whole node-by-node routing of a class onto itself, given the class index. Twin of the two-argument MATLABset(jobclass1, mat), which assignsrt{r,r} = mat.- Parameters:
classIndex- the 1-based job class indexrt- the node-by-node routing probabilities
-
set
public void set(int classIndex1, int classIndex2, int nodeIndex1, int nodeIndex2, double probability) Sets a single routing probability, given class and node indices. Twin of the five-argument MATLABset(jobclass1, jobclass2, node1, node2, val).- Parameters:
classIndex1- the 1-based index of the departing classclassIndex2- the 1-based index of the arriving classnodeIndex1- the 1-based index of the source nodenodeIndex2- the 1-based index of the destination nodeprobability- the routing probability
-
getCell
Returns the routing probabilities as a class-by-class table of node-by-node matrices, twin of MATLABgetCell. The matrices are copies, matching the MATLAB cell array being returned by value: mutating them does not alter this routing matrix.- Returns:
- routing[r][s] holding the node-by-node probabilities from class r to class s
-
rtnodes2rtorig
Recovers the routing matrix as declared by the user, before the class switch nodes were materialised, by stochastic complementation ofsn.rtnodeson the nodes preceding the firstCS_node. Twin of the static MATLABRoutingMatrix.rtnodes2rtorig(sn), which is the same computation assn_rtnodes_to_rtorig: this method is the class-level name for it and delegates rather than duplicating it. Note this is NOTsn.rtorig: the complement also fills the rows of a station a class never visits, which is why MATLABrefreshRoutingMatrix.mdoes not use it to populate that field.- Parameters:
sn- the network structure- Returns:
- the cell form and the flat form of the recovered routing
-