Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random mutation formula isn't quite right #5

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 1 comment
Open

Random mutation formula isn't quite right #5

GoogleCodeExporter opened this issue Mar 14, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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 nemost...@hotmail.com on 26 Apr 2011 at 5:57

@GoogleCodeExporter
Copy link
Author

The formula is right, sorry about this post...
I feel like an idiot for opening the thread.

Original comment by nemost...@hotmail.com on 26 Apr 2011 at 7:02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant