artoflife pre0.1.0-dev

org.artoflife.gp.genome.numeric
Class UnaryNumericGene

java.lang.Object
  |
  +--org.artoflife.gp.genome.GpTreeNode
        |
        +--org.artoflife.gp.genome.FunctionGene
              |
              +--org.artoflife.gp.genome.numeric.UnaryNumericGene
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
AbsGene, AtanGene, CosGene, LogGene, RoundGene, SinGene

public abstract class UnaryNumericGene
extends FunctionGene

Abstract base class for unary numeric operators like SinGene and others. Assumes parameter genes return Number values that are interpreted here as float values for the subclass to use.

Author:
Steve Meyfroidt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.artoflife.gp.genome.FunctionGene
parameterGenes
 
Constructor Summary
UnaryNumericGene()
           
 
Method Summary
 java.lang.Object evaluate(Phenotype phenotype, java.util.List parameters)
           
protected abstract  float evaluateFor(float parameter)
          Evaluate the function for the passed parameter.
protected  java.util.List getParameterClasses()
           
 java.lang.Class getReturnClass()
           
 
Methods inherited from class org.artoflife.gp.genome.FunctionGene
clone, evaluate, getBooleanParameter, getDoubleParameter, getFloatParameter, getMutators, getParameterGene, initParameterGenes, setParameterGene, toString
 
Methods inherited from class org.artoflife.gp.genome.GpTreeNode
getParameterClass, getParametersLength, getSize, mutate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnaryNumericGene

public UnaryNumericGene()
Method Detail

getParameterClasses

protected java.util.List getParameterClasses()
Specified by:
getParameterClasses in class FunctionGene
Returns:
List of the Classes that this gene expects to evaluate against, never null
See Also:
GpTreeNode.getParameterClasses()

getReturnClass

public java.lang.Class getReturnClass()
Specified by:
getReturnClass in class GpTreeNode
Returns:
the class this gene returns on evaluation
See Also:
GpTreeNode.getReturnClass()

evaluate

public java.lang.Object evaluate(Phenotype phenotype,
                                 java.util.List parameters)
Specified by:
evaluate in class FunctionGene
See Also:
FunctionGene.evaluate(org.artoflife.gp.Phenotype, java.util.List)

evaluateFor

protected abstract float evaluateFor(float parameter)
Evaluate the function for the passed parameter.


artoflife pre0.1.0-dev

Copyright © 2002 the Art Of Life team. All Rights Reserved.