Package org.opt4j.operator.crossover
Class CrossoverDoubleBLX
java.lang.Object
org.opt4j.operator.crossover.CrossoverDouble
org.opt4j.operator.crossover.CrossoverDoubleElementwise
org.opt4j.operator.crossover.CrossoverDoubleBLX
- All Implemented Interfaces:
Operator<DoubleGenotype>
,Crossover<DoubleGenotype>
The
CrossoverDoubleBLX
is an implementation of the blend crossover
operator proposed by Eshelman and Schaffer, 1993.
The BLX crossover is applied element-wise. For two double values y
and x
(assuming y > x
one offspring value is created in the
uniform interval [x-(y-x)*alpha;y+(y-x)*alpha]
.
If alpha
is set to 0
, the operator creates a random solution
between x
and y
. Values greater zero allow offspring that is
apart from the interval between x
and y
. The authors report
best performance with alpha = 0.5
which is then called the BLX-0.5
operator.
-
Field Summary
Fields inherited from class org.opt4j.operator.crossover.CrossoverDouble
normalize, random
-
Constructor Summary
ConstructorDescriptionCrossoverDoubleBLX
(double alpha, NormalizeDouble normalize, Rand random) Constructs aCrossoverDoubleBLX
with an alpha value, anNormalizeDouble
operator, and a random number generator. -
Method Summary
Methods inherited from class org.opt4j.operator.crossover.CrossoverDoubleElementwise
crossover
Methods inherited from class org.opt4j.operator.crossover.CrossoverDouble
crossover
-
Field Details
-
alpha
protected final double alpha
-
-
Constructor Details
-
CrossoverDoubleBLX
Constructs aCrossoverDoubleBLX
with an alpha value, anNormalizeDouble
operator, and a random number generator.- Parameters:
alpha
- the alpha valuenormalize
- the normalize operatorrandom
- the random number generator
-
-
Method Details
-
crossover
Description copied from class:CrossoverDoubleElementwise
Performs a crossover with two double values.- Specified by:
crossover
in classCrossoverDoubleElementwise
- Parameters:
x
- the first valuey
- the second value- Returns:
- the resulting values
-
next
protected double next(double lo, double hi) Calculates a random value in the interval[lo-(hi-lo)*alpha;hi+(hi-lo)*alpha]
.- Parameters:
lo
- the smaller double valuehi
- the bigger double value- Returns:
- a random value in the interval
-