Package io.jenetics

Class MeanAlterer<G extends Gene<?,G> & Mean<G>,C extends Comparable<? super 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
  • Constructor Details

    • MeanAlterer

      public MeanAlterer(double probability)
      Constructs an alterer with a given recombination probability.
      Parameters:
      probability - the crossover probability.
      Throws:
      IllegalArgumentException - if the probability is not in the valid range of [0, 1].
    • MeanAlterer

      public MeanAlterer()
      Create a new alterer with alter probability of 0.05.