Package evo.search.ga.mutators
Class PositionMutator
- java.lang.Object
-
- io.jenetics.AbstractAlterer<G,C>
-
- io.jenetics.Mutator<DiscreteGene,Double>
-
- evo.search.ga.mutators.PositionMutator
-
- All Implemented Interfaces:
DiscreteAlterer
,io.jenetics.Alterer<DiscreteGene,Double>
public class PositionMutator extends io.jenetics.Mutator<DiscreteGene,Double> implements DiscreteAlterer
The position mutator alters the position property of the chromosomes genes individually by a given chance.- Author:
- jotoh
-
-
Constructor Summary
Constructors Constructor Description PositionMutator(double probability)
Standard probability constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DiscreteGene
mutate(DiscreteGene gene, Random random)
Mutate the genes position.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface evo.search.ga.mutators.DiscreteAlterer
probability
-
-
-
-
Constructor Detail
-
PositionMutator
public PositionMutator(double probability)
Standard probability constructor. Utilized by theConfigPanel
.- Parameters:
probability
- the mutation probability
-
-
Method Detail
-
mutate
protected DiscreteGene mutate(DiscreteGene gene, Random random)
Mutate the genes position. Chooses a new position randomly.- Overrides:
mutate
in classio.jenetics.Mutator<DiscreteGene,Double>
- Parameters:
gene
- gene to mutaterandom
- random object for random doubles- Returns:
- gene with mutated position
-
-