fix eoProportionalSelect: fallback to last solution
This commit is contained in:
parent
b84a13e108
commit
3f61b43576
1 changed files with 2 additions and 2 deletions
|
|
@ -93,9 +93,9 @@ public:
|
||||||
typename FitVec::iterator result
|
typename FitVec::iterator result
|
||||||
= std::upper_bound(cumulative.begin(), cumulative.end(), fortune);
|
= 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();
|
return _pop.back();
|
||||||
} else {
|
} else {
|
||||||
return _pop[result - cumulative.begin()];
|
return _pop[result - cumulative.begin()];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue