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

# moSteadyFitSolContinue< EOT > Class Template Reference

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

`#include <moSteadyFitSolContinue.h>`

Inheritance diagram for moSteadyFitSolContinue< EOT >:

List of all members.

## Public Types

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

## Public Member Functions

| moSteadyFitSolContinue (unsigned int _maxNumberOfIterations, unsigned int _maxNumberOfIterationWithoutImprovement)
| Basic constructor.
bool | operator() (const EOT &_solution)
| Function that activates the stopping criterion.
void | init ()
| Procedure which allows to initialise the stuff needed.

## Private Attributes

unsigned int | maxNumberOfIterations
| Maximum number of iterations before considering the fitness.
unsigned int | maxNumberOfIterationsWithoutImprovement
| Maximum number of iterations without improvement allowed.
bool | maxNumberOfIterationsReached
| Flag that indicates that the maxNumberIteration have been reached.
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 moSteadyFitSolContinue< EOT >

One possible stopping criterion for a solution-based heuristic.

The stop criterion corresponds to a maximum number of iterations without improvement (after a minimum number of iterations).

Definition at line 46 of file moSteadyFitSolContinue.h.

## Constructor & Destructor Documentation

template<class EOT>

moSteadyFitSolContinue< EOT >::moSteadyFitSolContinue | ( | unsigned int | _maxNumberOfIterations,
|  | unsigned int | _maxNumberOfIterationWithoutImprovement |
| ) |  |  | `[inline]`

Basic constructor.

Parameters:

  | _maxNumberOfIterations | The number of iterations to reach before looking for the fitness.
  | _maxNumberOfIterationWithoutImprovement | The number of iterations without fitness improvement to reach for stop.

Definition at line 58 of file moSteadyFitSolContinue.h.

## Member Function Documentation

template<class EOT>

bool moSteadyFitSolContinue< EOT >::operator() | ( | const EOT & | _solution | ) | `[inline, virtual]`

Function that activates the stopping criterion.

Indicates if the fitness has not been improved since a 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 70 of file moSteadyFitSolContinue.h.

References moSteadyFitSolContinue< EOT >::counter, moSteadyFitSolContinue< EOT >::firstFitnessSaved, moSteadyFitSolContinue< EOT >::fitness, moSteadyFitSolContinue< EOT >::maxNumberOfIterations, moSteadyFitSolContinue< EOT >::maxNumberOfIterationsReached, and moSteadyFitSolContinue< EOT >::maxNumberOfIterationsWithoutImprovement.

template<class EOT>

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

Procedure which allows to initialise the stuff needed.

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

Implements moSolContinue< EOT >.

Definition at line 114 of file moSteadyFitSolContinue.h.

References moSteadyFitSolContinue< EOT >::counter, moSteadyFitSolContinue< EOT >::firstFitnessSaved, and moSteadyFitSolContinue< EOT >::maxNumberOfIterationsReached.

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

- moSteadyFitSolContinue.h