Module io.jenetics.ext
Package io.jenetics.ext
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
NumericGene
s 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
-
Field Summary
Fields inherited from class io.jenetics.AbstractAlterer
_probability
Fields inherited from interface io.jenetics.Alterer
DEFAULT_ALTER_PROBABILITY
-
Constructor Summary
ConstructorDescriptionSimulatedBinaryCrossover
(double probability) Create a new simulated binary crossover alterer with the given parameters.SimulatedBinaryCrossover
(double probability, double contiguity) Create a new simulated binary crossover alterer with the given parameters. -
Method Summary
Methods inherited from class io.jenetics.Recombinator
alter, order
Methods inherited from class io.jenetics.AbstractAlterer
probability
-
Constructor Details
-
SimulatedBinaryCrossover
Create a new simulated binary crossover alterer with the given parameters.- Parameters:
probability
- the recombination probabilitycontiguity
- 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 theprobability
is not in the valid range of[0, 1]
IllegalArgumentException
- ifcontiguity
is smaller than zero
-
SimulatedBinaryCrossover
Create a new simulated binary crossover alterer with the given parameters. The contiguity value is set to2.5
.- Parameters:
probability
- the recombination probability- Throws:
IllegalArgumentException
- if theprobability
is not in the valid range of[0, 1]
IllegalArgumentException
- ifcontiguity
is smaller than zero
-
-
Method Details
-
contiguity
Return the contiguity value of the crossover.- Returns:
- the contiguity value of the crossover
-
crossover
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 classCrossover<G extends NumericGene<?,
G>, C extends Comparable<? super C>> - Parameters:
that
- the genes of the first chromosomeother
- the genes of the other chromosome- Returns:
- the number of altered genes
-
toString
-