|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.BaseGeneticOperator
org.jgap.impl.TwoWayMutationOperator
public class TwoWayMutationOperator
Considers two levels of mutation. At first, this mutation operator assumes all genes within a chromosome to having a different impact on the result when mutated. For that, a gene with fewer impact is selected for mutation more likely than one with bigger impact. After a gene has been selected for mutation, it is indeed mutated in a traditional way.
See class examples.dynamicMutation.DynamicMutationExample for usage, currently this class only works with that example!
| Constructor Summary | |
|---|---|
TwoWayMutationOperator()
Constructs a new instance of this MutationOperator without a specified mutation rate, which results in dynamic mutation being turned on. |
|
TwoWayMutationOperator(Configuration a_config)
Constructs a new instance of this MutationOperator without a specified mutation rate, which results in dynamic mutation being turned on. |
|
TwoWayMutationOperator(Configuration a_config,
int a_desiredMutationRate)
Constructs a new instance of this MutationOperator with the given mutation rate. |
|
TwoWayMutationOperator(Configuration a_config,
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 | |
|---|---|
int |
compareTo(java.lang.Object a_other)
Compares the given GeneticOperator to this GeneticOperator. |
boolean |
equals(java.lang.Object a_other)
Compares this GeneticOperator against the specified object. |
int |
getMutationRate()
|
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 a_mutationRateCalc)
Sets the MutationRateCalculator to be used for determining the strength of mutation. |
| Methods inherited from class org.jgap.BaseGeneticOperator |
|---|
getConfiguration |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TwoWayMutationOperator()
throws InvalidConfigurationException
Attention: The configuration used is the one set with the static method Genotype.setConfiguration.
InvalidConfigurationException
public TwoWayMutationOperator(Configuration a_config)
throws InvalidConfigurationException
a_config - the configuration to use
InvalidConfigurationException
public TwoWayMutationOperator(Configuration a_config,
IUniversalRateCalculator a_mutationRateCalculator)
throws InvalidConfigurationException
a_config - the configuration to usea_mutationRateCalculator - calculator for dynamic mutation rate
computation
InvalidConfigurationException
public TwoWayMutationOperator(Configuration a_config,
int a_desiredMutationRate)
throws InvalidConfigurationException
a_config - the configuration to usea_desiredMutationRate - 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
InvalidConfigurationException| Method Detail |
|---|
public void operate(Population a_population,
java.util.List a_candidateChromosomes)
GeneticOperator
a_population - see interfacea_candidateChromosomes - see interfacepublic IUniversalRateCalculator getMutationRateCalc()
public void setMutationRateCalc(IUniversalRateCalculator a_mutationRateCalc)
a_mutationRateCalc - MutationRateCalculatorpublic boolean equals(java.lang.Object a_other)
equals in class BaseGeneticOperatora_other - the object to compare against
public int compareTo(java.lang.Object a_other)
a_other - the instance against which to compare this instance
public int getMutationRate()
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||