Class WeaselMutator<G extends Gene<?,​G>,​C extends Comparable<? super C>>

  • Type Parameters:
    G - the gene type
    C - the fitness result type
    All Implemented Interfaces:
    Alterer<G,​C>

    public class WeaselMutator<G extends Gene<?,​G>,​C extends Comparable<? super C>>
    extends Mutator<G,​C>
    Mutator implementation which is part of the Weasel program algorithm. The Weasel program is an thought experiment by Richard Dawkins to illustrate the functioning of the evolution: random mutation combined with non-random cumulative selection.

    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(problem) // Set the 'WeaselSelector'. .selector(new WeaselSelector<>()) // Disable survivors selector. .offspringFraction(1) // Set the 'WeaselMutator'. .alterers(new WeaselMutator<>(0.05)) .build();
    Since:
    3.5
    Version:
    5.0
    See Also:
    Weasel program, WeaselSelector