Package io.jenetics

Class CombineAlterer<G extends Gene<?,G>,C extends Comparable<? super C>>

java.lang.Object
io.jenetics.AbstractAlterer<G,C>
io.jenetics.Recombinator<G,C>
io.jenetics.CombineAlterer<G,C>
All Implemented Interfaces:
Alterer<G,C>
Direct Known Subclasses:
MeanAlterer

public class CombineAlterer<G extends Gene<?,G>,C extends Comparable<? super C>> extends Recombinator<G,C>
Alters a chromosome by replacing two genes by the result of a given combiner function.

The order (Recombinator.order()) of this recombination implementation is two.

Since:
6.0
Version:
6.0
  • Constructor Details

  • Method Details

    • combiner

      Return the combiner function, used by this alterer.
      Returns:
      the combiner function, used by this alterer
    • recombine

      protected int recombine(MSeq<Phenotype<G,C>> population, int[] individuals, long generation)
      Description copied from class: Recombinator
      Recombination template method. This method is called 0 to n times. It is guaranteed that this method is only called by one thread.
      Specified by:
      recombine in class Recombinator<G extends Gene<?,G>,C extends Comparable<? super C>>
      Parameters:
      population - the population to recombine
      individuals - the array with the indexes of the individuals which are involved in the recombination step. The length of the array is Recombinator.order(). The first individual is the primary individual.
      generation - the current generation.
      Returns:
      the number of genes that has been altered.
    • toString

      public String toString()
      Overrides:
      toString in class Object