Added the lastCall construct: if the stopping condition becomes true in eoCheckPoint,
a method called lastCall is called for everything contained in that checkpoint
(stats, updaters and monitors). This can be extremely useful
- for stateSavers (see below)
- for monitoring things like rates of success of operators, where what you
are interested in is the final result only.
Added of course a virtual method lastCall that does nothing by default in classes
eoBaseStat, eoBaseSortedStat, eoUpdater and eoMonitor
Added a boolean to control the save of the state in method eoCountedStateSaver::lastCall
so you can ask that the state is saved at final population, whatever happens.
I also added the corresponding constructor to take this into account.
This commit is contained in:
parent
5c5142e59c
commit
0e62de2d14
5 changed files with 63 additions and 14 deletions
|
|
@ -37,7 +37,10 @@
|
|||
*/
|
||||
template <class EOT>
|
||||
class eoStatBase : public eoUF<const eoPop<EOT>&, void>
|
||||
{};
|
||||
{
|
||||
public:
|
||||
virtual void lastCall(const eoPop<EOT>&) {}
|
||||
};
|
||||
|
||||
/**
|
||||
The actual class that will be used as base for all statistics
|
||||
|
|
@ -57,6 +60,8 @@ public :
|
|||
template <class EOT>
|
||||
class eoSortedStatBase : public eoUF<const vector<const EOT*>&, void>
|
||||
{
|
||||
public:
|
||||
virtual void lastCall(const vector<const EOT*>&) {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -150,7 +155,7 @@ private :
|
|||
unsigned which;
|
||||
};
|
||||
|
||||
/* Actually, you don't need to sort the population to get the best fitness
|
||||
/* Actually, you shouldn't need to sort the population to get the best fitness
|
||||
MS - 17/11/00
|
||||
|
||||
template <class EOT>
|
||||
|
|
@ -171,7 +176,7 @@ public :
|
|||
*/
|
||||
|
||||
/**
|
||||
Best fitness in the population (this is NOT an eoSortedStat but an eoStat)
|
||||
Best fitness in the population
|
||||
*/
|
||||
template <class EOT>
|
||||
class eoBestFitnessStat : public eoNthElementFitnessStat<EOT>
|
||||
|
|
|
|||
Reference in a new issue