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 aChromosome
ofNumericGene
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
Constructors Constructor Description SimulatedBinaryCrossover(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
contiguity()
Return the contiguity value of the crossover.protected int
crossover(MSeq<G> that, MSeq<G> other)
String
toString()
-
Methods inherited from class io.jenetics.Recombinator
alter, order
-
Methods inherited from class io.jenetics.AbstractAlterer
probability
-
-
-
-
Constructor Detail
-
SimulatedBinaryCrossover
public SimulatedBinaryCrossover(double probability, double contiguity)
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
public SimulatedBinaryCrossover(double probability)
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 Detail
-
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)
- Specified by:
crossover
in classCrossover<G extends NumericGene<?,G>,C extends Comparable<? super C>>
-
-