jhpro.dtree
Class DecisionTree
- java.lang.Object
-
- jhpro.dtree.DecisionTree
-
- All Implemented Interfaces:
- java.io.Serializable
public class DecisionTree extends java.lang.Object implements java.io.Serializable- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.Stringdescriptionstatic BinTreerootNode
-
Constructor Summary
Constructors Constructor and Description DecisionTree()Default constructor of the tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddNoNode(int existingNodeID, int newNodeID, java.lang.String newQuestAns)Add NO mode to the tree.voidaddYesNode(int existingNodeID, int newNodeID, java.lang.String newQuestAns)Add YES to this node.voidcreateRoot(int newNodeID, java.lang.String newQuestAns)Create ROOT of the tree.java.lang.StringoutputBinTree()Show the tree as a stringBinTreequeryBinTree(BinTree currentNode)Query the tree for a given node
-
-
-
Field Detail
-
rootNode
public static BinTree rootNode
-
description
public java.lang.String description
-
-
Method Detail
-
createRoot
public void createRoot(int newNodeID, java.lang.String newQuestAns)Create ROOT of the tree.
-
addYesNode
public void addYesNode(int existingNodeID, int newNodeID, java.lang.String newQuestAns)Add YES to this node.
-
addNoNode
public void addNoNode(int existingNodeID, int newNodeID, java.lang.String newQuestAns)Add NO mode to the tree.
-
queryBinTree
public BinTree queryBinTree(BinTree currentNode) throws java.io.IOException
Query the tree for a given node- Parameters:
currentNode- current node.- Throws:
java.io.IOException
-
outputBinTree
public java.lang.String outputBinTree()
Show the tree as a string
-
-
DMelt 3.0 © DataMelt by jWork.ORG