Versions in this module Expand all Collapse all v1 v1.0.0 Jun 24, 2026 Changes in this version + type Config struct + ConcurrencyLevel int + CrossoverFunc CrossoverFunc[T] + CrossoverRate float64 + ElitismCount int + FitnessFunc FitnessFunc[T] + Generations int + InitFunc InitFunc[T] + MutationFunc MutationFunc[T] + MutationRate float64 + OnGeneration func(generation int, best T, bestFitness float64, avgFitness float64) + PopulationSize int + Seed *[32]byte + SelectionFunc SelectionFunc[T] + type CrossoverFunc func(rng *rand.Rand, p1, p2 T) (T, T) + type Engine struct + func New[T any](cfg Config[T]) (*Engine[T], error) + func (e *Engine[T]) EvaluatePopulation(pop []T) []float64 + func (e *Engine[T]) Evolve() (best T, bestFitness float64) + type FitnessFunc func(individual T) float64 + type InitFunc func(rng *rand.Rand) T + type MutationFunc func(rng *rand.Rand, individual T, rate float64) T + type SelectionFunc func(rng *rand.Rand, population []T, fitnesses []float64, num int) []T