Added make_help in checkpointing, included stdexcept in eoParam. Comments

updates ...
This commit is contained in:
evomarc 2001-09-04 06:43:19 +00:00
commit e79edcffe7
3 changed files with 51 additions and 19 deletions

View file

@ -65,7 +65,7 @@ that are written by the monitor it is probably used from.
void operator()(const eoPop<EOT>& _pop)
{
char buffer[1023]; // about one K of space per member
value() = "\n====== Pop dump =====\n";
value() = "\n# ====== Pop dump =====\n";
unsigned howMany=combien?combien:_pop.size();
for (unsigned i = 0; i < howMany; ++i)
{
@ -95,28 +95,34 @@ class eoSortedPopStat : public eoSortedStat<EOT, string>
{
public :
/** default Ctor, void string by default, as it appears
on the description line once at beginning of evolution. and
is meaningless there */
eoSortedPopStat(string _desc ="") : eoSortedStat<EOT, string>("", _desc) {}
* on the description line once at beginning of evolution. and
* is meaningless there _howMany defaults to 0, that is, the whole
* population
*/
eoSortedPopStat(unsigned _howMany = 0, string _desc ="") :
eoSortedStat<EOT, string>("", _desc) , combien( _howMany) {}
/** Fills the value() of the eoParam with the dump of the population.
Adds a \n before so it does not get mixed up with the rest of the stats
that are written by the monitor it is probably used from.
*/
void operator()(const vector<const EOT*>& _pop)
{
char buffer[1023]; // about one K of space per member
value() = "\n====== Pop dump =====\n";
for (unsigned i = 0; i < _pop.size(); ++i)
/** Fills the value() of the eoParam with the dump of the population.
Adds a \n before so it does not get mixed up with the rest of the stats
that are written by the monitor it is probably used from.
*/
void operator()(const vector<const EOT*>& _pop)
{
std::ostrstream os(buffer, 1022); // leave space for emergency terminate
os << *_pop[i] << endl << ends;
char buffer[1023]; // about one K of space per member
value() = ""; // empty
unsigned howMany=combien?combien:_pop.size();
for (unsigned i = 0; i < howMany; ++i)
{
std::ostrstream os(buffer, 1022); // leave space for emergency terminate
os << *_pop[i] << endl << ends;
// paranoid:
buffer[1022] = '\0';
value() += buffer;
// paranoid:
buffer[1022] = '\0';
value() += buffer;
}
}
}
private:
unsigned combien;
};
#endif