Class CrossoverListXPoint<G extends ListGenotype<?>>

java.lang.Object
org.opt4j.operator.crossover.CrossoverListXPoint<G>
All Implemented Interfaces:
Operator<G>, Crossover<G>
Direct Known Subclasses:
CrossoverBooleanXPoint, CrossoverIntegerXPoint

public abstract class CrossoverListXPoint<G extends ListGenotype<?>> extends Object implements Crossover<G>

The CrossoverListXPoint performs a crossover on Genotype objects that are lists of values.

The crossover is performed on x points of the Genotype.

  • Field Details

    • x

      protected final int x
    • random

      protected final Random random
  • Constructor Details

    • CrossoverListXPoint

      @Inject public CrossoverListXPoint(int x, Rand random)
      Constructs a CrossoverListXPoint.
      Parameters:
      x - the number of crossover points
      random - the random number generator
  • Method Details

    • crossover

      public Pair<G> crossover(G p1, G p2)
      Description copied from interface: Crossover
      Performs a crossover for two Genotype parents. The resulting pair of Genotype offspring is returned.
      Specified by:
      crossover in interface Crossover<G extends ListGenotype<?>>
      Parameters:
      p1 - The first parent genotype for the crossover
      p2 - The second parents genotype for the crossover
      Returns:
      The resulting pair of offspring genotypes