Package io.jenetics
Class MeanAlterer<G extends Gene<?,G> & Mean<G>,C extends Comparable<? super C>>
- java.lang.Object
-
- io.jenetics.AbstractAlterer<G,C>
-
- io.jenetics.Recombinator<G,C>
-
- io.jenetics.CombineAlterer<G,C>
-
- io.jenetics.MeanAlterer<G,C>
-
- All Implemented Interfaces:
Alterer<G,C>
public class MeanAlterer<G extends Gene<?,G> & Mean<G>,C extends Comparable<? super C>> extends CombineAlterer<G,C>
Alters a chromosome by replacing two genes by its mean value.The order (
Recombinator.order()
) of this recombination implementation is two.- Since:
- 1.0
- Version:
- 6.0
- 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 MeanAlterer()
Create a new alterer with alter probability of0.05
.MeanAlterer(double probability)
Constructs an alterer with a given recombination probability.
-
Method Summary
-
Methods inherited from class io.jenetics.CombineAlterer
combiner, recombine, toString
-
Methods inherited from class io.jenetics.Recombinator
alter, order
-
Methods inherited from class io.jenetics.AbstractAlterer
probability
-
-
-
-
Constructor Detail
-
MeanAlterer
public MeanAlterer(double probability)
Constructs an alterer with a given recombination probability.- Parameters:
probability
- the crossover probability.- Throws:
IllegalArgumentException
- if theprobability
is not in the valid range of[0, 1]
.
-
MeanAlterer
public MeanAlterer()
Create a new alterer with alter probability of0.05
.
-
-