Class TreePlanter

java.lang.Object
solvers.queueingnet.treeAlgorithms.TreePlanter

public class TreePlanter extends Object
Class responsible for the tree planting phase of the Tree Convolution algorithm.
Author:
Ben Homer, 2014.
  • Field Details

    • treePlantTimer

      public Timer treePlantTimer
      The timer for the tree planting phase.
  • Constructor Details

    • TreePlanter

      public TreePlanter(QNModel qnm, ClassCoverageUtils ccu, ComplexityEvaluator ce, TreePrinter treePrinter)
      Constructor.
      Parameters:
      qnm - The queueing network model to solve.
      ccu - The class coverage utilities helper.
      ce - The complexity evaluator.
      treePrinter - The tree printer.
  • Method Details

    • treeRoot

      public Node treeRoot()
      Gets the planted tree's root node.
      Returns:
      The root node.
    • getPlantModeUsed

      public String getPlantModeUsed()
      Gets the plant mode used to plant the current tree.
      Returns:
      The plant mode as a string.
    • rootClone

      public Node rootClone()
      Creates and returns a clone of the planted tree's root node.
      Returns:
      The cloned root node.
    • printCurrentTree

      public void printCurrentTree()
      Prints the current tree.
    • printTree

      public void printTree(Node root)
      Prints a tree from specific root node.
      Parameters:
      root - The tree root to print from.
    • runTreePlantingPhase

      public boolean runTreePlantingPhase()
      Runs the main tree planting phase. Consists of two steps: 1. Plant the tree. 2. Check this tree has acceptable complexity characteristics, if not go back to step 1.
      Returns:
      A boolean indicating whether an adequate tree was found.
    • createTreeWithClonedStation

      public Node createTreeWithClonedStation(int m)
      Creates a copy of the current tree with station m cloned as an additional leaf node. In the Lam/Lien paper this is referred to as the Gm+ tree.
      Parameters:
      m - The station/queue to clone in the tree.
      Returns:
      The parent node of the two cloned nodes.
    • createTreeWithRemovedStation

      public Node createTreeWithRemovedStation(int m)
      Creates a copy of the current tree with the node for station m removed. In the Lam/Lien paper this is referred to as the Gm- tree.
      Parameters:
      m - The station/queue to remove from the tree.
      Returns:
      The parent node of the removed node.