pagmo2 icon indicating copy to clipboard operation
pagmo2 copied to clipboard

[Feature Change] Possible changes in Polynomial Mutation

Open jonpsy opened this issue 3 years ago • 1 comments

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!

jonpsy avatar Mar 24 '21 07:03 jonpsy

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

MLopez-Ibanez avatar Dec 21 '21 13:12 MLopez-Ibanez