EvolvingObjects
|
#include <eoEvalCounterThrowException.h>
Public Member Functions | |
eoEvalCounterThrowException (eoEvalFunc< EOT > &func, unsigned long max_evals, std::string name="Eval. ") | |
virtual void | operator() (EOT &eo) |
Evaluate the individual, then throw an exception if it exceed the max number of evals. | |
virtual std::string | className () const |
Private Attributes | |
unsigned long | _threshold |
Wrap an evaluation function so that an exception may be thrown when the algorithm have reached a maximum number of evaluations.
This may be useful if you want to check this kind of stopping criterion at each _evaluation_, instead of using continuators at each _iteration_.
The class first call the evaluation function, then check the number of times it has been called. If the maximum number of evaluation has been reached, it throw an eoMaxEvalException. You can catch this exception from your main function, so as to stop everything properly.
Definition at line 48 of file eoEvalCounterThrowException.h.