refactor(mo): use clog instead of cout & use at accessors in Debug builds

Should really use eo::log, but waiting for logger refactoring.
This commit is contained in:
Johann Dreo 2023-02-10 09:51:56 +01:00 committed by Johann Dreo
commit 9cb60e4b10
13 changed files with 38 additions and 19 deletions

View file

@ -84,7 +84,7 @@ public:
bool res = (cpt < maxNoImprove);
if (!res && verbose)
std::cout << "STOP in moBestNoImproveContinuator: Reached maximum number of iterations without improvement [" << cpt << "/" << maxNoImprove << "]" << std::endl;
std::clog << "STOP in moBestNoImproveContinuator: Reached maximum number of iterations without improvement [" << cpt << "/" << maxNoImprove << "]" << std::endl;
return res;
}

View file

@ -57,7 +57,7 @@ public:
cpt++;
res = (cpt < maxIter);
if (!res && verbose)
std::cout << "STOP in moIterContinuator: Reached maximum number of iterations [" << cpt << "/" << maxIter << "]" << std::endl;
std::clog << "STOP in moIterContinuator: Reached maximum number of iterations [" << cpt << "/" << maxIter << "]" << std::endl;
return res;
}

View file

@ -62,7 +62,7 @@ public :
neighborhood(_neighborhood), eval(_eval)
{
if (!neighborhood.isRandom()) {
std::cout << "moNeighborFitnessStat::Warning -> the neighborhood used is not random, the neighbor will not be random" << std::endl;
std::clog << "moNeighborFitnessStat::Warning -> the neighborhood used is not random, the neighbor will not be random" << std::endl;
}
}

View file

@ -94,7 +94,7 @@ public:
time_t elapsed = (time_t) difftime(time(NULL), start);
res = (elapsed < max);
if (!res && verbose)
std::cout << "STOP in moTimeContinuator: Reached maximum time [" << elapsed << "/" << max << "]" << std::endl;
std::clog << "STOP in moTimeContinuator: Reached maximum time [" << elapsed << "/" << max << "]" << std::endl;
return res;
}