Toy-Neural-Network-JS
Toy-Neural-Network-JS copied to clipboard
Fixed issue with ga.js poolSelection
The birds array needs to be shuffled, otherwise we go through the array from worse to best
I feel like I'm missing something. From what I see, the original array is not sorted.
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
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.