Package jline.lang

Class RoutingMatrix

java.lang.Object
jline.lang.RoutingMatrix
All Implemented Interfaces:
Serializable

public class RoutingMatrix extends Object implements Serializable
Class representing a probabilistic routing matrix
See Also:
  • Constructor Details

    • RoutingMatrix

      public RoutingMatrix()
    • RoutingMatrix

      public RoutingMatrix(Network model, List<JobClass> jobClasses, List<Node> nodes)
  • Method Details

    • addClass

      public void addClass(JobClass jobClass)
    • addConnection

      public void addConnection(Node sourceNode, Node destNode)
    • addConnection

      public void addConnection(Node sourceNode, Node destNode, JobClass jobClass)
    • addConnection

      public void addConnection(Node sourceNode, Node destNode, double probability)
    • addConnection

      public void addConnection(Node sourceNode, Node destNode, JobClass originClass, JobClass targetClass)
    • addConnection

      public void addConnection(Node sourceNode, Node destNode, JobClass jobClass, double probability)
    • addConnection

      public void addConnection(Node sourceNode, Node destNode, JobClass originClass, JobClass targetClass, double probability)
    • addConnection

      public void addConnection(JobClass originClass, JobClass targetClass, Node sourceNode, Node destNode, double probability)
    • addNode

      public void addNode(Node node)
    • get

      public Matrix get(JobClass jobclass1, JobClass jobclass2)
    • get

      public double get(JobClass jobclass1, JobClass jobclass2, Node node1, Node node2)
    • get

      public Matrix get(int jobclass1, int jobclass2)
    • get

      public double get(int jobclass1, int jobclass2, int node1, int node2)
    • getClass

      public JobClass getClass(int classIndex)
    • getClassIndex

      public int getClassIndex(JobClass jobClass)
    • getNodeIndex

      public int getNodeIndex(Node node)
    • print

      public void print()
    • resolveClassSwitches

      public void resolveClassSwitches()
    • resolveUnappliedConnections

      public void resolveUnappliedConnections()
    • set

      public void set(JobClass jobclass1, JobClass jobclass2, Node srcNode, Node destNode, double probability)
    • set

      public void set(JobClass jobclass1, Node srcNode, Node destNode, double probability)
    • set

      public void set(Node srcNode, Node destNode, double probability)
    • set

      public void set(JobClass jobclass, Matrix rt)
    • set

      public void set(JobClass jobclass1, JobClass jobclass2, Matrix rt)
    • set

      public void set(JobClass jobclass, RoutingMatrix rt)
    • set

      public void set(JobClass jobclass1, JobClass jobclass2, RoutingMatrix rt)
    • set

      public void set(int classIndex1, int classIndex2, Matrix rt)
      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 the get(int, int) readers and MATLAB rt{r,s} are.
      Parameters:
      classIndex1 - the 1-based index of the departing class
      classIndex2 - the 1-based index of the arriving class
      rt - the node-by-node routing probabilities
    • set

      public void set(Node srcNode, Node destNode)
    • setRouting

      public void setRouting(Network model)
    • set

      public void set(int classIndex, Matrix rt)
      Sets the whole node-by-node routing of a class onto itself, given the class index. Twin of the two-argument MATLAB set(jobclass1, mat), which assigns rt{r,r} = mat.
      Parameters:
      classIndex - the 1-based job class index
      rt - 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 MATLAB set(jobclass1, jobclass2, node1, node2, val).
      Parameters:
      classIndex1 - the 1-based index of the departing class
      classIndex2 - the 1-based index of the arriving class
      nodeIndex1 - the 1-based index of the source node
      nodeIndex2 - the 1-based index of the destination node
      probability - the routing probability
    • getCell

      public List<List<Matrix>> getCell()
      Returns the routing probabilities as a class-by-class table of node-by-node matrices, twin of MATLAB getCell. 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

      public static RoutingMatrix.RtOrigResult rtnodes2rtorig(NetworkStruct sn)
      Recovers the routing matrix as declared by the user, before the class switch nodes were materialised, by stochastic complementation of sn.rtnodes on the nodes preceding the first CS_ node. Twin of the static MATLAB RoutingMatrix.rtnodes2rtorig(sn), which is the same computation as sn_rtnodes_to_rtorig: this method is the class-level name for it and delegates rather than duplicating it. Note this is NOT sn.rtorig: the complement also fills the rows of a station a class never visits, which is why MATLAB refreshRoutingMatrix.m does not use it to populate that field.
      Parameters:
      sn - the network structure
      Returns:
      the cell form and the flat form of the recovered routing