Class CrossoverDoubleBLX

  • All Implemented Interfaces:
    org.opt4j.core.optimizer.Operator<org.opt4j.core.genotype.DoubleGenotype>, Crossover<org.opt4j.core.genotype.DoubleGenotype>

    public class CrossoverDoubleBLX
    extends CrossoverDoubleElementwise
    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 Detail

      • alpha

        protected final double alpha
    • Constructor Detail

      • CrossoverDoubleBLX

        @Inject
        public 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.
        Parameters:
        alpha - the alpha value
        normalize - the normalize operator
        random - the random number generator
    • Method Detail

      • crossover

        public Pair<java.lang.Double> crossover​(double x,
                                                double y)
        Description copied from class: CrossoverDoubleElementwise
        Performs a crossover with two double values.
        Specified by:
        crossover in class CrossoverDoubleElementwise
        Parameters:
        x - the first value
        y - 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 value
        hi - the bigger double value
        Returns:
        a random value in the interval