EvolvingObjects
eoEvalCounterThrowException< EOT > Class Template Reference

#include <eoEvalCounterThrowException.h>

Inheritance diagram for eoEvalCounterThrowException< EOT >:
eoEvalFuncCounter< EOT > eoEvalFunc< EOT > eoValueParam< unsigned long > eoUF< EOT &, void > eoParam eoFunctorBase unary_function

List of all members.

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

Detailed Description

template<typename EOT>
class eoEvalCounterThrowException< EOT >

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends