HTML5_Genetic_Cars icon indicating copy to clipboard operation
HTML5_Genetic_Cars copied to clipboard

Incorrect formula for mutation size

Open boothby opened this issue 1 year ago • 1 comments

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.

boothby avatar Apr 30 '24 03:04 boothby