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
TheCrossoverDoubleBLXis an implementation of the blend crossover operator proposed by Eshelman and Schaffer, 1993.The BLX crossover is applied element-wise. For two double values
yandx(assumingy > xone offspring value is created in the uniform interval[x-(y-x)*alpha;y+(y-x)*alpha].If
alphais set to0, the operator creates a random solution betweenxandy. Values greater zero allow offspring that is apart from the interval betweenxandy. The authors report best performance withalpha = 0.5which is then called the BLX-0.5 operator.
-
-
Field Summary
Fields Modifier and Type Field Description protected doublealpha-
Fields inherited from class org.opt4j.operator.crossover.CrossoverDouble
normalize, random
-
-
Constructor Summary
Constructors Constructor Description CrossoverDoubleBLX(double alpha, NormalizeDouble normalize, Rand random)Constructs aCrossoverDoubleBLXwith an alpha value, anNormalizeDoubleoperator, 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 doublenext(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 aCrossoverDoubleBLXwith an alpha value, anNormalizeDoubleoperator, 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:CrossoverDoubleElementwisePerforms a crossover with two double values.- Specified by:
crossoverin 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
-
-