jMetal / jMetalPy

A framework for single/multi-objective optimization with metaheuristics
https://jmetal.github.io/jMetalPy/index.html
MIT License
497 stars 150 forks source link

Fix bug in genetic_algorithm.py in line#82 about 'mating_pool_size'. #139

Closed Amgroot-w closed 1 year ago

Amgroot-w commented 2 years ago

In GeneticAlgorithm.reproduction(), the upper bound of the 'for' loop should be euqal to 'self.mating_pool_size', instead of 'self.offspring_population_size'. The code works well by far because the parents number and the children number are equal in the crossover operator, but once they are not equal, the size of the corresponding offspring population will be wrong.