|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.artoflife.gp.genome.GpTreeNode | +--org.artoflife.gp.genome.numeric.FloatGene
Represents a float value with some min and max value.
Evaluates between -1
and 1 in this base class, but override getMin and getMax
to change the type of Number this represents (may also need
to configure FloatGaussianRangeMutator
).
Field Summary | |
protected java.lang.Number |
value
|
Constructor Summary | |
FloatGene()
|
Method Summary | |
java.lang.Object |
clone()
Override to clone the Number value field. |
java.lang.Object |
evaluate(Phenotype phenotype)
Evaluate this expression in the context of the passed Phenotype . |
java.lang.Number |
getMax()
Note this is called from the constructor to initialise the value. |
java.lang.Number |
getMin()
Note this is called from the constructor to initialise the value. |
protected java.util.SortedMap |
getMutators()
Provides a SortedMap of GpMutator s with their
probabilities (Doubles between 0.0 and 1.0)
so that #mutate(float)
can choose one to do a mutation. |
protected java.util.List |
getParameterClasses()
|
GpTreeNode |
getParameterGene(int index)
|
java.lang.Class |
getReturnClass()
|
java.lang.Number |
getValue()
|
void |
setParameterGene(int index,
GpTreeNode gene)
|
void |
setValue(java.lang.Number value)
|
java.lang.String |
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 |
Field Detail |
protected java.lang.Number value
Constructor Detail |
public FloatGene()
Method Detail |
public java.lang.Class getReturnClass()
getReturnClass
in class GpTreeNode
public java.lang.Number getMin()
public java.lang.Number getMax()
public final void setValue(java.lang.Number value)
public java.lang.Number getValue()
public java.lang.Object evaluate(Phenotype phenotype)
GpTreeNode
Phenotype
.
evaluate
in class GpTreeNode
public java.lang.String toString()
toString
in class java.lang.Object
protected java.util.SortedMap getMutators()
GpTreeNode
GpMutator
s with their
probabilities (Doubles between 0.0 and 1.0)
so that #mutate(float)
can choose one to do a mutation. The map
needs to look like:
Load from configuration properties.
[getClass().getName()].mutator.class.0
and optionally
[getClass().getName()].mutator.probability.0
using:
Configuration.getInstance().getInstancesProbabilities(getClass().getName() + ".mutator");
getMutators
in class GpTreeNode
GpTreeNode.getMutators()
protected java.util.List getParameterClasses()
getParameterClasses
in class GpTreeNode
GpTreeNode.getParameterClasses()
public GpTreeNode getParameterGene(int index)
getParameterGene
in class GpTreeNode
GpTreeNode.getParameterGene(int)
public void setParameterGene(int index, GpTreeNode gene)
setParameterGene
in class GpTreeNode
index
- the index of the gene to replacegene
- the gene to replace withGpTreeNode.setParameterGene(int, GpTreeNode)
public java.lang.Object clone()
clone
in class GpTreeNode
|
artoflife pre0.1.0-dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |