|
pulsatrix
|
NEAT's own generational evolutionary loop: fitness evaluation, speciation, fitness sharing, proportional offspring allocation, and mutation-only reproduction. More...
#include <algorithm>#include <cmath>#include <limits>#include <numeric>#include <random>#include <stdexcept>#include <vector>#include "pulsatrix/neat_genome.hpp"#include "pulsatrix/neat_speciation.hpp"
Go to the source code of this file.
Classes | |
| struct | pulsatrix::NEATEvolutionResult |
| Result of a full NEAT evolutionary run. More... | |
Namespaces | |
| namespace | pulsatrix |
Functions | |
| std::vector< int > | pulsatrix::AllocateOffspringCounts (const std::vector< double > &species_adjusted_fitness_sums, int population_size) |
| Pure core: allocates population_size offspring slots across species proportionally to each species' own adjusted-fitness sum, using the largest-remainder (Hamilton) apportionment method so the total always sums to exactly population_size (ties in fractional remainder broken by species index, earliest first). Falls back to an equal split (remainder to the earliest species, by index) if every species sum is non-positive, rather than dividing by zero. | |
| template<typename RNG > | |
| NEATGenome | pulsatrix::ReproduceOffspring (const NEATGenome &parent, InnovationTracker &tracker, RNG &rng, double weight_mutation_sigma, double weight_mutation_probability, double add_connection_probability, double add_node_probability) |
| RNG-driven wrapper: clones parent, then applies weight mutation (gated per-connection by weight_mutation_probability inside MutateWeights itself) and, independently, one attempt each at the two structural mutations, each gated by its own probability. | |
| template<typename FitnessFn , typename RNG > | |
| NEATEvolutionResult | pulsatrix::RunNEATEvolution (std::vector< NEATGenome > population, FitnessFn fitness_fn, int num_generations, double compatibility_threshold, double c1, double c2, double c3, double weight_mutation_sigma, double weight_mutation_probability, double add_connection_probability, double add_node_probability, InnovationTracker &tracker, RNG &rng) |
| Runs num_generations of speciated, mutation-only NEAT evolution. Each generation: evaluates every genome's fitness via fitness_fn, tracks the best genome seen across the whole run so far (global elitism – best_fitness never decreases generation to generation), speciates the population, applies fitness sharing, allocates each species a share of the next generation proportional to its adjusted-fitness sum, and fills that share with one unmutated species-champion copy plus mutated copies of uniformly-randomly chosen species members. | |
NEAT's own generational evolutionary loop: fitness evaluation, speciation, fitness sharing, proportional offspring allocation, and mutation-only reproduction.