use eo::log instead of cout

This commit is contained in:
Johann Dreo 2010-09-06 11:20:00 +02:00
commit 3c2639a876

View file

@ -26,6 +26,7 @@
#define _eoSteadyFitContinue_h #define _eoSteadyFitContinue_h
#include <eoContinue.h> #include <eoContinue.h>
#include <utils/eoLogger.h>
/** /**
A continuator: does a minimum number of generations, then A continuator: does a minimum number of generations, then
@ -54,7 +55,7 @@ public:
* reached withtout improvement */ * reached withtout improvement */
virtual bool operator() ( const eoPop<EOT>& _vEO ) { virtual bool operator() ( const eoPop<EOT>& _vEO ) {
thisGeneration++; thisGeneration++;
// std::cout << " [" << thisGeneration << "] ";
Fitness bestCurrentFitness = _vEO.nth_element_fitness(0); Fitness bestCurrentFitness = _vEO.nth_element_fitness(0);
if (steadyState) { // already after MinGenenerations if (steadyState) { // already after MinGenenerations
@ -63,7 +64,7 @@ public:
lastImprovement = thisGeneration; lastImprovement = thisGeneration;
} else { } else {
if (thisGeneration - lastImprovement > repSteadyGenerations) { if (thisGeneration - lastImprovement > repSteadyGenerations) {
std::cout << "STOP in eoSteadyFitContinue: Done " << repSteadyGenerations eo::log << eo::progress << "STOP in eoSteadyFitContinue: Done " << repSteadyGenerations
<< " generations without improvement\n"; << " generations without improvement\n";
return false; return false;
} }
@ -73,7 +74,7 @@ public:
steadyState = true; steadyState = true;
bestSoFar = bestCurrentFitness; bestSoFar = bestCurrentFitness;
lastImprovement = thisGeneration; lastImprovement = thisGeneration;
std::cout << "eoSteadyFitContinue: Done the minimum number of generations\n"; eo::log << eo::progress << "eoSteadyFitContinue: Done the minimum number of generations\n";
} }
} }
return true; return true;