public class CrossoverDoubleBLX extends CrossoverDoubleElementwise
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.
Modifier and Type | Field and Description |
---|---|
protected double |
alpha |
normalize, random
Constructor and Description |
---|
CrossoverDoubleBLX(double alpha,
NormalizeDouble normalize,
org.opt4j.core.common.random.Rand random)
Constructs a
CrossoverDoubleBLX with an alpha value, an
NormalizeDouble operator, and a random number generator. |
Modifier and Type | Method and Description |
---|---|
Pair<java.lang.Double> |
crossover(double x,
double y)
Performs a crossover with two double values.
|
protected double |
next(double lo,
double hi)
Calculates a random value in the interval
[lo-(hi-lo)*alpha;hi+(hi-lo)*alpha] . |
crossover
crossover
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOperatorType
@Inject public CrossoverDoubleBLX(double alpha, NormalizeDouble normalize, org.opt4j.core.common.random.Rand random)
CrossoverDoubleBLX
with an alpha value, an
NormalizeDouble
operator, and a random number generator.alpha
- the alpha valuenormalize
- the normalize operatorrandom
- the random number generatorpublic Pair<java.lang.Double> crossover(double x, double y)
CrossoverDoubleElementwise
crossover
in class CrossoverDoubleElementwise
x
- the first valuey
- the second valueprotected double next(double lo, double hi)
[lo-(hi-lo)*alpha;hi+(hi-lo)*alpha]
.lo
- the smaller double valuehi
- the bigger double value