Skip to content

[Possible Bug] GTournamentSelector #67

Description

@cristianocca

Looking at the code of GTournamentSelector, it seems like it is not considering if maximizing or minimizing when selecting from the candidates.

if population.sortType == Consts.sortType["scaled"]:
choosen = max(tournament_pool, key=key_fitness_score)
else:
choosen = max(tournament_pool, key=key_raw_score)

Since in GASimpleGA.py to use elitism it considers the min/max param, it seems like this one should do it as well and use min instead if minimizing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions