Class TreeTraverserMulti
java.lang.Object
solvers.queueingnet.treeAlgorithms.TreeTraverserMulti
- Direct Known Subclasses:
MultiThreadTCSolver, MultiThreadTMVASolver
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 Summary
FieldsModifier and TypeFieldDescriptionprotected ExecutorServiceThe task executor which holds the thread pool. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ThreadgetComputeLeafNodeThread(Node node, PopulationVector pv) Abstract method which an extending class will override to define leaf node computations.abstract ThreadgetSubnetNodeThread(Node node, PopulationVector pv) Abstract method which an extending class will override to define subnetwork node computations.voidtraverse(Node node, PopulationVector pv) Runs a recursive multi-threaded traversal and waits for the result.
-
Field Details
-
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
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
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
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.
-