|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgpalta.nodes.Node
public abstract class Node
Generic Node definition. User defined nodes must extend this class
Constructor Summary | |
---|---|
Node()
|
Method Summary | |
---|---|
java.lang.Object |
clone()
|
Node |
deepClone(int currentDepth)
|
abstract double |
eval(ProblemData problemData)
Evaluate the Node for a single sample. |
void |
evalVect(double[] outVect,
TempVectorFactory tempVectorFactory,
ProblemData problemData)
Evaluate a Node for all samples (vectorial evaluation). |
protected abstract void |
evalVectInternal(double[] outVect,
double[][] kidsOutput,
ProblemData problemData)
Internal method that evaluates the Node given its kids' outputs. |
int |
getCurrentDepth()
|
Node |
getKid(int whichKid)
|
int |
getMaxDepthFromHere()
|
int |
getNSubNodes()
|
NodeParent |
getParent()
|
NodeSet |
getType()
|
int |
getWhichKidOfParent()
|
void |
init(Config config,
ProblemData problemData)
Initialize the Node. |
abstract java.lang.String |
name()
Get the Node's short name (such as "plus", "minus", "x1", etc) |
void |
newKids()
|
abstract int |
nKids()
Read the number of kids of the Node |
static java.lang.String |
parse(java.lang.String expression,
NodeParent parent,
int whichKid,
NodeFactory nodeFactory)
|
void |
setCurrentDepth(int currentDepth)
|
void |
setKid(int whichKid,
Node kid)
|
void |
setMaxDepthFromHere(int maxDepthFromHere)
|
void |
setNSubNodes(int nSubNodes)
|
void |
setParent(NodeParent parent)
|
void |
setType(NodeSet type)
|
void |
setTypeOfKids(int whichKid,
NodeSet t)
|
void |
setWhichKidOfParent(int whichKidOfParent)
|
java.lang.String |
toString()
|
NodeSet |
typeOfKids(int whichKid)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Node()
Method Detail |
---|
public NodeSet getType()
public void setType(NodeSet type)
public void init(Config config, ProblemData problemData)
config
- problemData
- public abstract double eval(ProblemData problemData)
problemData
-
public final void evalVect(double[] outVect, TempVectorFactory tempVectorFactory, ProblemData problemData)
outVect
- tempVectorFactory
- problemData
- protected abstract void evalVectInternal(double[] outVect, double[][] kidsOutput, ProblemData problemData)
outVect
- The array where the outout must be storedkidsOutput
- Each array holds all the outputs for a kidproblemData
- The problem's datapublic void setTypeOfKids(int whichKid, NodeSet t)
public NodeSet typeOfKids(int whichKid)
typeOfKids
in interface NodeParent
public abstract int nKids()
nKids
in interface NodeParent
public abstract java.lang.String name()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public Node deepClone(int currentDepth)
public static java.lang.String parse(java.lang.String expression, NodeParent parent, int whichKid, NodeFactory nodeFactory)
public int getWhichKidOfParent()
public void setWhichKidOfParent(int whichKidOfParent)
public NodeParent getParent()
getParent
in interface NodeParent
public void setParent(NodeParent parent)
public int getNSubNodes()
getNSubNodes
in interface NodeParent
public void setNSubNodes(int nSubNodes)
setNSubNodes
in interface NodeParent
public Node getKid(int whichKid)
getKid
in interface NodeParent
public void setKid(int whichKid, Node kid)
setKid
in interface NodeParent
public int getCurrentDepth()
getCurrentDepth
in interface NodeParent
public void setCurrentDepth(int currentDepth)
public void newKids()
newKids
in interface NodeParent
public int getMaxDepthFromHere()
getMaxDepthFromHere
in interface NodeParent
public void setMaxDepthFromHere(int maxDepthFromHere)
setMaxDepthFromHere
in interface NodeParent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |