geneticWedge.gp.function
Class PowerFunction

java.lang.Object
  extended by geneticWedge.gp.Component
      extended by geneticWedge.gp.function.Function
          extended by geneticWedge.gp.function.TwoInputFunction
              extended by geneticWedge.gp.function.PowerFunction

public class PowerFunction
extends TwoInputFunction

PowerFunction is a Function that takes 2 inputs and outputs the first raised to the power of the second.


Constructor Summary
PowerFunction()
          constructor
 
Method Summary
 double getOutput(double[] input)
          getOutput() throws InvalidInputSizeException if the length of the input array is not 2.
 boolean isCommutative()
          Returns false
 java.lang.String toString()
          Returns a String representation of a PowerFunction object ('^').
 
Methods inherited from class geneticWedge.gp.function.Function
getComplexity, getNoOfInputs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PowerFunction

public PowerFunction()
constructor

Method Detail

getOutput

public double getOutput(double[] input)
                 throws InvalidInputSizeException
getOutput() throws InvalidInputSizeException if the length of the input array is not 2. Note: if the output is too large to be represented as a double, 0.0 will be returned.

Specified by:
getOutput in class Function
Throws:
InvalidInputSizeException

toString

public java.lang.String toString()
Returns a String representation of a PowerFunction object ('^').

Specified by:
toString in class Function

isCommutative

public boolean isCommutative()
Returns false

Specified by:
isCommutative in class TwoInputFunction