Package io.jenetics
Class GaussianMutator<G extends NumericGene<?,G>,C extends Comparable<? super C>>
- java.lang.Object
-
- io.jenetics.AbstractAlterer<G,C>
-
- io.jenetics.Mutator<G,C>
-
- io.jenetics.GaussianMutator<G,C>
-
- All Implemented Interfaces:
Alterer<G,C>
public class GaussianMutator<G extends NumericGene<?,G>,C extends Comparable<? super C>> extends Mutator<G,C>
The GaussianMutator class performs the mutation of aNumericGene
. This mutator picks a new value based on a Gaussian distribution around the current value of the gene. The variance of the new value (before clipping to the allowed gene range) will be- Since:
- 1.0
- Version:
- 4.4
- Author:
- Franz Wilhelmstötter
-
-
Field Summary
-
Fields inherited from class io.jenetics.AbstractAlterer
_probability
-
Fields inherited from interface io.jenetics.Alterer
DEFAULT_ALTER_PROBABILITY
-
-
Constructor Summary
Constructors Constructor Description GaussianMutator()
GaussianMutator(double probability)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected G
mutate(G gene, Random random)
Mutates the given gene.String
toString()
-
Methods inherited from class io.jenetics.AbstractAlterer
probability
-
-
-
-
Constructor Detail
-
GaussianMutator
public GaussianMutator(double probability)
-
GaussianMutator
public GaussianMutator()
-
-
Method Detail
-
mutate
protected G mutate(G gene, Random random)
Description copied from class:Mutator
Mutates the given gene.- Overrides:
mutate
in classMutator<G extends NumericGene<?,G>,C extends Comparable<? super C>>
- Parameters:
gene
- the gene to mutaterandom
- the random engine used for the genotype mutation- Returns:
- the mutation result
-
toString
public String toString()
- Overrides:
toString
in classMutator<G extends NumericGene<?,G>,C extends Comparable<? super C>>
-
-