esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
808 stars 160 forks source link

[Feature Change] Possible changes in Polynomial Mutation #470

Open jonpsy opened 3 years ago

jonpsy commented 3 years ago

In the polynomial mutation code, we have (Notice the comment in the code)

void polynomial_mutation_impl(vector& child .....)
{

for(....){
            y = child[j];
            yl = lb[j];
            yu = ub[j];
            delta1 = (y - yl) / (yu - yl); //Normalised distance from lower bound.
            delta2 = (yu - y) / (yu - yl); //Normalised distance from upper bound.
         if( rnd < 0.5)
                xy = 1. - delta1;   //Possibly naive
               ....................
}
}

The problem I find is when we do xy = 1. - delta1, is unnecesary because 1. - delta1 is equivalent to delta2. Simple proof:

delta1 + delta2 = ( (y - yl) + (yu - y) ) / (yu - yl) 
=> (yu - yl)/(yu - yl)
=>delta1 + delta 2 = 1
=> delta2 = 1 - delta1

@darioizzo If I've missed something, let me know, cheers!

MLopez-Ibanez commented 2 years ago

@jonpsy It seems to me that you are right. You can probably remove delta1 completely. Maybe send a pull request?