Class CrossoverDouble

java.lang.Object
org.opt4j.operator.crossover.CrossoverDouble
All Implemented Interfaces:
Operator<DoubleGenotype>, Crossover<DoubleGenotype>
Direct Known Subclasses:
CrossoverDoubleElementwise, CrossoverDoubleUnfairAverage

public abstract class CrossoverDouble extends Object implements Crossover<DoubleGenotype>
Crossover for the DoubleGenotype.
  • Field Details

  • Constructor Details

    • CrossoverDouble

      @Inject public CrossoverDouble(NormalizeDouble normalize, Rand random)
      Constructs a new crossover for the DoubleGenotype.
      Parameters:
      normalize - a normalize operator
      random - the random number generator
  • Method Details

    • crossover

      public Pair<DoubleGenotype> crossover(DoubleGenotype p1, DoubleGenotype 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<DoubleGenotype>
      Parameters:
      p1 - The first parent genotype for the crossover
      p2 - The second parents genotype for the crossover
      Returns:
      The resulting pair of offspring genotypes
    • crossover

      protected abstract void crossover(List<Double> p1, List<Double> p2, List<Double> o1, List<Double> o2)
      Performs a crossover of two parent Genotypes that consist of double vectors.
      Parameters:
      p1 - the first parent
      p2 - the second parent
      o1 - the first offspring
      o2 - the second offspring