View Javadoc
1   package net.bmahe.genetics4j.core.spec.mutation;
2   
3   /**
4    * Marker interface for mutation policy specifications in evolutionary algorithms.
5    * 
6    * <p>MutationPolicy defines the contract for specifying mutation strategies and their parameters. Mutation policies
7    * determine how genetic variation is introduced into the population by making random changes to individual genotypes.
8    * Different mutation policies implement various strategies for balancing exploration and exploitation during the
9    * evolutionary process.
10   * 
11   * <p>Mutation policies are used by:
12   * <ul>
13   * <li><strong>EA Configuration</strong>: To specify the mutation strategy for the algorithm</li>
14   * <li><strong>Mutation handlers</strong>: To create appropriate mutator implementations</li>
15   * <li><strong>Strategy resolution</strong>: To select chromosome-specific mutation operators</li>
16   * <li><strong>Parameter configuration</strong>: To define mutation rates and other parameters</li>
17   * </ul>
18   * 
19   * <p>The framework provides several concrete mutation policy implementations:
20   * <ul>
21   * <li>{@link RandomMutation}: Randomly changes allele values with specified probability</li>
22   * <li>{@link CreepMutation}: Makes small incremental changes to numeric values</li>
23   * <li>{@link SwapMutation}: Exchanges positions of alleles (useful for permutations)</li>
24   * <li>{@link PartialMutation}: Applies mutation to only a subset of chromosomes</li>
25   * <li>{@link MultiMutations}: Combines multiple mutation strategies</li>
26   * <li>{@link RepeatedMutation}: Applies another mutation strategy repeatedly</li>
27   * </ul>
28   * 
29   * <p>Mutation strategies vary by chromosome type and problem domain:
30   * <ul>
31   * <li><strong>Binary chromosomes</strong>: Bit flip mutations</li>
32   * <li><strong>Numeric chromosomes</strong>: Gaussian noise, uniform perturbation, creep mutation</li>
33   * <li><strong>Permutation chromosomes</strong>: Swap, insert, inversion mutations</li>
34   * <li><strong>Tree chromosomes</strong>: Node replacement, subtree mutation, growth/pruning</li>
35   * </ul>
36   * 
37   * <p>Key considerations for mutation policy design:
38   * <ul>
39   * <li><strong>Mutation rate</strong>: Balance between exploration and exploitation</li>
40   * <li><strong>Chromosome compatibility</strong>: Ensure mutation respects chromosome constraints</li>
41   * <li><strong>Problem-specific operations</strong>: Adapt mutation to problem characteristics</li>
42   * <li><strong>Adaptive strategies</strong>: Allow mutation parameters to evolve during the run</li>
43   * </ul>
44   * 
45   * <p>Example usage in genetic algorithm configuration:
46   * 
47   * <pre>{@code
48   * // Random mutation with 5% probability per allele
49   * MutationPolicy randomMutation = RandomMutation.of(0.05);
50   * 
51   * // Creep mutation for numeric optimization
52   * MutationPolicy creepMutation = CreepMutation.of(0.1, 1.0);
53   * 
54   * // Combination of multiple mutation strategies
55   * MutationPolicy multiMutation = MultiMutations.of(Tuple.of(0.7, randomMutation), Tuple.of(0.3, creepMutation));
56   * 
57   * // Use in EA configuration
58   * EAConfiguration<Double> config = EAConfigurationBuilder.<Double>builder()
59   * 		.chromosomeSpecs(chromosomeSpec)
60   * 		.mutationPolicy(randomMutation)
61   * 		.build();
62   * }</pre>
63   * 
64   * @see net.bmahe.genetics4j.core.mutation.Mutator
65   * @see net.bmahe.genetics4j.core.mutation.MutationPolicyHandler
66   * @see RandomMutation
67   * @see CreepMutation
68   * @see SwapMutation
69   * @see PartialMutation
70   * @see MultiMutations
71   * @see RepeatedMutation
72   */
73  public interface MutationPolicy {
74  
75  }