jildt
Class TildeNode

java.lang.Object
  extended by jildt.TildeNode

public class TildeNode
extends java.lang.Object

Class that implements a node in a Logical Decision Tree. A node can be either an inner node or a leaf.

Author:
Carlos Alberto González-Alarcón, Alejandro Guerra-Hernández, Francisco Grimaldo-Moreno

Constructor Summary
TildeNode(jason.asSyntax.Term label)
          Initializes an inner node.
TildeNode(jason.asSyntax.Term label, jason.asSyntax.ListTerm examples)
          Initializes an inner node.
 
Method Summary
 jason.asSyntax.ListTerm getExamples()
           
 jason.asSyntax.Term getLabel()
          Returns the label of this node.The label can be either a literal or a conjunction of literals.
 TildeNode getLeftNode()
          Returns the child node located at the left.
 TildeNode getRightNode()
          Returns the child node located at the right.
 int getSizeExamples()
          Return the number of examples used to calculate the label of this node.
 boolean isInner()
          Check if this node is an inner node.
 boolean isLeaf()
          Check if this node is a leaf node.
static TildeNode parseTree(jason.asSyntax.Term tree)
          Parses a Term tree into a Java Oriented-Object tree.
static jason.asSyntax.Term parseTree2List(TildeNode node)
          Parses a Java Oriented-Object tree into a Term tree.
 void setExamples(jason.asSyntax.ListTerm lstExs)
           
 void setLabel(jason.asSyntax.Term label)
          Set the label of this node.The label can be either a literal or a conjunction of literals.
 void setLeftNode(TildeNode leftNode)
          Set the child node that will be located at the left of this node.
 void setRightNode(TildeNode rightNode)
          Set the child node that will be located at the right of this node.
 java.lang.String toString()
          Returns a String summarizing the information of this node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TildeNode

public TildeNode(jason.asSyntax.Term label,
                 jason.asSyntax.ListTerm examples)
Initializes an inner node.

Parameters:
label - The label of the current node. Can be either a literal or a conjunction of literals.
examples - The list of examples belonging to this node.

TildeNode

public TildeNode(jason.asSyntax.Term label)
Initializes an inner node.

Parameters:
label - The label of the current node. Can be either a literal or a conjunction of literals.
Method Detail

isInner

public boolean isInner()
Check if this node is an inner node.

Returns:
true if this node is an inner node, false otherwise.

isLeaf

public boolean isLeaf()
Check if this node is a leaf node.

Returns:
true if this node is a leaf node, false otherwise.

getLabel

public jason.asSyntax.Term getLabel()
Returns the label of this node.The label can be either a literal or a conjunction of literals.

Returns:
The label of this node.

setLabel

public void setLabel(jason.asSyntax.Term label)
Set the label of this node.The label can be either a literal or a conjunction of literals.

Parameters:
label - A String with the label of this node.

getRightNode

public TildeNode getRightNode()
Returns the child node located at the right. This node can be either a sub-tree (internal node) or a leaf node.

Returns:
The child node to its right.

setRightNode

public void setRightNode(TildeNode rightNode)
Set the child node that will be located at the right of this node.

Parameters:
rightNode - A node that can be either an internal node or a leaf.

getLeftNode

public TildeNode getLeftNode()
Returns the child node located at the left. This node can be either a sub-tree (internal node) or a leaf node.

Returns:
The child node to its left.

setLeftNode

public void setLeftNode(TildeNode leftNode)
Set the child node that will be located at the left of this node.

Parameters:
leftNode - A node that can be either an internal node or a leaf.

toString

public java.lang.String toString()
Returns a String summarizing the information of this node.

Overrides:
toString in class java.lang.Object
Returns:
A summary of this node.

getSizeExamples

public int getSizeExamples()
Return the number of examples used to calculate the label of this node.

Returns:
The number of examples used to calculate this node.

parseTree

public static TildeNode parseTree(jason.asSyntax.Term tree)
Parses a Term tree into a Java Oriented-Object tree.

Parameters:
tree - The tree to be parsed.
Returns:
An instance of the class TildeNode.

parseTree2List

public static jason.asSyntax.Term parseTree2List(TildeNode node)
Parses a Java Oriented-Object tree into a Term tree.

Parameters:
node - Instance of TildeNode to be parsed.
Returns:
A Term tree.

getExamples

public jason.asSyntax.ListTerm getExamples()

setExamples

public void setExamples(jason.asSyntax.ListTerm lstExs)