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

Little Bugs in neat.js #137

Open
loloman333 opened this issue Jul 11, 2018 · 0 comments
Open

Little Bugs in neat.js #137

loloman333 opened this issue Jul 11, 2018 · 0 comments

Comments

@loloman333
Copy link

Well, I'm not even sure if they are actually bugs, but these 2 Things kept making me concerned.

  1. 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.

  2. 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

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