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.
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.