|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.ai.geneticalgorithm.AbstractChromosome
org.vizzini.ai.geneticalgorithm.ChromosomeBoolean
public class ChromosomeBoolean
Provides a chromosome which contains boolean
s.
Field Summary |
---|
Fields inherited from interface org.vizzini.ai.geneticalgorithm.IChromosome |
---|
UNKNOWN_FITNESS |
Constructor Summary | |
---|---|
ChromosomeBoolean(int size)
Construct this object using the given parameter. |
Method Summary | |
---|---|
Object |
clone()
Return a clone of this instance. |
void |
copy(IChromosome another)
Copy the given chromosome into this. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
boolean |
get(int index)
Return the gene at the given index. |
int |
hashCode()
Returns a hash code value for the object. |
void |
mix(IChromosome c1,
IChromosome c2,
boolean[] mask)
Mix the genes of the given chromosomes into this using the given mask. |
void |
mutate(double mutationRate,
double mutationMagnitude)
Mutate this chromosome's genes using the given parameters. |
void |
randomlyInitialize()
Initialize the genes with random values. |
void |
set(int index,
boolean value)
Set the gene at index to the given value. |
int |
size()
Return the number of genes. |
void |
splice(IChromosome c1,
IChromosome c2,
int cut)
Splice the given chromosomes into this using the given cut index. |
String |
toString()
Return a string representation of this object. |
Methods inherited from class org.vizzini.ai.geneticalgorithm.AbstractChromosome |
---|
addFitness, compareTo, getDescription, getFitness, isFitnessUnknown, mix, setDescription, setFitness, setFitnessUnknown |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChromosomeBoolean(int size)
Method Detail |
---|
public Object clone()
clone
in interface IChromosome
clone
in class AbstractChromosome
public void copy(IChromosome another)
copy
in interface IChromosome
copy
in class AbstractChromosome
public boolean equals(Object object)
equals
in interface IChromosome
equals
in class AbstractChromosome
object
- The object to compare.public boolean get(int index)
public int hashCode()
hashCode
in class AbstractChromosome
public void mix(IChromosome c1, IChromosome c2, boolean[] mask)
public void mutate(double mutationRate, double mutationMagnitude)
mutationRate
- Probability of a gene being mutated.mutationMagnitude
- The maximum allowed magnitude of the mutation.public void randomlyInitialize()
public void set(int index, boolean value)
public int size()
public void splice(IChromosome c1, IChromosome c2, int cut)
public String toString()
toString
in class AbstractChromosome
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |