Documentation
¶
Overview ¶
Package hillclimber provides an implementation of the Population interface that maintains two agents and selects the best of the two for the next generation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Population ¶
type Population[T any] struct { A *goevo.Agent[T] B *goevo.Agent[T] Selection goevo.SelectionStrategy[T] Reproduction goevo.ReproductionStrategy[T] }
func NewPopulation ¶
func NewPopulation[T any](initialA, initialB T, selection goevo.SelectionStrategy[T], reproduction goevo.ReproductionStrategy[T]) *Population[T]
func (*Population[T]) All ¶
func (p *Population[T]) All() []*goevo.Agent[T]
func (*Population[T]) NextGeneration ¶
func (p *Population[T]) NextGeneration() goevo.Population[T]
Click to show internal directories.
Click to hide internal directories.