I want to use a mu + lambda algorithm to a multiobjective optimization, with contradictory objectives.
I tried it with a basic example. Each individual has 5 attributes, all of them are floats randomly chosen between 0.1 and 1 at the beginning.
The number of generations is 800 and mu = lambda = 1000.
I create my fitness function like that : "creator.create("Fitness", base.Fitness, weights=(1.0, -1.0))"
If the definition of the evaluation function is :
def funcs_obj (individual):
sum1 = sum((individual[0], individual[1], individual[2]))
sum2 = sum((individual[3], individual[4]))
return sum1, sum2
The results are logical, all the individuals of the last population have those attributes :
[0.99778040518554, 0.9916939853173194, 0.9858341534536241, 0.0, 0.0]
So the sum of the 3 first attribues is maximised, and the sum of the last 2 ones is minimized.
Now, if :
sum1 = sum(individual)
sum2 = sum((individual[3], individual[4]))
This time all the individuals of the last population have those attributes :
[0.9894994476920232, 0.9758085001565546, 0.9947429983760391, 0.9887476300324795, 1.0]
I expected the values of the last 2 attributes to be around 0.5, since the first objective is to maximize it and the second to minimize it.
As you can see the algorithm prioritize the first objective and maximize all the attributes.
And if :
sum1 = sum((individual[3], individual[4]))
sum2 = sum(individual)
I obtain : [0.0, 0.0, 0.0, 0.9976277774304089, 1.0]. That means, again, that the first objective is prioritized (the last 2 attributes are maximized) and not
Is there something special to precise to take into account contradictory objectives simultaneously, without prioritizing one ?
The whole code is
here...
Thanks in advance !
Clément