Class DifferentialEvolutionVariation

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

public class DifferentialEvolutionVariation extends Object implements Variation
Differential evolution (DE) variation operator. Differential evolution works by randomly selecting three distinct individuals from a population. A difference vector is calculated between the first two individuals (shown as the left-most arrow in the figure below), which is subsequently applied to the third individual (shown as the right-most arrow in the figure below).

Example DifferentialEvolution operator distribution

The scaling factor parameter adjusts the magnitude of the difference vector, allowing the user to decrease or increase the magnitude in relation to the actual difference between the individuals. The crossover rate parameter controls the fraction of decision variables which are modified by the DE operator.

References:

  1. Storn and Price. "Differential Evolution - A Simple and Efficient Heuristic for Global Optimization over Continuous Spaces." Journal of Global Optimization, 11:341-359, 1997.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a differential evolution operator with default settings, including a crossover rate of 0.1 and scaling factor of 0.5.
    DifferentialEvolutionVariation(double crossoverRate, double scalingFactor)
    Constructs a differential evolution operator with the specified crossover rate and scaling factor.
  • 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.
    int
    Returns the number of solutions that must be supplied to the evolve method.
    double
    Returns the crossover rate of this differential evolution operator.
    Returns the name of this variation operator.
    double
    Returns the scaling factor of this differential evolution operator.
    void
    setCrossoverRate(double crossoverRate)
    Sets the crossover rate of this differential evolution operator.
    void
    setScalingFactor(double scalingFactor)
    Sets the scaling factor of this differential evolution operator.

    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

    • DifferentialEvolutionVariation

      public DifferentialEvolutionVariation()
      Constructs a differential evolution operator with default settings, including a crossover rate of 0.1 and scaling factor of 0.5.
    • DifferentialEvolutionVariation

      public DifferentialEvolutionVariation(double crossoverRate, double scalingFactor)
      Constructs a differential evolution operator with the specified crossover rate and scaling factor.
      Parameters:
      crossoverRate - the crossover rate
      scalingFactor - the scaling factor
  • 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
    • getCrossoverRate

      public double getCrossoverRate()
      Returns the crossover rate of this differential evolution operator.
      Returns:
      the crossover rate
    • setCrossoverRate

      public void setCrossoverRate(double crossoverRate)
      Sets the crossover rate of this differential evolution operator. The default value is 0.1.
      Parameters:
      crossoverRate - the crossover rate
    • getScalingFactor

      public double getScalingFactor()
      Returns the scaling factor of this differential evolution operator.
      Returns:
      the scaling factor
    • setScalingFactor

      public void setScalingFactor(double scalingFactor)
      Sets the scaling factor of this differential evolution operator. The default value is 0.5.
      Parameters:
      scalingFactor - the scaling factor
    • 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