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
The new value will be cropped to the gene's boundaries.- Since:
- 1.0
- Version:
- 6.1
-
-
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 Gmutate(G gene, Random random)Mutates the given gene.StringtoString()-
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:MutatorMutates the given gene.- Overrides:
mutatein 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:
toStringin classMutator<G extends NumericGene<?,G>,C extends Comparable<? super C>>
-
-