GeneticAlgorithmPython
GeneticAlgorithmPython copied to clipboard
Return value of pygad.GA.tournament_selection misleading
The parent_indices returned by pygad.GA.tournament_selection are actually the best indices selected from the K rand_indices. Within this method parents_indices are updated as followed:
parents_indices.append(selected_parent_idx)
where I believe it should be changed to:
parents_indices.append(rand_indices[selected_parent_idx])
Yes, you are right. There was an issue returning the indices of the selected parents. But still the correct parents are returned because rand_indices[selected_parent_idx] is correctly used to return the selected parents in the last line of the for loop.