com.epochx.representation.dbl
Class MultiplyFunction

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.MultiplyFunction
All Implemented Interfaces:
java.lang.Cloneable

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

A FunctionNode which performs the mathematical function of multiplication.


Constructor Summary
MultiplyFunction()
          Construct a MultiplyFunction with no children.
MultiplyFunction(Node<java.lang.Double> child1, Node<java.lang.Double> child2)
          Construct a MultiplyFunction with 2 children.
 
Method Summary
 java.lang.Double evaluate()
          Evaluating a MultiplyFunction involves multiplying the result of evaluating both children.
 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

MultiplyFunction

public MultiplyFunction()
Construct a MultiplyFunction with no children.


MultiplyFunction

public MultiplyFunction(Node<java.lang.Double> child1,
                        Node<java.lang.Double> child2)
Construct a MultiplyFunction with 2 children. When evaluated, both children will be evaluated and then multiplied together.

Parameters:
child1 - The first child node.
child2 - The second child node.
Method Detail

evaluate

public java.lang.Double evaluate()
Evaluating a MultiplyFunction involves multiplying the result of evaluating both children.

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 MultiplyFunction which is MUL.