gpalta.nodes
Class LogicConstant

java.lang.Object
  extended by gpalta.nodes.Node
      extended by gpalta.nodes.LogicConstant
All Implemented Interfaces:
NodeParent, java.io.Serializable, java.lang.Cloneable

public class LogicConstant
extends Node

See Also:
Serialized Form

Constructor Summary
LogicConstant()
           
LogicConstant(double constant)
           
 
Method Summary
 double eval(ProblemData problemData)
          Evaluate the Node for a single sample.
 void evalVectInternal(double[] outVect, double[][] kidsOutput, ProblemData problemData)
          Internal method that evaluates the Node given its kids' outputs.
 void init(Config config, ProblemData problemData)
          Initialize the Node.
 java.lang.String name()
          Get the Node's short name (such as "plus", "minus", "x1", etc)
 int nKids()
          Read the number of kids of the Node
 
Methods inherited from class gpalta.nodes.Node
clone, deepClone, evalVect, getCurrentDepth, getKid, getMaxDepthFromHere, getNSubNodes, getParent, getType, getWhichKidOfParent, newKids, parse, setCurrentDepth, setKid, setMaxDepthFromHere, setNSubNodes, setParent, setType, setTypeOfKids, setWhichKidOfParent, toString, typeOfKids
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogicConstant

public LogicConstant()

LogicConstant

public LogicConstant(double constant)
Method Detail

eval

public double eval(ProblemData problemData)
Description copied from class: Node
Evaluate the Node for a single sample. All Nodes must override this method. The Node is responsible for evaluating its children, if any.

Specified by:
eval in class Node
Returns:
The output of the Node

evalVectInternal

public void evalVectInternal(double[] outVect,
                             double[][] kidsOutput,
                             ProblemData problemData)
Description copied from class: Node
Internal method that evaluates the Node given its kids' outputs. All Nodes must override this method. Different to eval(), in this case, kids are already evaluated

Specified by:
evalVectInternal in class Node
Parameters:
outVect - The array where the outout must be stored
kidsOutput - Each array holds all the outputs for a kid
problemData - The problem's data

nKids

public int nKids()
Description copied from class: Node
Read the number of kids of the Node

Specified by:
nKids in interface NodeParent
Specified by:
nKids in class Node
Returns:
The number of kids this Node has

name

public java.lang.String name()
Description copied from class: Node
Get the Node's short name (such as "plus", "minus", "x1", etc)

Specified by:
name in class Node
Returns:
The Node's name

init

public void init(Config config,
                 ProblemData problemData)
Description copied from class: Node
Initialize the Node. Override this if the node has a state that needs to be specified when created

Overrides:
init in class Node