bug fix in eoTournament

This commit is contained in:
gustavo 2000-01-11 12:13:18 +00:00
commit c0e85685f8

View file

@ -69,9 +69,15 @@ public:
EOT newEO = _vEO[chosen]; EOT newEO = _vEO[chosen];
veoTournament.push_back( newEO ); 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 // The first is chosen for the new population
_aVEO.push_back( veoTournament.front() ); _aVEO.push_back( best );
} }
}; };