desdeo_emo.selection.TournamentSelection

Module Contents

Classes

TournamentSelection

Tournament selection operator.

class desdeo_emo.selection.TournamentSelection.TournamentSelection(pop, tournament_size)[source]

Bases: desdeo_emo.selection.SelectionBase.SelectionBase

Tournament selection operator.

Parameters:
  • pop (Population) – The population of individuals

  • tournament_size (int) – Size of the tournament.

do(pop, fitness) List[int][source]

Performs tournament selections and returns the parents. :param pop: The current population. :type pop: Population

Returns:

List of indices of the selected individuals

Return type:

List[int]

_tour_select()[source]

Tournament selection. Choose number of individuals to participate and select the one with the best fitness.

Parameters:
  • fitness (array_like) – An array of each individual’s fitness.

  • tournament_size (int) – Number of participants in the tournament.

Returns:

The index of the best individual.

Return type:

int