Package io.jenetics
Class AbstractAlterer<G extends Gene<?,G>,C extends Comparable<? super C>>
- java.lang.Object
-
- io.jenetics.AbstractAlterer<G,C>
-
- All Implemented Interfaces:
Alterer<G,C>
- Direct Known Subclasses:
Mutator
,Recombinator
public abstract class AbstractAlterer<G extends Gene<?,G>,C extends Comparable<? super C>> extends Object implements Alterer<G,C>
Abstract implementation of the alterer interface.- Since:
- 1.0
- Version:
- 6.0
-
-
Field Summary
Fields Modifier and Type Field Description protected double
_probability
The altering probability.-
Fields inherited from interface io.jenetics.Alterer
DEFAULT_ALTER_PROBABILITY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAlterer(double probability)
Constructs an alterer with a given recombination probability.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
probability()
Return the recombination/alter probability for this alterer.
-
-
-
Field Detail
-
_probability
protected final double _probability
The altering probability.
-
-
Constructor Detail
-
AbstractAlterer
protected AbstractAlterer(double probability)
Constructs an alterer with a given recombination probability.- Parameters:
probability
- The recombination probability.- Throws:
IllegalArgumentException
- if theprobability
is not in the valid range of[0, 1]
.
-
-
Method Detail
-
probability
public double probability()
Return the recombination/alter probability for this alterer.- Returns:
- The recombination probability.
-
-