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>
public class CrossoverDoubleBLX extends CrossoverDoubleElementwise
TheCrossoverDoubleBLX
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
andx
(assumingy > x
one offspring value is created in the uniform interval[x-(y-x)*alpha;y+(y-x)*alpha]
.If
alpha
is set to0
, the operator creates a random solution betweenx
andy
. Values greater zero allow offspring that is apart from the interval betweenx
andy
. The authors report best performance withalpha = 0.5
which is then called the BLX-0.5 operator.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
alpha
-
Fields inherited from class org.opt4j.operator.crossover.CrossoverDouble
normalize, random
-
-
Constructor Summary
Constructors Constructor Description CrossoverDoubleBLX(double alpha, NormalizeDouble normalize, Rand random)
Constructs aCrossoverDoubleBLX
with an alpha value, anNormalizeDouble
operator, and a random number generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pair<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]
.-
Methods inherited from class org.opt4j.operator.crossover.CrossoverDoubleElementwise
crossover
-
Methods inherited from class org.opt4j.operator.crossover.CrossoverDouble
crossover
-
-
-
-
Constructor Detail
-
CrossoverDoubleBLX
@Inject public CrossoverDoubleBLX(double alpha, NormalizeDouble normalize, Rand random)
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 Detail
-
crossover
public Pair<Double> crossover(double x, double y)
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
-
-