java.lang.Object
org.moeaframework.core.operator.real.SBX
All Implemented Interfaces:
Configurable, Variation

public class SBX extends Object implements Variation
Simulated binary crossover (SBX) operator. SBX attempts to simulate the offspring distribution of binary-encoded single-point crossover on real-valued decision variables. An example of this distribution, which favors offspring nearer to the two parents, is shown below.

Example SBX operator distribution

The distribution index controls the shape of the offspring distribution. Larger values for the distribution index generates offspring closer to the parents.

This operator is type-safe.

References:

  1. Deb, K. and Agrawal, R. B. "Simulated Binary Crossover for Continuous Search Space." Indian Institute of Technology, Kanpur, India. Technical Report No. IITK/ME/SMD-94027, 1994.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SBX()
    Constructs a SBX operator with default settings.
    SBX(double probability, double distributionIndex)
    Constructs a SBX operator with the specified probability and distribution index.
    SBX(double probability, double distributionIndex, boolean swap, boolean symmetric)
    Constructs a SBX operator with the specified probability and distribution index.
  • Method Summary

    Modifier and Type
    Method
    Description
    evolve(Solution[] parents)
    Evolves one or more parent solutions (specified by getArity) and produces one or more child solutions.
    static void
    evolve_asymmetric(RealVariable v1, RealVariable v2, double distributionIndex)
    Evolves the specified variables using the SBX operator using asymmetric distributions.
    static void
    evolve_symmetric(RealVariable v1, RealVariable v2, double distributionIndex)
    Evolves the specified variables using the SBX operator using symmetric distributions.
    int
    Returns the number of solutions that must be supplied to the evolve method.
    double
    Returns the distribution index of this SBX operator.
    Returns the name of this variation operator.
    double
    Returns the probability of applying this SBX operator to each variable.
    boolean
    Returns true if this SBX operator swaps variables between the two parents.
    boolean
    Returns true if the offspring are distributed symmetrically; or false if asymmetric distributions are used.
    void
    setDistributionIndex(double distributionIndex)
    Sets the distribution index of this SBX operator.
    void
    setProbability(double probability)
    Sets the probability of applying this SBX operator to each variable.
    void
    setSwap(boolean swap)
    Sets whether this SBX operator swaps variables between the two parents.
    void
    setSymmetric(boolean symmetric)
    Sets if offspring are distributed symmetrically or asymmetrically.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.moeaframework.core.configuration.Configurable

    applyConfiguration, getConfiguration
  • Constructor Details

    • SBX

      public SBX()
      Constructs a SBX operator with default settings. This includes a probability of 1.0 and a distribution index of 15.0.
    • SBX

      public SBX(double probability, double distributionIndex)
      Constructs a SBX operator with the specified probability and distribution index.
      Parameters:
      probability - the probability of applying this SBX operator to each variable
      distributionIndex - the distribution index of this SBX operator
    • SBX

      public SBX(double probability, double distributionIndex, boolean swap, boolean symmetric)
      Constructs a SBX operator with the specified probability and distribution index. Set swap to true to recreate the traditional SBX operation; and to false to use the SBX variant used by NSGA-III.
      Parameters:
      probability - the probability of applying this SBX operator to each variable
      distributionIndex - the distribution index of this SBX operator
      swap - if true, randomly swap the variables between the two parents
      symmetric - if true, symmetric distributions are used
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Variation
      Returns the name of this variation operator. This name should also be used as the prefix for any parameters. As such, the name should only contain alphanumeric characters, avoid using whitespace and other symbols.
      Specified by:
      getName in interface Variation
      Returns:
      the name of this variation operator
    • getProbability

      public double getProbability()
      Returns the probability of applying this SBX operator to each variable.
      Returns:
      the probability of applying this SBX operator to each variable
    • setProbability

      public void setProbability(double probability)
      Sets the probability of applying this SBX operator to each variable.
      Parameters:
      probability - the probability (0.0 - 1.0)
    • getDistributionIndex

      public double getDistributionIndex()
      Returns the distribution index of this SBX operator.
      Returns:
      the distribution index of this SBX operator
    • setDistributionIndex

      public void setDistributionIndex(double distributionIndex)
      Sets the distribution index of this SBX operator.
      Parameters:
      distributionIndex - the distribution index
    • isSwap

      public boolean isSwap()
      Returns true if this SBX operator swaps variables between the two parents. Disabling this swapping produces offspring closer to the two parents, which is beneficial for NSGA-III.
      Returns:
      true if this SBX operator swaps variables between the two parents
    • setSwap

      public void setSwap(boolean swap)
      Sets whether this SBX operator swaps variables between the two parents.
      Parameters:
      swap - true if this SBX operator swaps variables between the two parents
    • isSymmetric

      public boolean isSymmetric()
      Returns true if the offspring are distributed symmetrically; or false if asymmetric distributions are used.
      Returns:
      true if the offspring are distributed symmetrically; or false if asymmetric distributions are used
    • setSymmetric

      public void setSymmetric(boolean symmetric)
      Sets if offspring are distributed symmetrically or asymmetrically.
      Parameters:
      symmetric - true if the offspring are distributed symmetrically; or false if asymmetric distributions are used
    • getArity

      public int getArity()
      Description copied from interface: Variation
      Returns the number of solutions that must be supplied to the evolve method.
      Specified by:
      getArity in interface Variation
      Returns:
      the number of solutions that must be supplied to the evolve method
    • evolve

      public Solution[] evolve(Solution[] parents)
      Description copied from interface: Variation
      Evolves one or more parent solutions (specified by getArity) and produces one or more child solutions. By contract, the parents must not be modified. The copy constructor should be used to create copies of the parents with these copies subsequently modified.
      Specified by:
      evolve in interface Variation
      Parameters:
      parents - the array of parent solutions
      Returns:
      an array of child solutions
    • evolve_symmetric

      public static void evolve_symmetric(RealVariable v1, RealVariable v2, double distributionIndex)
      Evolves the specified variables using the SBX operator using symmetric distributions.
      Parameters:
      v1 - the first variable
      v2 - the second variable
      distributionIndex - the distribution index of this SBX operator
    • evolve_asymmetric

      public static void evolve_asymmetric(RealVariable v1, RealVariable v2, double distributionIndex)
      Evolves the specified variables using the SBX operator using asymmetric distributions.
      Parameters:
      v1 - the first variable
      v2 - the second variable
      distributionIndex - the distribution index of this SBX operator