GeneticAlgorithmPython
GeneticAlgorithmPython copied to clipboard
Input argument num_parents in GA.stochastic_universal_selection() method
Line: pointers_distance = 1.0 / self.num_parents_mating # Distance between different pointers.
Should be: pointers_distance = 1.0 / num_parents # Distance between different pointers.
Actually, num_parents is set to self.num_parents_mating.
When the select_parents() method is called, the following is passed num_parents=self.num_parents_mating .
https://github.com/ahmedfgad/GeneticAlgorithmPython/blob/4ad007e0acae2005b29141022c63bb6a111d846f/pygad.py#L1213