Versions in this module Expand all Collapse all v0 v0.1.1 Jun 2, 2019 v0.1.0 May 31, 2019 Changes in this version + var ErrIllegalState = errors.New("illegal state") + var ErrTooManySeedCandidates = errors.New("Too many seed candidates for population size") + func EvaluatorFunc(natural bool, f FitnessFunc) evaluatorFunc + func GeneratePopulation(gen Generator, count int, rng *rand.Rand) []interface + func SeedPopulation(gen Generator, count int, seeds []interface{}, rng *rand.Rand) ([]interface{}, error) + type Condition interface + IsSatisfied func(pdata *PopulationStats) bool + type Dataset struct + func NewDataset(capacity int) *Dataset + func (ds *Dataset) AddValue(value float64) + func (ds *Dataset) AddValues(values ...float64) + func (ds *Dataset) ArithmeticMean() float64 + func (ds *Dataset) Clear() + func (ds *Dataset) GeometricMean() float64 + func (ds *Dataset) HarmonicMean() float64 + func (ds *Dataset) Len() int + func (ds *Dataset) Max() float64 + func (ds *Dataset) MeanDeviation() float64 + func (ds *Dataset) Median() float64 + func (ds *Dataset) Min() float64 + func (ds *Dataset) Product() float64 + func (ds *Dataset) SampleStandardDeviation() float64 + func (ds *Dataset) SampleVariance() float64 + func (ds *Dataset) StandardDeviation() float64 + func (ds *Dataset) Sum() float64 + func (ds *Dataset) Variance() float64 + type Epocher interface + Epoch func(Population, int, *rand.Rand) Population + type Evaluator interface + Fitness func(cand interface{}, pop []interface{}) float64 + IsNatural func() bool + type FitnessCache struct + Wrapped Evaluator + func (c *FitnessCache) Fitness(cand interface{}, pop []interface{}) float64 + func (c *FitnessCache) IsNatural() bool + type FitnessFunc func(interface{}, []interface{}) float64 + type Generator interface + Generate func(*rand.Rand) interface{} + type GeneratorFunc func(*rand.Rand) interface + func (f GeneratorFunc) Generate(rng *rand.Rand) interface{} + type Individual struct + Candidate interface{} + Fitness float64 + type Operator interface + Apply func([]interface{}, *rand.Rand) []interface{} + type Population []*Individual + func EvaluatePopulation(pop []interface{}, e Evaluator, concurrent bool) Population + func (s Population) Len() int + func (s Population) Less(i, j int) bool + func (s Population) String() string + func (s Population) Swap(i, j int) + type PopulationStats struct + BestCand interface{} + BestFitness float64 + Elapsed time.Duration + GenNumber int + Mean float64 + Natural bool + NumElites int + Size int + StdDev float64 + type Selection interface + Select func(pop Population, natural bool, size int, rng *rand.Rand) []interface{} + type ZeroEvaluator struct + func (ZeroEvaluator) Fitness(interface{}, []interface{}) float64 + func (ZeroEvaluator) IsNatural() bool