# ParadisEO-MOMovingObjects: moNoFitImprSolContinue< EOT > Class Template Reference

# moNoFitImprSolContinue< EOT > Class Template Reference

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

`#include <moNoFitImprSolContinue.h>`

Inheritance diagram for moNoFitImprSolContinue< EOT >:

List of all members.

## Public Types

typedef EOT::Fitness | Fitness
| Alias for the fitness.

## Public Member Functions

| moNoFitImprSolContinue (unsigned int _maxNumberOfIterationWithoutImprovement)
| Basic constructor.
bool | operator() (const EOT &_solution)
| 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.
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 improvement.

Definition at line 46 of file moNoFitImprSolContinue.h.

## Constructor & Destructor Documentation

template<class EOT>

moNoFitImprSolContinue< EOT >::moNoFitImprSolContinue | ( | unsigned int | _maxNumberOfIterationWithoutImprovement | ) | `[inline]`

Basic constructor.

Parameters:

  | _maxNumberOfIterationWithoutImprovement | The number of iterations without fitness improvement to reach for stop.

Definition at line 57 of file moNoFitImprSolContinue.h.

## Member Function Documentation

template<class EOT>

bool moNoFitImprSolContinue< EOT >::operator() | ( | const EOT & | _solution | ) | `[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:

  | _solution | the current solution.

Returns:
  true or false.

Implements eoUF< const EOT &, bool >.

Definition at line 67 of file moNoFitImprSolContinue.h.

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

template<class EOT>

void moNoFitImprSolContinue< EOT >::init | ( |  | ) | `[inline, virtual]`

Procedure which allows to initialise all the stuff needed.

It can be also used to reinitialize all the needed things.

Implements moSolContinue< EOT >.

Definition at line 102 of file moNoFitImprSolContinue.h.

References moNoFitImprSolContinue< EOT >::counter, and moNoFitImprSolContinue< EOT >::firstFitnessSaved.

The documentation for this class was generated from the following file:

- moNoFitImprSolContinue.h