|
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.MutationOperator
public class 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 determined by this class if no fixed rate is provided, and is calculated based on the size of the Chromosomes in the population. Details are specified in the DefaultMutationRateCalculator class.
| Field Summary |
|---|
| Fields inherited from class org.jgap.BaseGeneticOperator |
|---|
m_monitor, m_monitorActive |
| Constructor Summary | |
|---|---|
MutationOperator()
Constructs a new instance of this MutationOperator without a specified mutation rate, which results in dynamic mutation being turned on. |
|
MutationOperator(Configuration a_conf)
|
|
MutationOperator(Configuration a_config,
int a_desiredMutationRate)
Constructs a new instance of this MutationOperator with the given mutation rate. |
|
MutationOperator(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 |
setMutationRate(int a_mutationRate)
|
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 MutationOperator()
throws InvalidConfigurationException
Attention: The configuration used is the one set with the static method Genotype.setConfiguration.
InvalidConfigurationException
public MutationOperator(Configuration a_conf)
throws InvalidConfigurationException
a_conf - the configuration to use
InvalidConfigurationException
public MutationOperator(Configuration a_config,
IUniversalRateCalculator a_mutationRateCalculator)
throws InvalidConfigurationException
a_config - the configuration to usea_mutationRateCalculator - calculator for dynamic mutation rate
computation
InvalidConfigurationException
public MutationOperator(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
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 not be modified. Please notice, that the call in
Genotype.evolve() to the implementations of GeneticOperator overgoes this
due to performance issuesa_candidateChromosomes - the pool of chromosomes that have been
mutatedpublic IUniversalRateCalculator getMutationRateCalc()
public void setMutationRateCalc(IUniversalRateCalculator a_mutationRateCalc)
a_mutationRateCalc - MutationRateCalculatorpublic void setMutationRate(int a_mutationRate)
a_mutationRate - new 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 entirelypublic 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)
compareTo in interface java.lang.Comparablea_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 | ||||||||