thieu1995 / mealpy

A Collection Of The State-of-the-art Metaheuristic Algorithms In Python (Metaheuristic/Optimizer/Nature-inspired/Biology)
https://mealpy.readthedocs.io
GNU General Public License v3.0
871 stars 177 forks source link

Roulette: Fix how negatives fitness are handled #140

Closed lucianolorenti closed 7 months ago

lucianolorenti commented 7 months ago

Closes #139

📑 Description

When handling negative values in optmizer.get_index_roulette_wheel_selection, probably due to a typo, the boolean value is being compared to be less than zero np.any(list_fitness) < 0, instead of np.any(list_fitness < 0)

✅ Checks

thieu1995 commented 7 months ago

@lucianolorenti, Thank you for pointing out and fixing it.