Documentation
¶
Index ¶
- type Config
- type Population
- func (p *Population) Act(s core.State) core.Action
- func (p *Population) All() iter.Seq[core.Individual]
- func (p *Population) BestPolicy() func(obs []float64) []float64
- func (p *Population) EndEpisode(total core.Reward)
- func (p *Population) Evolve()
- func (p *Population) Generation() int
- func (p *Population) Len() int
- func (p *Population) Observe(s core.State, a core.Action, r core.Reward, next core.State, done bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Population int
Inputs, Outputs int
WeightMutationRate float64
WeightMutationStd float64
AddConnRate float64
AddNodeRate float64
CompatThreshold float64
C1, C2, C3 float64
ElitePerSpecies int
SurvivalThreshold float64
Seed int64
}
func DefaultConfig ¶
func DefaultConfig() Config
type Population ¶
type Population struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config) *Population
func (*Population) All ¶
func (p *Population) All() iter.Seq[core.Individual]
func (*Population) BestPolicy ¶
func (p *Population) BestPolicy() func(obs []float64) []float64
func (*Population) EndEpisode ¶
func (p *Population) EndEpisode(total core.Reward)
func (*Population) Evolve ¶
func (p *Population) Evolve()
func (*Population) Generation ¶
func (p *Population) Generation() int
func (*Population) Len ¶
func (p *Population) Len() int
Click to show internal directories.
Click to hide internal directories.