|
||||||||||
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.ChromosomeDouble
public class ChromosomeDouble
Provides a chromosome which contains double
s.
Field Summary |
---|
Fields inherited from interface org.vizzini.ai.geneticalgorithm.IChromosome |
---|
UNKNOWN_FITNESS |
Constructor Summary | |
---|---|
ChromosomeDouble(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. |
double |
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 |
mix(IChromosome c1,
IChromosome c2,
double fraction)
Mix the genes of the given chromosomes into this using the given fraction. |
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,
double value)
Set the gene at index to the given value. |
void |
setRandomMax(double max)
Set the maximum used for random initialization. |
void |
setRandomMin(double min)
Set the minimum used for random initialization. |
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, setDescription, setFitness, setFitnessUnknown |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChromosomeDouble(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 double get(int index)
public int hashCode()
hashCode
in class AbstractChromosome
public void mix(IChromosome c1, IChromosome c2, boolean[] mask)
public void mix(IChromosome c1, IChromosome c2, double fraction)
mix
in interface IChromosome
mix
in class AbstractChromosome
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, double value)
public void setRandomMax(double max)
public void setRandomMin(double min)
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 |