tournament

package module
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package tournament provides an implementation of the Selection interface that selects the best agent from a random tournament of n agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Selection

type Selection[T any] struct {
	// The number of agents to include in each tournament.
	TournamentSize int
	// contains filtered or unexported fields
}

Selection is a selection strategy that selects the best agent from a random tournament of agents. It implements Selection.

func (*Selection[T]) Select

func (t *Selection[T]) Select() *goevo.Agent[T]

Select returns an agent selected from the population using a tournament.

func (*Selection[T]) SetAgents

func (t *Selection[T]) SetAgents(agents []*goevo.Agent[T])

SetAgents sets the agents to select from for this generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL