Class MultiThreadTCSolver

java.lang.Object
solvers.queueingnet.treeAlgorithms.TreeTraverserMulti
solvers.queueingnet.treeAlgorithms.treeConvolution.MultiThreadTCSolver
All Implemented Interfaces:
IThreadedTCSolver

public class MultiThreadTCSolver extends TreeTraverserMulti implements IThreadedTCSolver
Tree Convolution solver that uses multiple threads.
Author:
Ben Homer, 2014.
  • Constructor Details

    • MultiThreadTCSolver

      public MultiThreadTCSolver(QNModel qnm, ConvolutionLayer cl, TreePlanter tp, int numThreads)
      Constructor.
      Parameters:
      qnm - The queueing network model to solve.
      cl - The convolution layer to delegate to.
      tp - The tree planter.
  • Method Details

    • computeG

      public BigRational computeG(Node node, PopulationVector pv)
      Computes G using postorder tree traversal.
      Specified by:
      computeG in interface IThreadedTCSolver
      Parameters:
      node - The current node to compute the normalisation constant G for.
      pv - The population vector to be used during the computation.
      Returns:
      The normalisation constant G at the given node, calculated using the specified population vector.
    • calculateThroughputs

      public BigRational[] calculateThroughputs(PopulationVector p)
      Calculates per class throughputs using methods outlined in LamLien83 paper.
      Specified by:
      calculateThroughputs in interface IThreadedTCSolver
      Parameters:
      p - The population vector to use during the calculation.
      Returns:
      The per class throughputs as an array of BigRationals.
    • calculateMeanQueueLengths

      public BigRational[][] calculateMeanQueueLengths(PopulationVector p)
      Calculates per class and per station mean queue lengths using methods outlined in LamLien83 paper.
      Specified by:
      calculateMeanQueueLengths in interface IThreadedTCSolver
      Parameters:
      p - The population vector to use during the calculation.
      Returns:
      The per class per station mean queue lengths as a 2D array of BigRationals.
    • getComputeLeafNodeThread

      public Thread getComputeLeafNodeThread(Node node, PopulationVector pv)
      Computes results at leaf node by creating an appropriate thread to run the computation.
      Specified by:
      getComputeLeafNodeThread in class TreeTraverserMulti
      Parameters:
      node - The leaf node.
      pv - The population vector to use for the computation.
      Returns:
      The thread which will run the computation.
    • getSubnetNodeThread

      public Thread getSubnetNodeThread(Node node, PopulationVector pv)
      Computes results at subnetwork node by creating an appropriate thread to run the computation.
      Specified by:
      getSubnetNodeThread in class TreeTraverserMulti
      Parameters:
      node - The subnetwork node.
      pv - The population vector to use for the computation.
      Returns:
      The thread which will run the computation.