fix eoProportionalSelect: fallback to last solution

This commit is contained in:
Johann Dreo 2020-10-06 15:07:23 +02:00
commit 3f61b43576

View file

@ -93,9 +93,9 @@ public:
typename FitVec::iterator result
= std::upper_bound(cumulative.begin(), cumulative.end(), fortune);
assert(fortune <= cumulative.back());
// assert(fortune <= cumulative.back());
if(result - cumulative.begin() == _pop.size()) {
if(result - cumulative.begin() >= _pop.size()) {
return _pop.back();
} else {
return _pop[result - cumulative.begin()];