You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a precursor, I'm willing to make these changes myself. But want to make sure there is not a reason for these functions to be the way they are before doing so.
Description
Both getFittest and getParent have a check before sorting that checks to see if the first two items in the population are sorted against eachother. Not only does this not correctly check that the population is sorted, it will also cause and error if the population is 1.
This seems to have been an issue in neataptic as well.
A call to getFittest or getParent will show the issue if the population is sorted in a particular way. Such that the first two items are "sorted" but the rest aren't. For example, if the scores are as follow. [15, 20, 1, 2, 3, 4, 100]
Tasks
Include specific tasks in the order they need to be done in. Include links to specific lines of code where the task should happen at.
Just call the sort in both functions rather than checking.
The text was updated successfully, but these errors were encountered:
As a precursor, I'm willing to make these changes myself. But want to make sure there is not a reason for these functions to be the way they are before doing so.
Description
Both getFittest and getParent have a check before sorting that checks to see if the first two items in the population are sorted against eachother. Not only does this not correctly check that the population is sorted, it will also cause and error if the population is 1.
This seems to have been an issue in neataptic as well.
wagenaartje/neataptic#137
Files
You can see this incorrect check here and here
To Reproduce
A call to getFittest or getParent will show the issue if the population is sorted in a particular way. Such that the first two items are "sorted" but the rest aren't. For example, if the scores are as follow. [15, 20, 1, 2, 3, 4, 100]
Tasks
Include specific tasks in the order they need to be done in. Include links to specific lines of code where the task should happen at.
The text was updated successfully, but these errors were encountered: