selection

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouletteSelector

type RouletteSelector struct {
	SampleSize int
}

RouletteSelector implements roulette wheel selection

func NewRouletteSelector

func NewRouletteSelector(sampleSize int) *RouletteSelector

NewRouletteSelector creates a new roulette selector

func (*RouletteSelector) Select

func (rs *RouletteSelector) Select(population []individual.Evolvable) individual.Evolvable

Select performs roulette wheel selection

type Selector

type Selector interface {
	Select(population []individual.Evolvable) individual.Evolvable
}

Selector defines the interface for selection strategies

type TournamentSelector

type TournamentSelector struct {
	TournamentSize int
}

TournamentSelector implements tournament selection

func NewTournamentSelector

func NewTournamentSelector(tournamentSize int) *TournamentSelector

NewTournamentSelector creates a new tournament selector

func (*TournamentSelector) Select

func (ts *TournamentSelector) Select(population []individual.Evolvable) individual.Evolvable

Select performs tournament selection

Jump to

Keyboard shortcuts

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