Skip to content

Commit

Permalink
Hoftix tournament selection (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
MorrisNein committed Oct 24, 2022
1 parent 81e46c6 commit 91c5ecf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fedot/core/optimisers/gp_comp/operators/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def tournament_selection(individuals: PopulationT, pop_size: int, fraction: floa
for _ in range(iterations_limit):
if len(chosen) >= pop_size:
break
group = sample(individuals, group_size)
group = sample(individuals, min(group_size, len(individuals)))
best = max(group, key=lambda ind: ind.fitness)
individuals.remove(best)
chosen.append(best)
Expand Down

0 comments on commit 91c5ecf

Please sign in to comment.