public class WeaselMutator<G extends Gene<?,G>,C extends Comparable<? super C>> extends Mutator<G,C>
The mutator mutates the genes of every chromosome of every genotype in the population with the given mutation probability.
Engine
setup for the Weasel program:
final Engine<CharacterGene, Integer> engine = Engine
.builder(fitness, gtf)
// Set the 'WeaselSelector'.
.selector(new WeaselSelector<>())
// Disable survivors selector.
.offspringFraction(1)
// Set the 'WeaselMutator'.
.alterers(new WeaselMutator<>(0.05))
.build();
WeaselSelector
_probability
DEFAULT_ALTER_PROBABILITY
Constructor and Description |
---|
WeaselMutator() |
WeaselMutator(double probability) |
Modifier and Type | Method and Description |
---|---|
int |
alter(Population<G,C> population,
long generation) |
getProbability
public WeaselMutator(double probability)
public WeaselMutator()
© 2007-2017 Franz Wilhelmstötter (2017-04-27 23:07)