Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandType ¶
type CommandType int
CommandType defines the type of evolution command
const ( CmdStartGeneration CommandType = iota CmdStop )
type EvolutionCommand ¶
type EvolutionCommand struct {
Type CommandType
Generation int
CrossoverPoints int
CrossoverRate float64
MutationRate float64
ElitismPct float64
}
EvolutionCommand represents commands sent to the evolution engine
type EvolutionEngine ¶
type EvolutionEngine struct {
// contains filtered or unexported fields
}
EvolutionEngine manages the evolution process using channels
func NewEvolutionEngine ¶
func NewEvolutionEngine( population population.Population, selector selection.Selector, metricsChan chan<- metrics.GenerationMetrics, cmdChan <-chan EvolutionCommand, fitnessCalculator fitness.FitnessCalculator, crossoverInformation individual.CrossoverInformation, mutateInformation individual.MutateInformation, logger *zap.Logger, ) *EvolutionEngine
NewEvolutionEngine creates a new evolution engine
func (*EvolutionEngine) GetPopulation ¶
func (ee *EvolutionEngine) GetPopulation() []individual.Evolvable
GetPopulation returns the current population
func (*EvolutionEngine) Start ¶
func (ee *EvolutionEngine) Start(ctx context.Context)
Start begins processing evolution commands
func (*EvolutionEngine) Wait ¶
func (ee *EvolutionEngine) Wait()
Wait blocks until the engine is done
Click to show internal directories.
Click to hide internal directories.