Class TreeTraverserMulti

java.lang.Object
solvers.queueingnet.treeAlgorithms.TreeTraverserMulti
Direct Known Subclasses:
MultiThreadTCSolver, MultiThreadTMVASolver

public abstract class TreeTraverserMulti extends Object
Tree traverser abstract class which implements generic multi-threaded tree traversal, leaving the actual node computations to the extending class.
Author:
Ben Homer, 2014.
  • Field Details

    • taskExecutor

      protected ExecutorService taskExecutor
      The task executor which holds the thread pool.
  • Constructor Details

    • TreeTraverserMulti

      public TreeTraverserMulti(int numThreads)
      Constructor.
      Parameters:
      numThreads - The number of threads to use for computation.
  • Method Details

    • traverse

      public void traverse(Node node, PopulationVector pv)
      Runs a recursive multi-threaded traversal and waits for the result.
      Parameters:
      node - The node from which to start the traversal.
      pv - The population vector to use for node computations.
    • getComputeLeafNodeThread

      public abstract Thread getComputeLeafNodeThread(Node node, PopulationVector pv)
      Abstract method which an extending class will override to define leaf node computations.
      Parameters:
      node - The leaf node.
      pv - The population vector to use for the computation.
      Returns:
      A Thread which will run the leaf node computation.
    • getSubnetNodeThread

      public abstract Thread getSubnetNodeThread(Node node, PopulationVector pv)
      Abstract method which an extending class will override to define subnetwork node computations.
      Parameters:
      node - The subnetwork node.
      pv - The population vector to use for the computation.
      Returns:
      A Thread which will run the subnetwork node computation.