evSOLve.JEvolution
Class BitChromosome
java.lang.Object
|
+--evSOLve.JEvolution.Chromosome
|
+--evSOLve.JEvolution.BitChromosome
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class BitChromosome
- extends Chromosome
The good old bit string representation. The bases are implemented as BitSet,
mutation is standard bit-flip, and crossover may be 1-, or 2-point.
- Version:
- 0.4
- Author:
- Helmut A. Mayer
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
clone()
A proper clone. |
protected void |
doCrossover(Chromosome father)
k-point Crossover. |
protected void |
doMutation()
Bit flip mutation. |
boolean |
equals(java.lang.Object o)
An efficient check for equality. |
java.lang.Object |
getBases()
Return the genetic information. |
int |
hashCode()
An efficient hash code. |
java.lang.String |
toString()
Convert chromosome to string. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
BitChromosome
public BitChromosome()
- The standard constructor.
- Parameters:
GA
- With all parameters.
clone
public java.lang.Object clone()
- A proper clone.
- Overrides:
clone
in class Chromosome
equals
public boolean equals(java.lang.Object o)
- An efficient check for equality. Uses BitSet.equals().
- Overrides:
equals
in class Chromosome
hashCode
public int hashCode()
- An efficient hash code. Uses BitSet.hashCode().
- Overrides:
hashCode
in class Chromosome
doMutation
protected void doMutation()
- Bit flip mutation.
- Overrides:
doMutation
in class Chromosome
doCrossover
protected void doCrossover(Chromosome father)
- k-point Crossover. By now k may be only 1 or 2!!
- Overrides:
doCrossover
in class Chromosome
- Parameters:
father
- A parent Chromosome (technically already a child).
getBases
public java.lang.Object getBases()
- Return the genetic information.
toString
public java.lang.String toString()
- Convert chromosome to string. The MSB has index 0.
- Overrides:
toString
in class Chromosome