jaga.evolve
Class ExactGenotypeMutator
java.lang.Object
|
+--jaga.evolve.ExactGenotypeMutator
- All Implemented Interfaces:
- GeneticOperator, java.io.Serializable
- public class ExactGenotypeMutator
- extends java.lang.Object
- implements GeneticOperator
Flips n bits per genotype.
Works with variable length genotypes.
- 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. |
void |
setRange(int start,
int end)
Sets the range within which mutations will be performed. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ExactGenotypeMutator
public ExactGenotypeMutator(int mutsPerGenotype)
- Creates new exactGenotypeMutator
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
setRange
public void setRange(int start,
int end)
- Sets the range within which mutations will be performed. And end of -1
specifies till the end of the genotype.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object