Package io.jenetics

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

    • Method Detail

      • mutate

        protected MutatorResult<Chromosome<G>> mutate​(Chromosome<G> chromosome,
                                                      double p,
                                                      Random random)
        Swaps the genes in the given array, with the mutation probability of this mutation.
        Overrides:
        mutate in class Mutator<G extends Gene<?,​G>,​C extends Comparable<? super C>>
        Parameters:
        chromosome - the chromosome to mutate
        p - the mutation probability for the underlying genetic objects
        random - the random engine used for the genotype mutation
        Returns:
        the mutation result
        See Also:
        Mutator.mutate(Gene, Random)