com.epochx.representation.dbl
Class CubeRootFunction

java.lang.Object
  extended by com.epochx.representation.Node<TYPE>
      extended by com.epochx.representation.FunctionNode<java.lang.Double>
          extended by com.epochx.representation.dbl.CubeRootFunction
All Implemented Interfaces:
java.lang.Cloneable

public class CubeRootFunction
extends FunctionNode<java.lang.Double>

A FunctionNode which performs the mathematical function of cube root.


Constructor Summary
CubeRootFunction()
          Construct a CubeRootFunction with no children.
CubeRootFunction(Node<java.lang.Double> child)
          Construct a CubeRootFunction with one child.
 
Method Summary
 java.lang.Double evaluate()
          Evaluating a CubeRootFunction involves evaluating the child first then performing cube root on the result.
 java.lang.String getFunctionName()
          Get the unique name that identifies this function.
 
Methods inherited from class com.epochx.representation.FunctionNode
equals, toString
 
Methods inherited from class com.epochx.representation.Node
clone, getArity, getChild, getChildren, getDepth, getFunctionNodes, getLength, getNodesAtDepth, getNoDistinctFunctions, getNoDistinctTerminals, getNoFunctions, getNoTerminals, getNthNode, getTerminalNodes, hashCode, setChild, setChildren, setNthNode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CubeRootFunction

public CubeRootFunction()
Construct a CubeRootFunction with no children.


CubeRootFunction

public CubeRootFunction(Node<java.lang.Double> child)
Construct a CubeRootFunction with one child. When evaluated, the child will be first evaluated, with the result cube-rooted.

Parameters:
child - The child which cube root will be performed on.
Method Detail

evaluate

public java.lang.Double evaluate()
Evaluating a CubeRootFunction involves evaluating the child first then performing cube root on the result.

Specified by:
evaluate in class Node<java.lang.Double>
Returns:
The result of evaluating the candidate program.

getFunctionName

public java.lang.String getFunctionName()
Get the unique name that identifies this function.

Specified by:
getFunctionName in class FunctionNode<java.lang.Double>
Returns:
the unique name for the CubeRootFunction which is CBRT.