Class SimulatedBinaryCrossover<G extends NumericGene<?,G>,C extends Comparable<? super C>>

java.lang.Object
io.jenetics.AbstractAlterer<G,C>
io.jenetics.Recombinator<G,C>
io.jenetics.Crossover<G,C>
io.jenetics.ext.SimulatedBinaryCrossover<G,C>
All Implemented Interfaces:
Alterer<G,C>

public class SimulatedBinaryCrossover<G extends NumericGene<?,G>,C extends Comparable<? super C>> extends Crossover<G,C>
Performs the simulated binary crossover (SBX) on a Chromosome of NumericGenes such that each position is either crossed contracted or expanded with a certain probability. The probability distribution is designed such that the children will lie closer to their parents, as is the case with the single-point binary crossover.

It is implemented as described in Deb, K. and Agrawal, R. B. 1995. Simulated binary crossover for continuous search space. Complex Systems, 9, pp. 115-148.

Since:
3.5
Version:
6.0
  • Constructor Details

    • SimulatedBinaryCrossover

      public SimulatedBinaryCrossover(double probability, double contiguity)
      Create a new simulated binary crossover alterer with the given parameters.
      Parameters:
      probability - the recombination probability
      contiguity - the contiguity value that specifies how close a child should be to its parents (larger value means closer). The value must be greater or equal than 0. Typical values are in the range [2..5].
      Throws:
      IllegalArgumentException - if the probability is not in the valid range of [0, 1]
      IllegalArgumentException - if contiguity is smaller than zero
    • SimulatedBinaryCrossover

      public SimulatedBinaryCrossover(double probability)
      Create a new simulated binary crossover alterer with the given parameters. The contiguity value is set to 2.5.
      Parameters:
      probability - the recombination probability
      Throws:
      IllegalArgumentException - if the probability is not in the valid range of [0, 1]
      IllegalArgumentException - if contiguity is smaller than zero
  • Method Details

    • contiguity

      public double contiguity()
      Return the contiguity value of the crossover.
      Returns:
      the contiguity value of the crossover
    • crossover

      protected int crossover(MSeq<G> that, MSeq<G> other)
      Description copied from class: Crossover
      Template method which performs the crossover. The arguments given are mutable non-null arrays of the same length.
      Specified by:
      crossover in class Crossover<G extends NumericGene<?,G>,C extends Comparable<? super C>>
      Parameters:
      that - the genes of the first chromosome
      other - the genes of the other chromosome
      Returns:
      the number of altered genes
    • toString

      public String toString()
      Overrides:
      toString in class Object