public abstract class Node
extends java.lang.Object
The class defines the characteristics of a node. Every variable has the same linguistic labels and does not use weights. Terminal nodes have the same own attributes and haven't got pointer to children. Internal nodes only have got pointer to children.
Modifier and Type | Field and Description |
---|---|
protected Node[] |
children |
protected int |
mytypeid |
static int |
NAnd |
static int |
NConsequent |
static int |
NEs |
static int |
NExp |
static int |
NExprArit |
static int |
NExprHold |
static int |
NLabel |
static int |
NLog |
static int |
NMinus |
static int |
NOr |
static int |
NProduct |
static int |
NRule |
static int |
NRuleBase |
static int |
NSquareRoot |
static int |
NSum |
static int |
NValue |
static int |
NVariable
The class defines the characteristics of a node
|
Constructor and Description |
---|
Node(int t)
Constructor.
|
Node(int n,
int t)
Constructor.
|
Node(Node n)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
changeChild(Node n,
int i)
This method modify the children node in the i position, assigning the node that is
passed as parameter
|
Node |
child(int i)
This method return the children of the i position
|
Node[] |
children()
The public method return the list of children of the node
|
abstract Node |
clone()
This abstract method clone a Node
|
boolean |
compatible(Node n)
This method find out if two nodes are the same type, the same number of children
or the children are compatible.
|
protected boolean |
compatibleData(Node n)
This method find out if two nodes are the same type
|
abstract void |
debug()
This abstrac method is for debug
|
int |
nChildren()
This method return the number of children of the node
|
abstract java.lang.String |
output()
This abstrac method returns the output of the node.
|
void |
replaceTerminals(FuzzyAlphaCut[] x)
This method replace the terminal from fuzzy alpha cuts
|
void |
set(Node n)
This method asign a node the porperties from another
|
int |
type()
This method return the type of node
|
public static final int NVariable
The class defines the characteristics of a node
public static final int NLabel
public static final int NConsequent
public static final int NAnd
public static final int NOr
public static final int NEs
public static final int NRule
public static final int NRuleBase
public static final int NExprHold
public static final int NExprArit
public static final int NValue
public static final int NSum
public static final int NMinus
public static final int NProduct
public static final int NSquareRoot
public static final int NExp
public static final int NLog
protected int mytypeid
protected Node[] children
public Node(int t)
Constructor. Generate a new void node with cero chindren
t
- The type of the node (int)public Node(int n, int t)
Constructor. Generate a new void node with n chindren
n
- The number of chindren of the node (int)t
- The type of the node (int)public Node(Node n)
Constructor. Generate a new node from another
n
- The node to be copied (Node)public Node[] children()
The public method return the list of children of the node
public abstract Node clone()
This abstract method clone a Node
clone
in class java.lang.Object
public void set(Node n)
This method asign a node the porperties from another
n
- The node to be asigned (Node)public void replaceTerminals(FuzzyAlphaCut[] x)
This method replace the terminal from fuzzy alpha cuts
x
- List of fuzzy alpha cuts (FuzzylphaCut[])public abstract void debug()
This abstrac method is for debug
public abstract java.lang.String output()
This abstrac method returns the output of the node.
public int type()
This method return the type of node
public int nChildren()
This method return the number of children of the node
public Node child(int i)
This method return the children of the i position
i
- Position of the children (int)public void changeChild(Node n, int i)
This method modify the children node in the i position, assigning the node that is passed as parameter
n
- The node (Node)i
- The node position to be changed (int)protected boolean compatibleData(Node n)
This method find out if two nodes are the same type
n
- The node to be compared (Node)public boolean compatible(Node n)
This method find out if two nodes are the same type, the same number of children or the children are compatible.
n
- The node to be compared (Node)