|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--evSOLve.JEvolution.Chromosome | +--evSOLve.JEvolution.IntChromosome
Integer encoding. The bases are implemented as a Vector of Integers with values ranging from 'lowInt' to 'highInt'. Mutation is implemented as randomly selecting a new integer, crossover is standard 1-, or 2-point.
Field Summary | |
protected java.util.Vector |
bases
The genetic information carrier. |
protected int |
highInt
The largest integer encoded. |
protected int |
lowInt
The lowest integer encoded. |
Fields inherited from class evSOLve.JEvolution.Chromosome |
BIASED, crossoverPoints, crossoverRate, JA, LAPLACE, length, mutationRate, soupType, utils |
Constructor Summary | |
IntChromosome()
Creates a chromosome with 'lenght' bases, and default values for 'lowInt' (0) and 'highInt' ('length' - 1). |
Method Summary | |
java.lang.Object |
clone()
A proper clone, cloning the bases deeply by creating new objects. |
protected void |
doCrossover(Chromosome father)
Standard 1-, or 2-Point Crossover. |
protected void |
doMutation()
Mutate by randomly setting a base to a new integer value within 'lowIndex' and 'highIndex' (both included). |
boolean |
equals(java.lang.Object o)
An efficient check for equality. |
java.lang.Object |
getBases()
Return the genetic information. |
int |
getHighInt()
Gives high index of integer encoding. |
int |
getLowInt()
Gives low index of integer encoding. |
int |
hashCode()
An efficient hash code. |
void |
setBases(java.lang.Object bases)
Set bases to a known solution. |
void |
setHighInt(int highInt)
Change low index of integer encoding. |
void |
setLowInt(int lowIndex)
Changes low index of integer encoding. |
java.lang.String |
toString()
Convert chromosome to string. |
Methods inherited from class evSOLve.JEvolution.Chromosome |
getCrossoverPoints, getCrossoverRate, getLength, getMutationRate, getSoupType, setCrossoverPoints, setCrossoverRate, setLength, setMutationRate, setSoupType |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector bases
protected int lowInt
protected int highInt
Constructor Detail |
public IntChromosome()
Method Detail |
public java.lang.Object clone()
clone
in class Chromosome
public boolean equals(java.lang.Object o)
equals
in class Chromosome
public int hashCode()
hashCode
in class Chromosome
protected void doMutation()
doMutation
in class Chromosome
protected void doCrossover(Chromosome father)
doCrossover
in class Chromosome
father
- A parent Chromosome.public int getLowInt()
public void setLowInt(int lowIndex)
lowInt
- the smallest integer encodedpublic int getHighInt()
public void setHighInt(int highInt)
highInt
- the largest integer encodedpublic java.lang.Object getBases()
public void setBases(java.lang.Object bases)
bases
- The encoded solution.public java.lang.String toString()
toString
in class Chromosome
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |