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 Details

    • _probability

      protected final double _probability
      The altering probability.
  • Constructor Details

    • AbstractAlterer

      protected AbstractAlterer(double probability)
      Constructs an alterer with a given recombination probability.
      Parameters:
      probability - The recombination probability.
      Throws:
      IllegalArgumentException - if the probability is not in the valid range of [0, 1].
  • Method Details

    • probability

      public double probability()
      Return the recombination/alter probability for this alterer.
      Returns:
      The recombination probability.