Documentation ¶
Index ¶
- Variables
- func ScoreOrderSelectTop(origin, less float64) func(p Population) int
- func ScoreRollSelect(p Population) int
- func ScoreRollSelectTop(ratio float64) func(p Population) int
- type CrossoverFunc
- type Plugin
- type PluginFunc
- type Population
- func (p Population) BestScore() float64
- func (p Population) BestSingle() Single
- func (p Population) Brother(value []Single) Population
- func (p Population) Child(value []Single) Population
- func (p Population) Len() int
- func (p Population) Less(i, j int) bool
- func (p Population) MatchTarget() bool
- func (p Population) NeedContinue() bool
- func (p Population) NextGen() Population
- func (p Population) Random() Population
- func (p Population) Run() Population
- func (p Population) Score() Population
- func (p Population) Swap(i, j int)
- type RandomFunc
- type ScoreFunc
- type SelectFunc
- type Single
- type TargetFunc
- type VariantFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var EMPTY_PLUGIN_FUNC = func(p Population) Population { return p }
Functions ¶
func ScoreOrderSelectTop ¶
func ScoreOrderSelectTop(origin, less float64) func(p Population) int
func ScoreRollSelect ¶
func ScoreRollSelect(p Population) int
func ScoreRollSelectTop ¶
func ScoreRollSelectTop(ratio float64) func(p Population) int
Types ¶
type CrossoverFunc ¶
type CrossoverFunc func(Population, int, int) (Single, Single)
type Plugin ¶
type Plugin struct { Start PluginFunc Each PluginFunc End PluginFunc }
type PluginFunc ¶
type PluginFunc func(Population) Population
type Population ¶
type Population struct { Gen int Size int Dim int CrossoverFactor float64 VariantFactor float64 MaxGen int RandomFunc RandomFunc CrossoverFunc CrossoverFunc VariantFunc VariantFunc ScoreFunc ScoreFunc SelectFunc SelectFunc TargetFunc TargetFunc Plugins []Plugin // all below always sort by score descending Value []Single TotalScore float64 SingleGeneScore [][]float64 SingleScore []float64 }
func (Population) BestScore ¶
func (p Population) BestScore() float64
func (Population) Brother ¶
func (p Population) Brother(value []Single) Population
func (Population) Child ¶
func (p Population) Child(value []Single) Population
func (Population) Len ¶
func (p Population) Len() int
func (Population) Less ¶
func (p Population) Less(i, j int) bool
func (Population) MatchTarget ¶
func (p Population) MatchTarget() bool
func (Population) NeedContinue ¶
func (p Population) NeedContinue() bool
func (Population) NextGen ¶
func (p Population) NextGen() Population
func (Population) Random ¶
func (p Population) Random() Population
func (Population) Run ¶
func (p Population) Run() Population
func (Population) Score ¶
func (p Population) Score() Population
func (Population) Swap ¶
func (p Population) Swap(i, j int)
type RandomFunc ¶
type RandomFunc func(Population) Single
type SelectFunc ¶
type SelectFunc func(Population) int
type TargetFunc ¶
type TargetFunc func(Population) bool
func TargetScore ¶
func TargetScore(s float64) TargetFunc
func TargetStableScore ¶
func TargetStableScore(gen int) TargetFunc
func (TargetFunc) And ¶
func (t TargetFunc) And(o TargetFunc) TargetFunc
func (TargetFunc) Or ¶
func (t TargetFunc) Or(o TargetFunc) TargetFunc
type VariantFunc ¶
type VariantFunc func(Population, Single) Single
Click to show internal directories.
Click to hide internal directories.