Selection Operations

Selection Operations#

Summary#

|

tournament(p1, p2, f1, f2[, tour_size, ...])

Selects from (p1 + p2, f1 + f2) to generate a new population.

Methods#

|

tournament(p1, p2, f1, f2, tour_size=3, len_limit=100, best_keep=True)[source]#

Selects from (p1 + p2, f1 + f2) to generate a new population.

Parameters:
  • p1 (list-like object) – Population_1

  • p2 (list-like object) – Population_2

  • f1 (like-like object or Hyper.tensor) – The fitness corresponding to the p1

  • f2 (like-like object or Hyper.tensor) – The fitness corresponding to the p2

  • tour_size (int)

  • len_limit – The length limit to each individual, the individual with len > len_limit will be directly given up.

  • best_keep (bool) – Whether keep the best individual.

Returns:

[population, population(copy), fitness, fitness(copy)]

Return type:

A list-like object