fix #13: remove the use of the verbose members, replaced by the eo::log system ; functions prototypes keep their verbose parameters, but display a warning until next version
This commit is contained in:
parent
77e97a6ba0
commit
a9f382a30c
7 changed files with 32 additions and 37 deletions
|
|
@ -33,10 +33,6 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// some defines to make things easier to get at first sight
|
||||
|
||||
// tuning the amount of output using a boolean argument:
|
||||
// true should always mean more output
|
||||
#define eo_verbose true
|
||||
#define eo_no_verbose false
|
||||
// to be used in selection / replacement procedures to indicate whether
|
||||
// the argument (rate, a double) shoudl be treated as a rate (number=rate*popSize)
|
||||
// or as an absolute integer (number=rate regardless of popsize).
|
||||
|
|
|
|||
|
|
@ -25,38 +25,33 @@ eoMonitor& eoOStreamMonitor::operator()(void)
|
|||
|
||||
if (firsttime) {
|
||||
|
||||
if (verbose) {
|
||||
eo::log << eo::progress << "First Generation" << std::endl;
|
||||
|
||||
} else { // else verbose
|
||||
for (iterator it = vec.begin (); it != vec.end (); ++it) {
|
||||
out << (*it)->longName ();
|
||||
out << delim << std::left << std::setfill(fill) << std::setw(width);
|
||||
}
|
||||
out << std::endl;
|
||||
} // else verbose
|
||||
for (iterator it = vec.begin (); it != vec.end (); ++it) {
|
||||
out << (*it)->longName ();
|
||||
out << delim << std::left << std::setfill(fill) << std::setw(width);
|
||||
}
|
||||
out << std::endl;
|
||||
|
||||
firsttime = false;
|
||||
firsttime = false;
|
||||
} // if firstime
|
||||
|
||||
// ok, now the real saving. write out
|
||||
if (verbose) {
|
||||
/* TODO old verbose formatting, do we still need it?
|
||||
for (iterator it = vec.begin (); it != vec.end (); ++it) {
|
||||
// name: value
|
||||
out << (*it)->longName () << ": " << (*it)->getValue () << std::endl;
|
||||
} // for it in vec
|
||||
*/
|
||||
|
||||
eo::log << eo::progress << "End of Generation" << std::endl;
|
||||
for (iterator it = vec.begin (); it != vec.end (); ++it) {
|
||||
// value only
|
||||
out << (*it)->getValue ();
|
||||
out << delim << std::left << std::setfill(fill) << std::setw(width);
|
||||
} // for it in vec
|
||||
|
||||
} else { // else verbose
|
||||
for (iterator it = vec.begin (); it != vec.end (); ++it) {
|
||||
// value only
|
||||
out << (*it)->getValue ();
|
||||
out << delim << std::left << std::setfill(fill) << std::setw(width);
|
||||
} // for it in vec
|
||||
|
||||
out << std::endl;
|
||||
} // if verbose
|
||||
out << std::endl;
|
||||
eo::log << eo::progress << "End of Generation" << std::endl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,10 @@ class eoOStreamMonitor : public eoMonitor
|
|||
{
|
||||
public :
|
||||
eoOStreamMonitor( std::ostream & _out, bool _verbose=true, std::string _delim = "\t", unsigned int _width=20, char _fill=' ' ) :
|
||||
out(_out), verbose(_verbose), delim(_delim), width(_width), fill(_fill), firsttime(true) {}
|
||||
out(_out), delim(_delim), width(_width), fill(_fill), firsttime(true)
|
||||
{
|
||||
eo::log << eo::warnings << "WARNING: the use of the verbose parameter in eoOStreamMonitor constructor is deprecated and will be removed in the next release" << std::endl;
|
||||
}
|
||||
|
||||
eoMonitor& operator()(void);
|
||||
|
||||
|
|
@ -51,7 +54,6 @@ public :
|
|||
|
||||
private :
|
||||
std::ostream & out;
|
||||
bool verbose;
|
||||
std::string delim;
|
||||
unsigned int width;
|
||||
char fill;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ class eoStdoutMonitor : public eoOStreamMonitor
|
|||
{
|
||||
public :
|
||||
eoStdoutMonitor(bool _verbose=true, std::string _delim = "\t", unsigned int _width=20, char _fill=' ' ) :
|
||||
eoOStreamMonitor( std::cout, _verbose, _delim, _width, _fill) {}
|
||||
eoOStreamMonitor( std::cout, _verbose, _delim, _width, _fill)
|
||||
{
|
||||
|
||||
eo::log << eo::warnings << "WARNING: the use of the verbose parameter in eoStdutMonitor constructor is deprecated and will be removed in the next release" << std::endl;
|
||||
}
|
||||
|
||||
virtual std::string className(void) const { return "eoStdoutMonitor"; }
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue