Open Peipi98 opened 1 year ago
Hi :) Thank you for your review. I fixed the internal if to N_MAX_ITERATIONS*negation_rate and now it works faster, however it still returns the same results (see below). I implemented the fitness as you suggested (and also changed the code accordingly from a maximization to a minimization problem) as follows: Here I report some statistics of your version (in green) and mine (yellow) and they are pretty similar.
Thank you again :)
Pros and Observations
ALL_LISTS
' indexes rather than a tuple of tuples as in my case, which is more efficient and less memory consuming than my solution;In the internal
if
there is a condition in which themutation_rate
is 0.5 andnumber_iteration
is minor thanN_MAX_ITERATIONS
, so your condition will always be true sincenumber_iteration
will always be less than the double of hisN_MAX_ITERATIONS
(I've checked with a print inside the else, and it never prints out).Suggestions
(number_of_covered_elements, -weigth)
inside thefitness_function
, I strongly suggest you to use only the weight and setting a control on the covered elements in order to give a strong penalty to the individuals which haven't already reached the set covering (check my code to have an example).