Class RepeatedMutator

java.lang.Object
net.bmahe.genetics4j.core.mutation.RepeatedMutator
All Implemented Interfaces:
Mutator

public class RepeatedMutator extends Object implements Mutator
Applies a child mutator repeatedly, passing each mutation result to the next invocation.
  • Field Details

  • Constructor Details

  • Method Details

    • mutate

      public Genotype mutate(long generation, Genotype original)
      Description copied from interface: Mutator
      Applies mutation to the given genotype and returns a new mutated genotype.

      The original genotype should not be modified; instead, a new genotype with the mutations applied should be returned. The specific mutation behavior depends on the implementation and the mutation policy being used.

      Mutation may affect:

      • Individual alleles within chromosomes (bit flips, value changes)
      • Chromosome structure (for variable-length representations)
      • Multiple chromosomes simultaneously
      Specified by:
      mutate in interface Mutator
      Parameters:
      generation - the current generation
      original - the genotype to mutate, must not be null
      Returns:
      a new genotype with mutations applied, never null
    • numberOfRepetitions

      private int numberOfRepetitions()