jaga.evolve
Class LockingExactGenotypeMutator
java.lang.Object
|
+--jaga.evolve.LockingExactGenotypeMutator
- All Implemented Interfaces:
- GeneticOperator, java.io.Serializable
- public class LockingExactGenotypeMutator
- extends java.lang.Object
- implements GeneticOperator
This Genetic Operator will look at the bits of the elite through generations
and record the last time they changed. This 'age' of the bits is used to
modify the probability of them being mutated.
The probability of being mutated is modified in the following way:
If a bit is selected for mutation, then the probability of this mutation
being rejected (and another picked later) is calculated as 1/(age/alpha+1)
where age is the number of generations since this selected bit was
last mutated and alpha is the half-life, which is the age at which
we expect 1/2 chance of rejection. For example if alpha=1000 then
after 1000 generations with a bit not having changed, if it is chosen for
mutation there is a half-half chance it will be rejected and another chosen
instead.
- See Also:
- Serialized Form
Method Summary |
void |
operate(Selector selector,
Population oldPopulation,
Population newPopulation,
int howMany)
method that adds genotypes to the new population by extracting some
from the old one and manipulating them in some way. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LockingExactGenotypeMutator
public LockingExactGenotypeMutator(int mutsPerGen,
int halfLife)
- Creates new LockingExactGenotypeMutator
operate
public void operate(Selector selector,
Population oldPopulation,
Population newPopulation,
int howMany)
- method that adds genotypes to the new population by extracting some
from the old one and manipulating them in some way.
- Specified by:
operate
in interface GeneticOperator
- Parameters:
oldPopulation
- in parameter having all the original genotypesnewPopulation
- in/out parameter where the next generation of genotypes is being builthowMany
- how many new genotypes to add to the new population
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object