|
artoflife pre0.1.0-dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.artoflife.gp.genome.GpTreeNode
A gene in a GpTreeChromosome
that returns a certain type. Has an
ordered list of parameter genes which are themselves GpTreeNodes that return
a certain type. Any parameter may be null.
Constructor Summary | |
GpTreeNode()
|
Method Summary | |
java.lang.Object |
clone()
Return a clone of this . |
abstract java.lang.Object |
evaluate(Phenotype phenotype)
Evaluate this expression in the context of the passed Phenotype . |
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. |
java.lang.Class |
getParameterClass(int index)
Note this implementation calls getParameterClasses, so make that method efficient. |
protected abstract java.util.List |
getParameterClasses()
|
abstract GpTreeNode |
getParameterGene(int index)
|
int |
getParametersLength()
Note this implementation calls getParameterClasses, so make that method efficient. |
abstract java.lang.Class |
getReturnClass()
|
int |
getSize()
Note: this is expensive to call. |
void |
mutate(java.lang.String geneSelectionId,
float probability)
Mutate this gene in some way with the passed probability. |
abstract void |
setParameterGene(int index,
GpTreeNode gene)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GpTreeNode()
Method Detail |
public abstract java.lang.Object evaluate(Phenotype phenotype)
Phenotype
.
public void mutate(java.lang.String geneSelectionId, float probability)
probability
- of mutation happening.FunctionGene#mutate(float)
public int getSize()
public java.lang.Object clone()
this
. Override to
deep clone any non-primitive fields in subclasses.
clone
in class java.lang.Object
protected java.util.SortedMap getMutators()
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");
public abstract java.lang.Class getReturnClass()
protected abstract java.util.List getParameterClasses()
public java.lang.Class getParameterClass(int index)
index
-
java.lang.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= size()).public int getParametersLength()
public abstract GpTreeNode getParameterGene(int index)
java.lang.IndexOutOfBoundsException
- for index out of rangepublic abstract void setParameterGene(int index, GpTreeNode gene)
index
- the index of the gene to replacegene
- the gene to replace with
java.lang.IndexOutOfBoundsException
- for index out of range
|
artoflife pre0.1.0-dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |