eoCounter?
eoEasyEA -- made it copyable again eoEvalFunc -- added specialized eoEvalFuncCounter eoEvolutionStrategy -- nothing much eoGenContinue -- nothing eoPop -- fixed nth_element_fitness eoBitOp -- fixed error in xover eoFileMonitor -- now appends always eoParam -- worked around memory leak in MSC's strstream eoParser -- changed -pconfig_file to @config_file eoParser -- added messages instead of exception when required param is missing eoStat -- added eoDistanceStat t-eoFunctor -- don't know
This commit is contained in:
parent
a7131a7f71
commit
ff108477c3
16 changed files with 222 additions and 83 deletions
|
|
@ -44,4 +44,30 @@ template<class EOT> class eoEvalFunc : public eoUnaryFunctor<void, EOT&>
|
|||
typedef typename EOT::Fitness EOFitT;
|
||||
};
|
||||
|
||||
/**
|
||||
Counts the number of evaluations actually performed, thus checks first
|
||||
if it has to evaluate.. etc.
|
||||
*/
|
||||
|
||||
#include <utils/eoParam.h>
|
||||
template<class EOT> class eoEvalFuncCounter : public eoEvalFunc<EOT>, public eoValueParam<unsigned long>
|
||||
{
|
||||
public :
|
||||
eoEvalFuncCounter(eoEvalFunc<EOT>& _func, std::string _name = "eval_counter")
|
||||
: func(_func), eoValueParam<unsigned long>(0, _name) {}
|
||||
|
||||
void operator()(EOT& _eo)
|
||||
{
|
||||
if (_eo.invalid())
|
||||
{
|
||||
value()++;
|
||||
func(_eo);
|
||||
}
|
||||
}
|
||||
|
||||
private :
|
||||
eoEvalFunc<EOT>& func;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue