|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgap.impl.NumberGene
Base class for all Genes based on numbers. Known implementations: IntegerGene, DoubleGene
| Field Summary |
| Fields inherited from interface org.jgap.Gene |
PERSISTENT_FIELD_DELIMITER |
| Constructor Summary | |
NumberGene()
|
|
| Method Summary | |
abstract void |
applyMutation(int index,
double a_percentage)
Applies a mutation of a given intensity (percentage) onto the atomic element at given index (NumberGenes only have one atomic element) |
void |
cleanup()
Executed by the genetic engine when this Gene instance is no longer needed and should perform any necessary resource cleanup. |
int |
compareTo(java.lang.Object other)
Compares this IntegerGene with the specified object (which must also be an IntegerGene) for order, which is determined by the integer value of this Gene compared to the one provided for comparison. |
boolean |
equals(java.lang.Object other)
Compares this IntegerGene with the given object and returns true if the other object is a IntegerGene and has the same value (allele) as this IntegerGene. |
java.lang.Object |
getAllele()
Retrieves the value (allele) represented by this Gene. |
IGeneConstraintChecker |
getConstraintChecker()
|
int |
hashCode()
Retrieves the hash code value for this IntegerGene. |
void |
setAllele(java.lang.Object a_newValue)
Sets the value (allele) of this Gene to the new given value. |
void |
setConstraintChecker(IGeneConstraintChecker a_constraintChecker)
Sets the constraint checker to be used for this gene whenever method setAllele(Object a_newValue) is called |
int |
size()
|
java.lang.String |
toString()
Retrieves a string representation of this IntegerGene's value that may be useful for display purposes. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jgap.Gene |
getPersistentRepresentation, newGene, setToRandomValue, setValueFromPersistentRepresentation |
| Constructor Detail |
public NumberGene()
| Method Detail |
public void cleanup()
cleanup in interface Genepublic boolean equals(java.lang.Object other)
other - the object to compare to this IntegerGene for equality.
public int hashCode()
public int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparableother - the IntegerGene to be compared to this IntegerGene.
java.lang.ClassCastException - if the specified object's type prevents it
from being compared to this IntegerGene.public java.lang.String toString()
toString in interface Genepublic void setAllele(java.lang.Object a_newValue)
setAllele in interface Genea_newValue - the new value of this Gene instance.public void setConstraintChecker(IGeneConstraintChecker a_constraintChecker)
a_constraintChecker - the constraint checker to be setpublic IGeneConstraintChecker getConstraintChecker()
public java.lang.Object getAllele()
getAllele in interface Genepublic int size()
size in interface Gene
public abstract void applyMutation(int index,
double a_percentage)
applyMutation in interface Geneindex - index of atomic element, between 0 and size()-1a_percentage - percentage of mutation (greater than -1 and smaller
than 1).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||