Examples of DepthFirstTraversal


Examples of org.encog.ml.tree.traverse.DepthFirstTraversal

   * @param node The tree node.
   * @return The node count.
   */
  public static int process(TreeNode node) {
    TaskCountNodes task = new TaskCountNodes();
    DepthFirstTraversal trav = new DepthFirstTraversal();
    trav.traverse(node, task);
    return task.getNodeCount();
  }
View Full Code Here

Examples of org.encog.ml.tree.traverse.DepthFirstTraversal

   * @param replaceThisNode The node to replace.
   * @param replaceWith What to replace with.
   */
  public static void process(TreeNode rootNode, TreeNode replaceThisNode, TreeNode replaceWith) {
    TaskReplaceNode task = new TaskReplaceNode(replaceThisNode, replaceWith);
    DepthFirstTraversal trav = new DepthFirstTraversal();
    trav.traverse(rootNode, task);
  }
View Full Code Here

Examples of org.encog.ml.tree.traverse.DepthFirstTraversal

   * @param node The tree node to search from.
   * @return The tree node for the specified index.
   */
  public static TreeNode process(int index, TreeNode node) {
    TaskGetNodeIndex task = new TaskGetNodeIndex(index);
    DepthFirstTraversal trav = new DepthFirstTraversal();
    trav.traverse(node, task);
    return task.getResult();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.