Documentation
¶
Index ¶
- type FitnessFunc
- type Genome
- type Population
- type Randomizer
- type Report
- type ReporterFunc
- type Species
- func (e *Species[T]) CrossOver(random Randomizer, a, b *Genome[T]) *Genome[T]
- func (e *Species[T]) Mutate(random Randomizer, genome *Genome[T])
- func (e *Species[T]) NextPopulation(random Randomizer, pop Population[T]) Population[T]
- func (s *Species[T]) RandomGenome(random Randomizer) *Genome[T]
- func (e *Species[T]) RandomPopulation(random Randomizer) Population[T]
- func (e *Species[T]) Selection(random Randomizer, population Population[T]) []*Genome[T]
- func (e *Species[T]) SinglePointCrossOver(random Randomizer, parentA, parentB *Genome[T]) *Genome[T]
- func (e *Species[T]) Solve(ctx context.Context, random Randomizer, speciesNumber int, ...)
- func (e *Species[T]) UniformCrossOver(random Randomizer, parentA, parentB *Genome[T]) *Genome[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FitnessFunc ¶
type Genome ¶
func (*Genome[T]) SetFitness ¶
func (genome *Genome[T]) SetFitness(f FitnessFunc[T])
type Population ¶
func (*Population[T]) SetFitness ¶
func (p *Population[T]) SetFitness(f FitnessFunc[T])
type Randomizer ¶
type ReporterFunc ¶
type Species ¶
type Species[T any] struct { ValidGenes []T Fitness FitnessFunc[T] PopulationSize int GenomeSize int MutationRate float64 SingleCrossOverRate float64 }
func (*Species[T]) CrossOver ¶
func (e *Species[T]) CrossOver(random Randomizer, a, b *Genome[T]) *Genome[T]
func (*Species[T]) Mutate ¶
func (e *Species[T]) Mutate(random Randomizer, genome *Genome[T])
func (*Species[T]) NextPopulation ¶
func (e *Species[T]) NextPopulation(random Randomizer, pop Population[T]) Population[T]
func (*Species[T]) RandomGenome ¶
func (s *Species[T]) RandomGenome(random Randomizer) *Genome[T]
func (*Species[T]) RandomPopulation ¶
func (e *Species[T]) RandomPopulation(random Randomizer) Population[T]
func (*Species[T]) Selection ¶
func (e *Species[T]) Selection(random Randomizer, population Population[T]) []*Genome[T]
func (*Species[T]) SinglePointCrossOver ¶
func (e *Species[T]) SinglePointCrossOver(random Randomizer, parentA, parentB *Genome[T]) *Genome[T]
func (*Species[T]) Solve ¶
func (e *Species[T]) Solve(ctx context.Context, random Randomizer, speciesNumber int, reporter ReporterFunc[T])
func (*Species[T]) UniformCrossOver ¶
func (e *Species[T]) UniformCrossOver(random Randomizer, parentA, parentB *Genome[T]) *Genome[T]
Click to show internal directories.
Click to hide internal directories.