-
Notifications
You must be signed in to change notification settings - Fork 278
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
Little Bugs in neat.js #137
Comments
This was referenced Mar 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, I'm not even sure if they are actually bugs, but these 2 Things kept making me concerned.
In both the "getFittest" and the "getAverage" function, you first check if the scores are undefined. If so you call the "evaluate" function to recalculate the scores.
The problem I had was "evaluate" being an async function, so when you return the result the score might not even be updated yet.
In the "getFittest" and the "getParent" function, you check if the population is sorted by comparing only the first two values. I'm not an expert but, unless you didn't make sure the first genome has the lowest score if the population isn't sorted this won't work for sure!!!
I hope I didn't break something else in the process but I "fixed" the problem like this for me:
https://imgur.com/UrAYyMN
The text was updated successfully, but these errors were encountered: