|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgap.impl.MutationOperator
The mutation operator runs through the genes in each of the Chromosomes in the population and mutates them in statistical accordance to the given mutation rate. Mutated Chromosomes are then added to the list of candidate Chromosomes destined for the natural selection process.
This MutationOperator supports both fixed and dynamic mutation rates. A fixed rate is one specified at construction time by the user. A dynamic rate is one determined by this class if no fixed rate is provided, and is calculated based on the size of the Chromosomes in the population such that, on average, one gene will be mutated for every ten Chromosomes processed by this operator.
| Constructor Summary | |
MutationOperator()
Constructs a new instance of this MutationOperator without a specified mutation rate, which results in dynamic mutation being turned on. |
|
MutationOperator(int a_desiredMutationRate)
Constructs a new instance of this MutationOperator with the given mutation rate. |
|
MutationOperator(IUniversalRateCalculator a_mutationRateCalculator)
Constructs a new instance of this MutationOperator with a specified mutation rate calculator, which results in dynamic mutation being turned on. |
|
| Method Summary | |
IUniversalRateCalculator |
getMutationRateCalc()
|
void |
operate(Population a_population,
java.util.List a_candidateChromosomes)
The operate method will be invoked on each of the genetic operators referenced by the current Configuration object during the evolution phase. |
void |
setMutationRateCalc(IUniversalRateCalculator m_mutationRateCalc)
Sets the MutationRateCalculator to be used for determining the strengt of mutation |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MutationOperator()
public MutationOperator(IUniversalRateCalculator a_mutationRateCalculator)
a_mutationRateCalculator - calculator for dynamic mutation rate
computationpublic MutationOperator(int a_desiredMutationRate)
a_desiredMutationRate - The desired rate of mutation, expressed
as the denominator of the 1 / X fraction.
For example, 1000 would result in 1/1000
genes being mutated on average. A mutation
rate of zero disables mutation entirely.| Method Detail |
public void operate(Population a_population,
java.util.List a_candidateChromosomes)
operate in interface GeneticOperatora_population - The population of chromosomes from the current
evolution prior to exposure to any genetic operators.
Chromosomes in this array should never be modified.a_candidateChromosomes - The pool of chromosomes that are candidates
for the next evolved population. Only these
chromosomes will go to the natural
phase, so it's important to add any
modified copies of Chromosomes to this
list if it's desired for them to be
considered for natural selection.public IUniversalRateCalculator getMutationRateCalc()
public void setMutationRateCalc(IUniversalRateCalculator m_mutationRateCalc)
m_mutationRateCalc - MutationRateCalculator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||