|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jaga.evolve.AdaptiveMutator
AdaptiveMutator throttles the mutation rate based on variety of the population.
The variety is calculated as the Hamming distance and in this implementation a rough estimate is achieved by taking the average of the hamming distances of 2 * popSize randomly selected individuals.
Minimum mutation rate is applied when we have a perfectly random population and average hamming distance per bit is 0.5.
Maximum mutation rate is applied when all individuals are equal and hamming distance is 0.
This operator works with variable length genotypes.
Constructor Summary | |
AdaptiveMutator(double lowMut,
double highMut)
Creates new AdaptiveMutator |
Method Summary | |
double |
getAvgHammingPerBit(Population pop)
Avg hamming distance / Avg genotype length |
void |
operate(Selector selector,
Population oldPopulation,
Population newPopulation,
int howMany)
method that adds genotypes to the new population by extracting some from the old one and manipulating them in some way. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AdaptiveMutator(double lowMut, double highMut)
highMut
- maximum mutations per genotype for when population stagnant.lowMut
- minimum mutations per genotype for when population random.Method Detail |
public void operate(Selector selector, Population oldPopulation, Population newPopulation, int howMany)
operate
in interface GeneticOperator
oldPopulation
- in parameter having all the original genotypesnewPopulation
- in/out parameter where the next generation of genotypes is being builthowMany
- how many new genotypes to add to the new populationpublic double getAvgHammingPerBit(Population pop)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |