bug fix in eoTournament
This commit is contained in:
parent
29dc5ac034
commit
c0e85685f8
1 changed files with 17 additions and 11 deletions
|
|
@ -69,9 +69,15 @@ public:
|
|||
EOT newEO = _vEO[chosen];
|
||||
veoTournament.push_back( newEO );
|
||||
}
|
||||
sort( veoTournament.begin(), veoTournament.end() );
|
||||
|
||||
eoPop<EOT>::const_iterator best = max_element(veoTournament.begin(),
|
||||
veoTournament.end());
|
||||
if (best == veoTournament.end()) {
|
||||
throw runtime_error("error in void eoTournament::operator(eoPop<EOT>&, eoPop<EOT>&)");
|
||||
}
|
||||
|
||||
// The first is chosen for the new population
|
||||
_aVEO.push_back( veoTournament.front() );
|
||||
_aVEO.push_back( best );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Reference in a new issue