GeneticAlgorithmPython icon indicating copy to clipboard operation
GeneticAlgorithmPython copied to clipboard

Input argument num_parents in GA.stochastic_universal_selection() method

Open PablitoE opened this issue 3 years ago • 1 comments

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.

PablitoE avatar Jan 14 '22 09:01 PablitoE

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

ahmedfgad avatar Jan 31 '22 04:01 ahmedfgad