remove FastGA foundry last evals, more logs, fix some typos

This commit is contained in:
Johann Dreo 2020-10-08 15:26:07 +02:00
commit 7ca5b6c0d0
4 changed files with 11 additions and 6 deletions

View file

@ -167,10 +167,13 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry<EOT>
try { try {
restart(pop); restart(pop);
} catch(eoMaxEvalException e) { } catch(eoMaxEvalException e) {
#ifndef NDEBUG
eo::log << eo::debug << "Reached maximum evaluations: " << eval.getValue() << " / " << _max_evals << std::endl;
#endif
// In case some solutions were not evaluated when max eval occured. // In case some solutions were not evaluated when max eval occured.
// FIXME can this even be considered legal? // FIXME can this even be considered legal?
eoPopLoopEval<EOT> pop_last_eval(_eval); // eoPopLoopEval<EOT> pop_last_eval(_eval);
pop_last_eval(pop,pop); // pop_last_eval(pop,pop);
} }
} }

View file

@ -147,7 +147,9 @@ public:
virtual void operator()(eoPop<EOT> & pop) virtual void operator()(eoPop<EOT> & pop)
{ {
do { do {
#ifndef NDEBUG
eo::log << eo::debug << "Restart" << std::endl; eo::log << eo::debug << "Restart" << std::endl;
#endif
_reseter(pop); _reseter(pop);
_algo(pop); _algo(pop);
} while( _continue(pop) ); } while( _continue(pop) );

View file

@ -189,7 +189,7 @@ public:
sol.fitness( pop.best_element().fitness() ); sol.fitness( pop.best_element().fitness() );
} else { } else {
eo::log << eo::warnings << "WARNING: encoded algo is out of bounds" << std::endl; eo::log << eo::warnings << "WARNING: encoded algo is out of bounds, penalize to: " << _penalization << std::endl;
sol.fitness( _penalization ); // penalization sol.fitness( _penalization ); // penalization
} }
} }

View file

@ -102,7 +102,7 @@ public:
EOT sol2 = _select_cross(pop); EOT sol2 = _select_cross(pop);
// If the operator returns true, // If the operator returns true,
// olutions have been altered. // solutions have been altered.
if(_crossover(sol1, sol2)) { if(_crossover(sol1, sol2)) {
sol1.invalidate(); sol1.invalidate();
sol2.invalidate(); sol2.invalidate();