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

Fixed issue with ga.js poolSelection #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

papalotis
Copy link
Contributor

The birds array needs to be shuffled, otherwise we go through the array from worse to best

The birds array needs to be shuffled, otherwise we go through the array from worse to best
@Versatilus
Copy link
Collaborator

I feel like I'm missing something. From what I see, the original array is not sorted.

@papalotis
Copy link
Contributor Author

The birds are pushed to the array when they "die". If we don't shuffle the array, then we will always consider the worst bird first, the second worst second and so forth

@Versatilus
Copy link
Collaborator

We start out with two identical unsorted arrays, allBirds and activeBirds. As the birds die, they are removed from activeBirds. Once activeBirds is empty, a new generation is randomly generated from the still unsorted allBirds.

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

Successfully merging this pull request may close these issues.

2 participants