aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/modules/mutator/Mutator.java
blob: 56692efe82c8e961081aee6e56ba8dcd66c83bb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package jcgp.backend.modules.mutator;

import jcgp.backend.modules.Module;
import jcgp.backend.population.Chromosome;
import jcgp.backend.resources.Resources;

/**
 * This class specifies the basic characteristics of a mutation operator. Its job is 
 * to modify the connections and functions of the chromosome according to the operator's
 * parameters.
 * <br><br>
 * Parameters may be specified to control the implemented mutation. Any parameters
 * registered with {@code registerParameters()} should be displayed by the user interface,
 * if it is being used. See {@link Module} for more information. 
 * <br><br>
 * It is advisable to use {@code Resources.reportln()} and {@code Resources.report()}
 * to print any relevant information. Note that reportln() and report() are affected
 * by the report interval base parameter. Use {@code Resources.println()} and
 * {@code Resources.print()} to print information regardless of the current generation.
 * See {@link Resources} for more information.
 * 
 * @see Module
 * 
 * @author Eduardo Pedroni
 *
 */
public abstract class Mutator extends Module {
	
	/**
	 * For internal use only, initialises the resources field.
	 * 
	 * @param resources the experiment's resources.
	 */
	protected Mutator(Resources resources) {
		super(resources);
	}

	/**
	 * Applies mutations to the specified chromosome according
	 * to the parameter values.
	 * 
	 * @param chromosome the chromosome to mutate.
	 */
	public abstract void mutate(Chromosome chromosome);
	
}