Versions in this module Expand all Collapse all v0 v0.1.0 Jul 27, 2017 Changes in this version + func CrossCX(p1, p2 Slice) (Slice, Slice) + func CrossCXFloat64(s1 []float64, s2 []float64) ([]float64, []float64) + func CrossCXInt(s1 []int, s2 []int) ([]int, []int) + func CrossCXString(s1 []string, s2 []string) ([]string, []string) + func CrossERX(p1, p2 Slice) (Slice, Slice) + func CrossERXFloat64(s1 []float64, s2 []float64) ([]float64, []float64) + func CrossERXInt(s1 []int, s2 []int) ([]int, []int) + func CrossERXString(s1 []string, s2 []string) ([]string, []string) + func CrossGNX(p1 Slice, p2 Slice, n int, rng *rand.Rand) (o1 Slice, o2 Slice) + func CrossGNXFloat64(s1 []float64, s2 []float64, n int, rng *rand.Rand) ([]float64, []float64) + func CrossGNXInt(s1 []int, s2 []int, n int, rng *rand.Rand) ([]int, []int) + func CrossGNXString(s1 []string, s2 []string, n int, rng *rand.Rand) ([]string, []string) + func CrossOX(p1 Slice, p2 Slice, rng *rand.Rand) (o1 Slice, o2 Slice) + func CrossOXFloat64(s1 []float64, s2 []float64, rng *rand.Rand) ([]float64, []float64) + func CrossOXInt(s1 []int, s2 []int, rng *rand.Rand) ([]int, []int) + func CrossOXString(s1 []string, s2 []string, rng *rand.Rand) ([]string, []string) + func CrossPMX(p1 Slice, p2 Slice, rng *rand.Rand) (o1 Slice, o2 Slice) + func CrossPMXFloat64(s1 []float64, s2 []float64, rng *rand.Rand) ([]float64, []float64) + func CrossPMXInt(s1 []int, s2 []int, rng *rand.Rand) ([]int, []int) + func CrossPMXString(s1 []string, s2 []string, rng *rand.Rand) ([]string, []string) + func CrossUniformFloat64(p1 []float64, p2 []float64, rng *rand.Rand) (o1 []float64, o2 []float64) + func InitJaggFloat64(n int, lower, upper []float64, rng *rand.Rand) (floats []float64) + func InitNormFloat64(n int, mean, std float64, rng *rand.Rand) (floats []float64) + func InitUnifFloat64(n int, lower, upper float64, rng *rand.Rand) (floats []float64) + func InitUnifString(n int, corpus []string, rng *rand.Rand) (strings []string) + func InitUniqueString(n int, corpus []string, rng *rand.Rand) (strings []string) + func MutNormalFloat64(genome []float64, rate float64, rng *rand.Rand) + func MutPermute(genome Slice, n int, rng *rand.Rand) + func MutPermuteFloat64(s []float64, n int, rng *rand.Rand) + func MutPermuteInt(s []int, n int, rng *rand.Rand) + func MutPermuteString(s []string, n int, rng *rand.Rand) + func MutSplice(genome Slice, rng *rand.Rand) + func MutSpliceFloat64(s []float64, rng *rand.Rand) + func MutSpliceInt(s []int, rng *rand.Rand) + func MutSpliceString(s []string, rng *rand.Rand) + func MutUniformString(genome []string, corpus []string, n int, rng *rand.Rand) + type DistanceMemoizer struct + Distances map[string]map[string]float64 + Metric Metric + func (dm *DistanceMemoizer) GetDistance(a, b Individual) float64 + type Float64Slice []float64 + func (s Float64Slice) Append(t Slice) Slice + func (s Float64Slice) At(i int) interface{} + func (s Float64Slice) Copy() Slice + func (s Float64Slice) Len() int + func (s Float64Slice) Replace(t Slice) + func (s Float64Slice) Set(i int, v interface{}) + func (s Float64Slice) Slice(a, b int) Slice + func (s Float64Slice) Split(k int) (Slice, Slice) + func (s Float64Slice) Swap(i, j int) + type GA struct + Age time.Duration + Best Individual + Callback func(ga *GA) + Generations int + GenomeFactory GenomeFactory + Logger *log.Logger + MigFrequency int + Migrator Migrator + Model Model + NPops int + PopSize int + Populations Populations + Speciator Speciator + func Generational(GenomeFactory GenomeFactory) GA + func HillClimbing(GenomeFactory GenomeFactory) GA + func SimulatedAnnealing(GenomeFactory GenomeFactory) GA + func (ga *GA) Enhance() error + func (ga *GA) Initialize() + func (ga GA) Validate() error + type Genome interface + Clone func() Genome + Crossover func(genome Genome, rng *rand.Rand) (Genome, Genome) + Evaluate func() float64 + Mutate func(rng *rand.Rand) + type GenomeFactory func(rng *rand.Rand) Genome + type Individual struct + Evaluated bool + Fitness float64 + Genome Genome + ID string + func NewIndividual(genome Genome, rng *rand.Rand) Individual + func (indi *Individual) Evaluate() + func (indi *Individual) GetFitness() float64 + func (indi *Individual) Mutate(rng *rand.Rand) + func (indi Individual) Clone(rng *rand.Rand) Individual + func (indi Individual) Crossover(mate Individual, rng *rand.Rand) (Individual, Individual) + func (indi Individual) IdxOfClosest(indis Individuals, dm DistanceMemoizer) (i int) + type Individuals []Individual + func (indis Individuals) Clone(rng *rand.Rand) Individuals + func (indis Individuals) Evaluate() + func (indis Individuals) FitAvg() float64 + func (indis Individuals) FitMax() float64 + func (indis Individuals) FitMin() float64 + func (indis Individuals) FitStd() float64 + func (indis Individuals) IsSortedByFitness() bool + func (indis Individuals) Mutate(mutRate float64, rng *rand.Rand) + func (indis Individuals) SortByDistanceToMedoid(dm DistanceMemoizer) + func (indis Individuals) SortByFitness() + type IntSlice []int + func (s IntSlice) Append(t Slice) Slice + func (s IntSlice) At(i int) interface{} + func (s IntSlice) Copy() Slice + func (s IntSlice) Len() int + func (s IntSlice) Replace(t Slice) + func (s IntSlice) Set(i int, v interface{}) + func (s IntSlice) Slice(a, b int) Slice + func (s IntSlice) Split(k int) (Slice, Slice) + func (s IntSlice) Swap(i, j int) + type Metric func(a, b Individual) float64 + type MigRing struct + NMigrants int + func (mig MigRing) Apply(pops Populations, rng *rand.Rand) + func (mig MigRing) Validate() error + type Migrator interface + Apply func(pops Populations, rng *rand.Rand) + Validate func() error + type ModDownToSize struct + MutRate float64 + NOffsprings int + SelectorA Selector + SelectorB Selector + func (mod ModDownToSize) Apply(pop *Population) error + func (mod ModDownToSize) Validate() error + type ModGenerational struct + MutRate float64 + Selector Selector + func (mod ModGenerational) Apply(pop *Population) error + func (mod ModGenerational) Validate() error + type ModMutationOnly struct + NChosen int + Selector Selector + Strict bool + func (mod ModMutationOnly) Apply(pop *Population) error + func (mod ModMutationOnly) Validate() error + type ModRing struct + MutRate float64 + Selector Selector + func (mod ModRing) Apply(pop *Population) error + func (mod ModRing) Validate() error + type ModSimAnn struct + Alpha float64 + T float64 + Tmin float64 + func (mod ModSimAnn) Apply(pop *Population) error + func (mod ModSimAnn) Validate() error + type ModSteadyState struct + KeepBest bool + MutRate float64 + Selector Selector + func (mod ModSteadyState) Apply(pop *Population) error + func (mod ModSteadyState) Validate() error + type Model interface + Apply func(pop *Population) error + Validate func() error + type Population struct + Age time.Duration + Generations int + ID string + Individuals Individuals + func (pop Population) Log(logger *log.Logger) + type Populations []Population + type SelElitism struct + func (sel SelElitism) Apply(n int, indis Individuals, rng *rand.Rand) (Individuals, []int, error) + func (sel SelElitism) Validate() error + type SelRoulette struct + func (sel SelRoulette) Apply(n int, indis Individuals, rng *rand.Rand) (Individuals, []int, error) + func (sel SelRoulette) Validate() error + type SelTournament struct + NContestants int + func (sel SelTournament) Apply(n int, indis Individuals, rng *rand.Rand) (Individuals, []int, error) + func (sel SelTournament) Validate() error + type Selector interface + Apply func(n int, indis Individuals, rng *rand.Rand) (selected Individuals, indexes []int, err error) + Validate func() error + type Slice interface + Append func(Slice) Slice + At func(i int) interface{} + Copy func() Slice + Len func() int + Replace func(Slice) + Set func(i int, v interface{}) + Slice func(a, b int) Slice + Split func(k int) (Slice, Slice) + Swap func(i, j int) + type SpecFitnessInterval struct + K int + func (spec SpecFitnessInterval) Apply(indis Individuals, rng *rand.Rand) ([]Individuals, error) + func (spec SpecFitnessInterval) Validate() error + type SpecKMedoids struct + K int + MaxIterations int + Metric Metric + MinPerCluster int + func (spec SpecKMedoids) Apply(indis Individuals, rng *rand.Rand) ([]Individuals, error) + func (spec SpecKMedoids) Validate() error + type Speciator interface + Apply func(indis Individuals, rng *rand.Rand) ([]Individuals, error) + Validate func() error + type StringSlice []string + func (s StringSlice) Append(t Slice) Slice + func (s StringSlice) At(i int) interface{} + func (s StringSlice) Copy() Slice + func (s StringSlice) Len() int + func (s StringSlice) Replace(t Slice) + func (s StringSlice) Set(i int, v interface{}) + func (s StringSlice) Slice(a, b int) Slice + func (s StringSlice) Split(k int) (Slice, Slice) + func (s StringSlice) Swap(i, j int)