Skip to content

Random mutation formula isn't quite right #5

@GoogleCodeExporter

Description

@GoogleCodeExporter
In SfxrParams.as at line 422-443 the formula use to randomize is:
Math.random() * mutation*2 - mutation;

While should be:
Math.random() * (mutation*2 - mutation);


Consider:
mutation = 0.05;
Math.random() = 0;

Old formula:
0 * 0.05*2 - 0.05 = -0.05; // Not expected

New formula:
0 * (0.05*2 - 0.05) = 0; // Expected

Original issue reported on code.google.com by [email protected] on 26 Apr 2011 at 5:57

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions