artoflife pre0.1.0-dev

org.artoflife.gp.genome
Class VariableGene

java.lang.Object
  |
  +--org.artoflife.gp.genome.GpTreeNode
        |
        +--org.artoflife.gp.genome.VariableGene
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class VariableGene
extends GpTreeNode

Represents the value of a field from the Phenotype, retrieved as a JavaBeans property.

Author:
Steve Meyfroidt
See Also:
Serialized Form

Constructor Summary
VariableGene()
           
VariableGene(java.lang.String fieldName, java.lang.Class fieldClass)
           
 
Method Summary
 java.lang.Object evaluate(Phenotype phenotype)
          Evaluate this expression in the context of the passed Phenotype.
protected  java.util.List getParameterClasses()
           
 GpTreeNode getParameterGene(int index)
           
 java.lang.Class getReturnClass()
           
 void setParameterGene(int index, GpTreeNode gene)
           
 java.lang.String toString()
           
 
Methods inherited from class org.artoflife.gp.genome.GpTreeNode
clone, getMutators, getParameterClass, getParametersLength, getSize, mutate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableGene

public VariableGene()

VariableGene

public VariableGene(java.lang.String fieldName,
                    java.lang.Class fieldClass)
Method Detail

getReturnClass

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

evaluate

public java.lang.Object evaluate(Phenotype phenotype)
Description copied from class: GpTreeNode
Evaluate this expression in the context of the passed Phenotype.

Specified by:
evaluate in class GpTreeNode

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getParameterClasses

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

getParameterGene

public GpTreeNode getParameterGene(int index)
Specified by:
getParameterGene in class GpTreeNode
Returns:
the gene at the passed index, may be null
See Also:
GpTreeNode.getParameterGene(int)

setParameterGene

public void setParameterGene(int index,
                             GpTreeNode gene)
Specified by:
setParameterGene in class GpTreeNode
Parameters:
index - the index of the gene to replace
gene - the gene to replace with
See Also:
GpTreeNode.setParameterGene(int, GpTreeNode)

artoflife pre0.1.0-dev

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