org.jgap.impl
Class DefaultMutationRateCalculator
- java.lang.Object
-
- org.jgap.BaseRateCalculator
-
- org.jgap.impl.DefaultMutationRateCalculator
-
- All Implemented Interfaces:
- java.io.Serializable, IUniversalRateCalculator
public class DefaultMutationRateCalculator extends BaseRateCalculator
Default implementation of a mutation rate calculcator.- Since:
- 1.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DefaultMutationRateCalculator(Configuration a_config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcalculateCurrentRate()Calculates the mutation rate.booleantoBePermutated(IChromosome a_chrom, int a_geneIndex)Determines whether mutation is to be carried out.-
Methods inherited from class org.jgap.BaseRateCalculator
getConfiguration
-
-
-
-
Constructor Detail
-
DefaultMutationRateCalculator
public DefaultMutationRateCalculator(Configuration a_config) throws InvalidConfigurationException
- Parameters:
a_config- the configuration to use- Throws:
InvalidConfigurationException- Since:
- 3.0
-
-
Method Detail
-
calculateCurrentRate
public int calculateCurrentRate()
Calculates the mutation rate.- Returns:
- calculated divisor of mutation rate probability (dividend is 1)
- Since:
- 1.1 (same functionality as earlier, but not encapsulated)
-
toBePermutated
public boolean toBePermutated(IChromosome a_chrom, int a_geneIndex)
Determines whether mutation is to be carried out. In this case the rate is the size of the chromosome. There is therefore a probability of 1/totalgenes that a particular gene mutates.- Parameters:
a_chrom- ignoreda_geneIndex- ignored- Returns:
- true if gene should be mutated
- Since:
- 2.0
-
-
DMelt 3.0 © DataMelt by jWork.ORG