Pyevolve
Pyevolve copied to clipboard
Using random.sample() in TournamentSelectorAlternative
You might consider providing an option for using random.sample() to choose candidates for tournament selection. In my experience it's much faster, plus it won't pick duplicate candidates.
The code would look like: tournament_pool = random.sample(population, pool_size)