Class SBX
java.lang.Object
org.moeaframework.core.operator.real.SBX
- All Implemented Interfaces:
Configurable
,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.
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:
- 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
ConstructorDescriptionSBX()
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 TypeMethodDescriptionSolution[]
Evolves one or more parent solutions (specified bygetArity
) 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
getArity()
Returns the number of solutions that must be supplied to theevolve
method.double
Returns the distribution index of this SBX operator.getName()
Returns the name of this variation operator.double
Returns the probability of applying this SBX operator to each variable.boolean
isSwap()
Returnstrue
if this SBX operator swaps variables between the two parents.boolean
Returnstrue
if the offspring are distributed symmetrically; orfalse
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 of1.0
and a distribution index of15.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 variabledistributionIndex
- 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. Setswap
totrue
to recreate the traditional SBX operation; and tofalse
to use the SBX variant used by NSGA-III.- Parameters:
probability
- the probability of applying this SBX operator to each variabledistributionIndex
- the distribution index of this SBX operatorswap
- iftrue
, randomly swap the variables between the two parentssymmetric
- iftrue
, symmetric distributions are used
-
-
Method Details
-
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. -
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()Returnstrue
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()Returnstrue
if the offspring are distributed symmetrically; orfalse
if asymmetric distributions are used.- Returns:
true
if the offspring are distributed symmetrically; orfalse
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; orfalse
if asymmetric distributions are used
-
getArity
public int getArity()Description copied from interface:Variation
Returns the number of solutions that must be supplied to theevolve
method. -
evolve
Description copied from interface:Variation
Evolves one or more parent solutions (specified bygetArity
) 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. -
evolve_symmetric
Evolves the specified variables using the SBX operator using symmetric distributions.- Parameters:
v1
- the first variablev2
- the second variabledistributionIndex
- the distribution index of this SBX operator
-
evolve_asymmetric
Evolves the specified variables using the SBX operator using asymmetric distributions.- Parameters:
v1
- the first variablev2
- the second variabledistributionIndex
- the distribution index of this SBX operator
-