public class BitChromosome extends Chromosome
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.Boolean> |
bases
The carrier of genetic information.
|
BIASED, crossoverPoints, crossoverRate, LAPLACE, length, mutationRate, soupType| Constructor and Description |
|---|
BitChromosome()
The standard constructor with default length.
|
BitChromosome(Element c)
Creates a BitChromosome via XML.
|
BitChromosome(int length)
Constructs a chromosome of given length.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
A proper clone.
|
void |
doCrossover(Chromosome father)
k-point Crossover.
|
void |
doMutation()
Bit flip mutation.
|
boolean |
equals(java.lang.Object o)
An efficient check for equality.
|
void |
fromString(java.lang.String b)
Create bases from String.
|
java.lang.Object |
getBases()
Return the genetic information.
|
int |
hashCode()
An efficient hash code.
|
void |
mixSoup()
Initial creation of alleles.
|
java.lang.String |
toString()
Convert chromosome to string.
|
create, getCrossoverPoints, getCrossoverRate, getLength, getMutationRate, getSoupType, setCrossoverPoints, setCrossoverRate, setLength, setMutationRate, setSoupType, toXmlprotected java.util.List<java.lang.Boolean> bases
public BitChromosome()
public BitChromosome(int length)
length - the number of basespublic BitChromosome(Element c)
c - an XML Chromosome elementpublic java.lang.Object clone()
clone in class Chromosomepublic boolean equals(java.lang.Object o)
equals in class Chromosomepublic int hashCode()
hashCode in class Chromosomepublic void doMutation()
doMutation in class Chromosomepublic void doCrossover(Chromosome father)
doCrossover in class Chromosomefather - A parent Chromosome (technically already a child).public void mixSoup()
mixSoup in class Chromosomepublic java.lang.Object getBases()
getBases in class Chromosomepublic java.lang.String toString()
toString in class Chromosomepublic void fromString(java.lang.String b)
fromString in class Chromosomeb - a String describing the bases