HTML5_Genetic_Cars
HTML5_Genetic_Cars copied to clipboard
Incorrect formula for mutation size
In mutateNormal, the mutation_range is handled strangely; the resulting formula is originalValue-0.5 + random() * mutation_range (clamping omitted for clarity). The result of this is that when mutation_range is small, every mutated value is reduced to the range [0, mutation_range] within a couple of generations. A more appropriate formula would be originalValue + (random() - 0.5) * mutation_range so that the resulting distribution stays centered at originalValue when unclamped.