Package io.jenetics

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

  • All Implemented Interfaces:
    Alterer<G,​C>
    Direct Known Subclasses:
    GaussianMutator, SwapMutator

    public class Mutator<G extends Gene<?,​G>,​C extends Comparable<? super C>>
    extends AbstractAlterer<G,​C>
    This class is for mutating a chromosomes of an given population. There are two distinct roles mutation plays
    • Exploring the search space. By making small moves mutation allows a population to explore the search space. This exploration is often slow compared to crossover, but in problems where crossover is disruptive this can be an important way to explore the landscape.
    • Maintaining diversity. Mutation prevents a population from correlating. Even if most of the search is being performed by crossover, mutation can be vital to provide the diversity which crossover needs.

    The mutation probability is the parameter that must be optimized. The optimal value of the mutation rate depends on the role mutation plays. If mutation is the only source of exploration (if there is no crossover) then the mutation rate should be set so that a reasonable neighborhood of solutions is explored.

    The mutation probability P(m) is the probability that a specific gene over the whole population is mutated. The number of available genes of an population is

    N_P N_{g}=N_P \sum_{i=0}^{N_{G}-1}N_{C[i]}

    where NP is the population size, Ng the number of genes of a genotype. So the (average) number of genes mutated by the mutation is

    \hat{\mu}=N_{P}N_{g}\cdot P(m)

    Since:
    1.0
    Version:
    4.0