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

Erroneous formula for calculating mutation size #57

Open
imranimtiaz opened this issue Sep 12, 2024 · 0 comments
Open

Erroneous formula for calculating mutation size #57

imranimtiaz opened this issue Sep 12, 2024 · 0 comments

Comments

@imranimtiaz
Copy link

In the mutateNormal function, the way mutation_range is applied seems problematic. The current formula used is originalValue - 0.5 + random() * mutation_range (excluding clamping for simplicity). This approach causes mutated values to quickly shrink to the range [0, mutation_range] when the mutation_range is small, leading to reduced variation over generations.

A more suitable formula would be originalValue + (random() - 0.5) * mutation_range, which ensures that the distribution of mutated values remains centered around originalValue, even when no clamping is applied.

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

No branches or pull requests

1 participant