public class Mutator<G extends Gene<?,G>,C extends Comparable<? super C>> extends AbstractAlterer<G,C>
The mutation probability is the parameter that must be optimized. The optimal value of the mutation rate depends on the role mutation plays. If mutation is the only source of exploration (if there is no crossover) then the mutation rate should be set so that a reasonable neighborhood of solutions is explored.
The mutation probability P(m) is the probability that a specific gene over the whole population is mutated. The number of available genes of an population is
 ![N_P N_{g}=N_P \sum_{i=0}^{N_{G}-1}N_{C[i]}](doc-files/mutator-N_G.gif) 
 
  
 
_probabilityDEFAULT_ALTER_PROBABILITY| Constructor and Description | 
|---|
| Mutator()Default constructor, with probability = 0.01. | 
| Mutator(double probability)Construct a Mutation object which a given mutation probability. | 
| Modifier and Type | Method and Description | 
|---|---|
| int | alter(Population<G,C> population,
     long generation)Concrete implementation of the alter method. | 
| boolean | equals(Object obj) | 
| int | hashCode() | 
| protected int | mutate(MSeq<G> genes,
      double p)
 Template method which gives an (re)implementation of the mutation class
 the possibility to perform its own mutation operation, based on a
 writable gene array and the gene mutation probability p. | 
| String | toString() | 
getProbabilitypublic Mutator(double probability)
probability - Mutation probability. The given probability is
         divided by the number of chromosomes of the genotype to form
         the concrete mutation probability.IllegalArgumentException - if the probability is not in the
          valid range of [0, 1]..public Mutator()
public int alter(Population<G,C> population, long generation)
population - The Population to be altered. If the
        population is null or empty, nothing is altered.generation - the date of birth (generation) of the altered phenotypes.protected int mutate(MSeq<G> genes, double p)
Template method which gives an (re)implementation of the mutation class the possibility to perform its own mutation operation, based on a writable gene array and the gene mutation probability p.
genes - the genes to mutate.p - the gene mutation probability.public int hashCode()
hashCode in class AbstractAlterer<G extends Gene<?,G>,C extends Comparable<? super C>>public boolean equals(Object obj)
equals in class AbstractAlterer<G extends Gene<?,G>,C extends Comparable<? super C>>© 2007-2014 Franz Wilhelmstötter (2014-12-28 10:45)