Class GaussianMutation

java.lang.Object
edu.cnu.mdi.sim.ga.triimage.GaussianMutation
All Implemented Interfaces:
MutationOperator<PolygonChromosome>

public final class GaussianMutation extends Object implements MutationOperator<PolygonChromosome>
Mutation operator that applies Gaussian noise to the genes of a PolygonChromosome.

Mutation model

Each triangle is mutated with probability mutationRate. A selected triangle receives one coherent edit: translation, scaling about its centroid, movement of one vertex, color/opacity adjustment, or an occasional full reset. This preserves useful triangles while still exploring their local neighborhood.

The effective mutation rate and Gaussian scale decay exponentially over roughly the first 3,000 generations, retaining 25% and 20% of their initial values respectively. This shifts the search from exploration toward fine adjustment without ever eliminating mutation entirely.

Typical values

  • mutationRate — 0.02 to 0.05 per triangle
  • sigma — 0.03 to 0.08; larger values explore more aggressively but can destabilize good solutions
  • resetProbability — 0.05 to 0.15; keep small so resets are rare escapes, not routine disruption
  • Constructor Details

    • GaussianMutation

      public GaussianMutation(double mutationRate, double sigma, double resetProbability)
      Construct with explicit mutation rate, sigma, and reset probability.
      Parameters:
      mutationRate - per-triangle mutation probability (must be in [0, 1])
      sigma - standard deviation of Gaussian perturbation (must be > 0)
      resetProbability - probability of full gene reset vs. perturbation (must be in [0, 1])
      Throws:
      IllegalArgumentException - if any argument is out of range
    • GaussianMutation

      public GaussianMutation(double mutationRate, double sigma)
      Convenience constructor with no reset mutations. Equivalent to GaussianMutation(mutationRate, sigma, 0.0).
      Parameters:
      mutationRate - per-triangle mutation probability
      sigma - standard deviation of Gaussian perturbation
  • Method Details

    • beginGeneration

      public void beginGeneration(long generation, long maxGenerations)
      Description copied from interface: MutationOperator
      Notify the operator before offspring are created for a generation. Stateful operators may use this to adapt their mutation strength.
      Specified by:
      beginGeneration in interface MutationOperator<PolygonChromosome>
      Parameters:
      generation - generation about to be produced, starting at zero
      maxGenerations - configured generation limit
    • mutate

      public PolygonChromosome mutate(PolygonChromosome individual, Random rng)
      Description copied from interface: MutationOperator
      Mutate an individual, either in-place or by returning a replacement.
      Specified by:
      mutate in interface MutationOperator<PolygonChromosome>
      Parameters:
      individual - individual to mutate
      rng - source of randomness
      Returns:
      non-null mutated individual
    • mutate

      public PolygonChromosome mutate(PolygonChromosome individual, Random rng, double configuredRate)
      Apply the configured mutation probability to one offspring. Operators with gene-level mutation semantics may override this method and interpret mutationRate at that finer granularity.

      Interprets configuredRate as a direct per-triangle mutation probability (finer-grained than the interface's default whole-individual gate), then applies this generation's cooling to it. The cooling is applied as the dimensionless ratio effectiveMutationRate / mutationRate, which reduces to the cooling schedule's (0.25 + 0.75 * cooling) factor regardless of this instance's own mutationRate — so configuredRate need not match the constructor's mutationRate for the cooling curve to apply correctly.

      Specified by:
      mutate in interface MutationOperator<PolygonChromosome>
      Parameters:
      individual - offspring to consider for mutation
      rng - source of randomness
      configuredRate - configured rate in [0,1]
      Returns:
      the original or mutated individual; never null