hillclimber

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: 1 Imported by: 0

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]

Jump to

Keyboard shortcuts

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