Package evo.search.ga.mutators
Class DistanceMutator
- java.lang.Object
-
- io.jenetics.AbstractAlterer<G,C>
-
- io.jenetics.Mutator<DiscreteGene,Double>
-
- evo.search.ga.mutators.DistanceMutator
-
- All Implemented Interfaces:
DiscreteAlterer
,io.jenetics.Alterer<DiscreteGene,Double>
public class DistanceMutator extends io.jenetics.Mutator<DiscreteGene,Double> implements DiscreteAlterer
The distance mutator alters the distance property of the chromosomes genes individually by a given distance.- Author:
- jotoh
-
-
Constructor Summary
Constructors Constructor Description DistanceMutator(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 distance.void
setConfiguration(Configuration configuration)
Configuration for the alterers to work with.-
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
-
DistanceMutator
public DistanceMutator(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 distance. Adds a random value from the interval [-1.0, 1.0) to the distance.- Overrides:
mutate
in classio.jenetics.Mutator<DiscreteGene,Double>
- Parameters:
gene
- gene to mutaterandom
- random object for random doubles- Returns:
- gene with mutated distance
-
setConfiguration
public void setConfiguration(Configuration configuration)
Configuration for the alterers to work with.
-
-