org.artoflife.gp.genome.bool
Class ComparisonGene
java.lang.Object
|
+--org.artoflife.gp.genome.GpTreeNode
|
+--org.artoflife.gp.genome.FunctionGene
|
+--org.artoflife.gp.genome.bool.ComparisonGene
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- EqualsGene, GreaterThanGene, LessThanGene
- public abstract class ComparisonGene
- extends FunctionGene
Abstract base class for boolean operators
like EqualsGene
and GreaterThanGene
that act on two float genes and return a boolean.
- Author:
- Steve Meyfroidt
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
evaluate(Phenotype phenotype,
java.util.List parameters)
|
protected abstract boolean |
evaluateFor(float parameter1,
float parameter2)
Override this to evaluate the function across the parameters
passed in. |
protected java.util.List |
getParameterClasses()
|
java.lang.Class |
getReturnClass()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ComparisonGene
public ComparisonGene()
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 boolean evaluateFor(float parameter1,
float parameter2)
- Override this to evaluate the function across the parameters
passed in.
Copyright © 2002 the Art Of Life team. All Rights Reserved.