# ParadisEO-MOMovingObjects: moFirstImprSelect< M > Class Template Reference

# moFirstImprSelect< M > Class Template Reference

One possible moMoveSelect. More...

`#include <moFirstImprSelect.h>`

Inheritance diagram for moFirstImprSelect< M >:

List of all members.

## Public Types

typedef M::EOType::Fitness | Fitness
| Alias for the fitness.

## Public Member Functions

virtual void | init (const Fitness &_fitness)
| Procedure which initialise the exploration.
bool | update (const M &_move, const Fitness &_fitness)
| Function that indicates if the current move has not improved the fitness.
void | operator() (M &_move, Fitness &_fitness)
| Procedure which saved the best move and fitness.

## Private Attributes

bool | valid
| Allow to know if at least one move has improved the solution.
M | best_move
| Best stored movement.
Fitness | initial_fitness
| Initial fitness.
Fitness | best_fitness
| Best stored fitness.

## Detailed Description

### template<class M>
class moFirstImprSelect< M >

One possible moMoveSelect.

The neighborhood is explored until a move enables an improvment of the current solution.

Definition at line 48 of file moFirstImprSelect.h.

## Member Function Documentation

template<class M>

virtual void moFirstImprSelect< M >::init | ( | const Fitness & | _fitness | ) | `[inline, virtual]`

Procedure which initialise the exploration.

It save the current fitness as the initial value for the fitness.

Parameters:

  | _fitness | The current fitness.

Implements moMoveSelect< M >.

Definition at line 60 of file moFirstImprSelect.h.

References moFirstImprSelect< M >::initial_fitness, and moFirstImprSelect< M >::valid.

template<class M>

bool moFirstImprSelect< M >::update | ( | const M & | _move,
|  | const Fitness & | _fitness |
| ) |  |  | `[inline, virtual]`

Function that indicates if the current move has not improved the fitness.

If the given fitness enables an improvment, the move (moMove) should be applied to the current solution.

Parameters:

  | _move | a move.
  | _fitness | a fitness linked to the move.

Returns:
  true if the move does not improve the fitness.

Implements moMoveSelect< M >.

Definition at line 75 of file moFirstImprSelect.h.

References moFirstImprSelect< M >::best_fitness, moFirstImprSelect< M >::best_move, moFirstImprSelect< M >::initial_fitness, and moFirstImprSelect< M >::valid.

template<class M>

void moFirstImprSelect< M >::operator() | ( | M & | _move,
|  | Fitness & | _fitness |
| ) |  |  | `[inline, virtual]`

Procedure which saved the best move and fitness.

Parameters:

  | _move | the current move (result of the procedure).
  | _fitness | the current fitness (result of the procedure).

Implements eoBF< M &, M::EOType::Fitness &, void >.

Definition at line 96 of file moFirstImprSelect.h.

References moFirstImprSelect< M >::best_fitness, moFirstImprSelect< M >::best_move, and moFirstImprSelect< M >::valid.

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

- moFirstImprSelect.h