Class CrossoverDoubleUnfairAverage

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

    public class CrossoverDoubleUnfairAverage
    extends CrossoverDouble
    The CrossoverDoubleUnfairAverage implements the unfair average crossover proposed by Nomura and Miyhoshi, 1996.

    The unfair average crossover is applied to the whole genotype, i.e., the used vector of double values. In the original work, two offspring created using

    z_1 = (1 + alpha)x - alpha * y for i = 1, ..., j and
    z_1 = -alpha * x + (1 + alpha)y for i = j + 1, ..., n
    z_2 = (1 - alpha)x + alpha * y for i = 1, ..., j and
    z_2 = alpha * x + (1 - alpha)y for i = j + 1, ..., n

    for each double value in the double vector. In this implementation, one offspring is created following z_1 with a probability of 0.5 and following z_2 with a probability of 0.5, respectively. At this juncture, n is the number of variables in the vector and j a randomly chosen integer between 1 and n. The value alpha is within the range (0, 0.5).

    Unlike the BLX and SBX operator, the unfair average will create offspring towards one of the parent solutions.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void crossover​(java.util.List<java.lang.Double> p1, java.util.List<java.lang.Double> p2, java.util.List<java.lang.Double> o1, java.util.List<java.lang.Double> o2)
      Performs a crossover of two parent Genotypes that consist of double vectors.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • alpha

        protected final double alpha
    • Constructor Detail

      • CrossoverDoubleUnfairAverage

        @Inject
        public CrossoverDoubleUnfairAverage​(double alpha,
                                            NormalizeDouble normalize,
                                            org.opt4j.core.common.random.Rand random)
        Constructs an CrossoverDoubleUnfairAverage with an alpha value and a random number generator.
        Parameters:
        alpha - the alpha value
        normalize - a normalize operator
        random - the random number generator
    • Method Detail

      • crossover

        protected void crossover​(java.util.List<java.lang.Double> p1,
                                 java.util.List<java.lang.Double> p2,
                                 java.util.List<java.lang.Double> o1,
                                 java.util.List<java.lang.Double> o2)
        Description copied from class: CrossoverDouble
        Performs a crossover of two parent Genotypes that consist of double vectors.
        Specified by:
        crossover in class CrossoverDouble
        Parameters:
        p1 - the first parent
        p2 - the second parent
        o1 - the first offspring
        o2 - the second offspring