org.jgap.impl
Class DefaultMutationRateCalculator

java.lang.Object
  extended byorg.jgap.impl.DefaultMutationRateCalculator
All Implemented Interfaces:
IUniversalRateCalculator

public class DefaultMutationRateCalculator
extends java.lang.Object
implements IUniversalRateCalculator

Default implementation of a mutation rate calculcator

Since:
1.1
Author:
Klaus Meffert

Constructor Summary
DefaultMutationRateCalculator()
           
 
Method Summary
 int calculateCurrentRate()
          Calculates the mutation rate
 boolean toBePermutated()
          Determines whether mutation is to be carried out.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMutationRateCalculator

public DefaultMutationRateCalculator()
Method Detail

calculateCurrentRate

public int calculateCurrentRate()
Calculates the mutation rate

Specified by:
calculateCurrentRate in interface IUniversalRateCalculator
Returns:
calculated divisor of mutation rate probability (dividend is 1)
Since:
1.1 (same functionality since earlier, but not encapsulated)

toBePermutated

public boolean toBePermutated()
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.

Specified by:
toBePermutated in interface IUniversalRateCalculator
Returns:
true if gene should be mutated.
Since:
2.0