Versions in this module Expand all Collapse all v3 v3.0.3 Jun 23, 2022 v3.0.2 Jun 21, 2022 v3.0.1 May 29, 2022 v3.0.0 May 22, 2022 Changes in this version + var ErrUnsupportedGenomeEncoding = errors.New("unsupported genome encoding") + func NodeWithId(nodeId int, nodes []*network.NNode) *network.NNode + func TraitWithId(traitId int, traits []*neat.Trait) *neat.Trait + type ByOrganismFitness []*Species + func (f ByOrganismFitness) Len() int + func (f ByOrganismFitness) Less(i, j int) bool + func (f ByOrganismFitness) Swap(i, j int) + type Gene struct + InnovationNum int64 + IsEnabled bool + Link *network.Link + MutationNum float64 + func NewConnectionGene(link *network.Link, innovationNum int64, mutationNum float64, enabled bool) *Gene + func NewGene(weight float64, inNode, outNode *network.NNode, recurrent bool, ...) *Gene + func NewGeneCopy(g *Gene, trait *neat.Trait, inNode, outNode *network.NNode) *Gene + func NewGeneWithTrait(trait *neat.Trait, weight float64, inNode, outNode *network.NNode, ...) *Gene + func (g *Gene) String() string + type Genome struct + ControlGenes []*MIMOControlGene + Genes []*Gene + Id int + Nodes []*network.NNode + Phenotype *network.Network + Traits []*neat.Trait + func NewGenome(id int, t []*neat.Trait, n []*network.NNode, g []*Gene) *Genome + func NewModularGenome(id int, t []*neat.Trait, n []*network.NNode, g []*Gene, ...) *Genome + func ReadGenome(ir io.Reader, id int) (*Genome, error) + func (g *Genome) Extrons() int + func (g *Genome) Genesis(netId int) (*network.Network, error) + func (g *Genome) IsEqual(og *Genome) (bool, error) + func (g *Genome) String() string + func (g *Genome) Write(w io.Writer) error + type GenomeEncoding byte + const PlainGenomeEncoding + const YAMLGenomeEncoding + type GenomeReader interface + Encoding func() GenomeEncoding + Read func() (*Genome, error) + func NewGenomeReader(r io.Reader, encoding GenomeEncoding) (GenomeReader, error) + func NewGenomeReaderFromFile(genomeFilePath string) (GenomeReader, error) + type GenomeWriter interface + WriteGenome func(genome *Genome) error + func NewGenomeWriter(w io.Writer, encoding GenomeEncoding) (GenomeWriter, error) + type Innovation struct + InNodeId int + InnovationNum int64 + InnovationNum2 int64 + IsRecurrent bool + NewNodeId int + NewTraitNum int + NewWeight float64 + OldInnovNum int64 + OutNodeId int + func NewInnovationForLink(nodeInId, nodeOutId int, innovationNum int64, weight float64, traitId int) *Innovation + func NewInnovationForNode(nodeInId, nodeOutId int, innovationNum1, innovationNum2 int64, newNodeId int, ...) *Innovation + func NewInnovationForRecurrentLink(nodeInId, nodeOutId int, innovationNum int64, weight float64, traitId int, ...) *Innovation + type InnovationsObserver interface + Innovations func() []Innovation + NextInnovationNumber func() int64 + StoreInnovation func(innovation Innovation) + type MIMOControlGene struct + ControlNode *network.NNode + InnovationNum int64 + IsEnabled bool + MutationNum float64 + func NewMIMOGene(controlNode *network.NNode, innovNum int64, mutNum float64, enabled bool) *MIMOControlGene + func NewMIMOGeneCopy(g *MIMOControlGene, controlNode *network.NNode) *MIMOControlGene + func (g *MIMOControlGene) String() string + type Organism struct + Data *OrganismData + Error float64 + ExpectedOffspring float64 + Fitness float64 + Flag int + Generation int + Genotype *Genome + IsWinner bool + Phenotype *network.Network + Species *Species + func NewOrganism(fit float64, g *Genome, generation int) (org *Organism, err error) + func (o *Organism) CheckChampionChildDamaged() bool + func (o *Organism) Dump() string + func (o *Organism) MarshalBinary() ([]byte, error) + func (o *Organism) String() string + func (o *Organism) UnmarshalBinary(data []byte) error + func (o *Organism) UpdatePhenotype() (err error) + type OrganismData struct + Value interface{} + type Organisms []*Organism + func (f Organisms) Len() int + func (f Organisms) Less(i, j int) bool + func (f Organisms) Swap(i, j int) + type ParallelPopulationEpochExecutor struct + func (p *ParallelPopulationEpochExecutor) NextEpoch(ctx context.Context, generation int, population *Population) error + type Population struct + EpochsHighestLastChanged int + FinalGen int + HighestFitness float64 + LastSpecies int + MeanFitness float64 + Organisms []*Organism + Species []*Species + StandardDev float64 + Variance float64 + WinnerGen int + func NewPopulation(g *Genome, opts *neat.Options) (*Population, error) + func NewPopulationRandom(in, out, maxHidden int, recurrent bool, linkProb float64, opts *neat.Options) (*Population, error) + func ReadPopulation(ir io.Reader, options *neat.Options) (pop *Population, err error) + func (p *Population) Innovations() []Innovation + func (p *Population) NextInnovationNumber() int64 + func (p *Population) NextNodeId() int + func (p *Population) StoreInnovation(innovation Innovation) + func (p *Population) Verify() (bool, error) + func (p *Population) Write(w io.Writer) error + func (p *Population) WriteBySpecies(w io.Writer) error + type PopulationEpochExecutor interface + NextEpoch func(ctx context.Context, generation int, population *Population) error + type SequentialPopulationEpochExecutor struct + func (s *SequentialPopulationEpochExecutor) NextEpoch(ctx context.Context, generation int, population *Population) error + type Species struct + Age int + AgeOfLastImprovement int + ExpectedOffspring int + Id int + IsChecked bool + IsNovel bool + MaxFitnessEver float64 + Organisms Organisms + func NewSpecies(id int) *Species + func NewSpeciesNovel(id int, novel bool) *Species + func (s *Species) ComputeMaxAndAvgFitness() (max, avg float64) + func (s *Species) FindChampion() *Organism + func (s *Species) Size() int + func (s *Species) String() string + func (s *Species) Write(w io.Writer) error Other modules containing this package github.com/yaricom/goNEAT/v2 github.com/yaricom/goNEAT/v4