Class CrossoverDoubleUnfairAverage
- java.lang.Object
-
- org.opt4j.operator.crossover.CrossoverDouble
-
- org.opt4j.operator.crossover.CrossoverDoubleUnfairAverage
-
- All Implemented Interfaces:
Operator<DoubleGenotype>,Crossover<DoubleGenotype>
public class CrossoverDoubleUnfairAverage extends CrossoverDouble
TheCrossoverDoubleUnfairAverageimplements 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 * yfori = 1, ..., jand
z_1 = -alpha * x + (1 + alpha)yfori = j + 1, ..., n
z_2 = (1 - alpha)x + alpha * yfori = 1, ..., jand
z_2 = alpha * x + (1 - alpha)yfori = j + 1, ..., nfor each double value in the double vector. In this implementation, one offspring is created following
z_1with a probability of0.5and followingz_2with a probability of0.5, respectively. At this juncture,nis the number of variables in the vector andja randomly chosen integer between1andn. The valuealphais within the range (0, 0.5).Unlike the BLX and SBX operator, the unfair average will create offspring towards one of the parent solutions.
-
-
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 CrossoverDoubleUnfairAverage(double alpha, NormalizeDouble normalize, Rand random)Constructs anCrossoverDoubleUnfairAveragewith an alpha value and a random number generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcrossover(List<Double> p1, List<Double> p2, List<Double> o1, List<Double> o2)Performs a crossover of two parentGenotypes that consist of double vectors.-
Methods inherited from class org.opt4j.operator.crossover.CrossoverDouble
crossover
-
-
-
-
Constructor Detail
-
CrossoverDoubleUnfairAverage
@Inject public CrossoverDoubleUnfairAverage(double alpha, NormalizeDouble normalize, Rand random)Constructs anCrossoverDoubleUnfairAveragewith an alpha value and a random number generator.- Parameters:
alpha- the alpha valuenormalize- a normalize operatorrandom- the random number generator
-
-
Method Detail
-
crossover
protected void crossover(List<Double> p1, List<Double> p2, List<Double> o1, List<Double> o2)
Description copied from class:CrossoverDoublePerforms a crossover of two parentGenotypes that consist of double vectors.- Specified by:
crossoverin classCrossoverDouble- Parameters:
p1- the first parentp2- the second parento1- the first offspringo2- the second offspring
-
-