Jido.Evolve.Selection.Tournament (Jido Evolve v1.0.0)

Copy Markdown View Source

Tournament selection strategy.

Selects entities by running tournaments between randomly chosen candidates and picking the winner based on fitness scores.

Summary

Functions

Default diversity maintenance that returns the selected population unchanged.

Select entities using tournament selection.

Functions

maintain_diversity(population, selected, opts)

Default diversity maintenance that returns the selected population unchanged.

select(population, scores, count, opts \\ [])

Select entities using tournament selection.

Options

  • :tournament_size - Number of entities in each tournament (default: 2)
  • :pressure - Selection pressure multiplier (default: 1.0)

Examples

population = ["a", "b", "c", "d"]
scores = %{"a" => 0.8, "b" => 0.6, "c" => 0.9, "d" => 0.3}
selected = Jido.Evolve.Selection.Tournament.select(population, scores, 2, tournament_size: 2)