seallard / walker

NEAT
MIT License
0 stars 0 forks source link

Population numbers deviate from setting #71

Closed seallard closed 4 years ago

seallard commented 4 years ago

It seems like the population size at times varies between 144 and 156 during each run. It should always reflect the population size setting.

seallard commented 4 years ago

Example run: New population consists of: 150 genomes New population consists of: 150 genomes New population consists of: 149 genomes New population consists of: 150 genomes New population consists of: 149 genomes New population consists of: 151 genomes New population consists of: 148 genomes New population consists of: 150 genomes New population consists of: 151 genomes New population consists of: 151 genomes New population consists of: 149 genomes New population consists of: 149 genomes New population consists of: 148 genomes New population consists of: 150 genomes New population consists of: 153 genomes New population consists of: 152 genomes New population consists of: 152 genomes New population consists of: 151 genomes New population consists of: 152 genomes New population consists of: 149 genomes New population consists of: 147 genomes New population consists of: 151 genomes New population consists of: 149 genomes New population consists of: 151 genomes New population consists of: 149 genomes New population consists of: 154 genomes New population consists of: 151 genomes New population consists of: 152 genomes New population consists of: 157 genomes New population consists of: 154 genomes New population consists of: 157 genomes New population consists of: 154 genomes New population consists of: 157 genomes New population consists of: 155 genomes New population consists of: 148 genomes New population consists of: 142 genomes

seallard commented 4 years ago

Disabling interspecies mating does not a difference. I would assume it is because of this rounding:

offspring = round((average_species_fitness/total_average_species_fitness) * self.config.population_size)
species.expected_offspring = offspring