moNoFitImprSolContinue< EOT > Class Template Reference

One possible stop criterion for a solution-based heuristic. More...

#include <moNoFitImprSolContinue.h>

Inheritance diagram for moNoFitImprSolContinue< EOT >:

moSolContinue< EOT > eoUF< const EOT &, bool > eoFunctorBase List of all members.

Public Types

typedef EOT::Fitness Fitness
 Alias for the fitness.

Public Member Functions

 moNoFitImprSolContinue (unsigned int __maxNumberOfIterationWithoutImprovement, bool __maximization=true)
 Basic constructor.
bool operator() (const EOT &__sol)
 Function that activates the stopping criterion.
void init ()
 Procedure which allows to initialise all the stuff needed.

Private Attributes

unsigned int maxNumberOfIterationsWithoutImprovement
 Maximum number of iterations without improvement allowed.
bool firstFitnessSaved
 Flag that this is the first time that the fitness is used.
Fitness fitness
 Current Fitness.
bool maximization
 Flag that indicate if there is a maximization (true) or a minimization (false) of the fitness value.
unsigned int counter
 The iteration couter.

Detailed Description

template<class EOT>
class moNoFitImprSolContinue< EOT >

One possible stop criterion for a solution-based heuristic.

The stop criterion corresponds to a maximum number of iterations without improevement.

Definition at line 21 of file moNoFitImprSolContinue.h.


Constructor & Destructor Documentation

template<class EOT>
moNoFitImprSolContinue< EOT >::moNoFitImprSolContinue ( unsigned int  __maxNumberOfIterationWithoutImprovement,
bool  __maximization = true 
) [inline]

Basic constructor.

Parameters:
__maxNumberOfIterationWithoutImprovement The number of iterations without fitness improvement to reach for stop.
__maximization Indicate if the the aim is to maximize or minimize the fitness.

Definition at line 34 of file moNoFitImprSolContinue.h.


Member Function Documentation

template<class EOT>
bool moNoFitImprSolContinue< EOT >::operator() ( const EOT &  __sol  )  [inline, virtual]

Function that activates the stopping criterion.

Indicates if the fitness has not been improved since a given number of iterations (after a minimum of iterations).

Parameters:
__sol the current solution.
Returns:
true or false.

Implements eoUF< const EOT &, bool >.

Definition at line 45 of file moNoFitImprSolContinue.h.

References moNoFitImprSolContinue< EOT >::counter, moNoFitImprSolContinue< EOT >::firstFitnessSaved, moNoFitImprSolContinue< EOT >::fitness, moNoFitImprSolContinue< EOT >::maximization, and moNoFitImprSolContinue< EOT >::maxNumberOfIterationsWithoutImprovement.


Member Data Documentation

template<class EOT>
bool moNoFitImprSolContinue< EOT >::maximization [private]

Flag that indicate if there is a maximization (true) or a minimization (false) of the fitness value.

It can be interesting to know this information because some solution-based metaheuristics can generate solutions wiht a fitness that is worse that the best known fitness (in this case, the counter is not reinitialized).

Definition at line 96 of file moNoFitImprSolContinue.h.

Referenced by moNoFitImprSolContinue< EOT >::operator()().


The documentation for this class was generated from the following file:
Generated on Tue Jul 31 14:12:37 2007 for PARADISEO-MO by  doxygen 1.5.2