Documentation ¶
Index ¶
- func KeySet_Int_SlInt(m map[int][]int) []int
- type DemeGroup
- type Individual
- type PMethod
- type Population
- func (p *Population) AverageFitness() float64
- func (p *Population) BestMember() (Individual, int)
- func (p_p *Population) GenerateFitness()
- func (p_p *Population) GetElites() []Individual
- func (p *Population) NextGeneration() bool
- func (p_p *Population) Print()
- func (p *Population) Weights(power float64) ([]float64, []float64)
- type SMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeySet_Int_SlInt ¶
Types ¶
type DemeGroup ¶
type DemeGroup struct { Demes []Population // Migration Chance is the average number // of individuals that should swap demes // per generation. .5 would have a swap // every other generation, on average, // 5 would have 5 swaps per generation, // etc. // Individuals cannot leave a deme without // another replacing it, in order to maintain // each deme's size does not change. // (This assertion is subject to change with // further analysis) MigrationChance float64 }
func (*DemeGroup) AverageFitness ¶
func (*DemeGroup) BestMember ¶
func (dg *DemeGroup) BestMember() (Individual, int)
func (*DemeGroup) NextGeneration ¶
type Individual ¶
type Individual interface { Fitness(input, expected [][]float64) int Mutate() Crossover(other Individual) Individual CanCrossover(other Individual) bool Print() }
type PMethod ¶
type PMethod interface {
Pair(p *Population, populated int) [][]int
}
type Population ¶
type Population struct { Members []Individual Size int Selection SMethod Pairing PMethod FitnessTests int TestInputs [][]float64 TestExpected [][]float64 Elites int Fitnesses []int LowFitness int MaxFitness int GoalFitness int }
func (*Population) AverageFitness ¶
func (p *Population) AverageFitness() float64
func (*Population) BestMember ¶
func (p *Population) BestMember() (Individual, int)
func (*Population) GenerateFitness ¶
func (p_p *Population) GenerateFitness()
func (*Population) GetElites ¶
func (p_p *Population) GetElites() []Individual
func (*Population) NextGeneration ¶
func (p *Population) NextGeneration() bool
NextGeneration selects, mutates, and crosses the population over, returning whether the population reached the goal fitness or not.
func (*Population) Print ¶
func (p_p *Population) Print()
type SMethod ¶
type SMethod interface { Select(p *Population) []Individual GetParentProportion() int }
Click to show internal directories.
Click to hide internal directories.