moBestImprSelect< M > Class Template Reference

One of the possible moMoveSelect. More...

#include <moBestImprSelect.h>

Inheritance diagram for moBestImprSelect< M >:

moMoveSelect< M > eoBF< M &, M::EOType::Fitness &, void > eoFunctorBase

List of all members.

Public Types

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

Public Member Functions

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 first_time
 Allowing to know if at least one move has been generated.
best_move
 The best move.
Fitness best_fitness
 The best fitness.


Detailed Description

template<class M>
class moBestImprSelect< M >

One of the possible moMoveSelect.

All neighbors are considered, and the movement which enables the best improvement is selected.

Definition at line 47 of file moBestImprSelect.h.


Member Function Documentation

template<class M>
void moBestImprSelect< M >::init ( const Fitness _fitness  )  [inline, virtual]

Procedure which initialise the exploration.

Parameters:
_fitness The current fitness.

Implements moMoveSelect< M >.

Definition at line 58 of file moBestImprSelect.h.

References moBestImprSelect< M >::first_time.

template<class M>
bool moBestImprSelect< 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) and the fitness linked to this move are saved.

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 76 of file moBestImprSelect.h.

References moBestImprSelect< M >::best_fitness, moBestImprSelect< M >::best_move, and moBestImprSelect< M >::first_time.

template<class M>
void moBestImprSelect< 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 94 of file moBestImprSelect.h.

References moBestImprSelect< M >::best_fitness, moBestImprSelect< M >::best_move, and moBestImprSelect< M >::first_time.


The documentation for this class was generated from the following file:
Generated on Wed Jan 16 15:50:40 2008 for ParadisEO-MOMovingObjects by  doxygen 1.5.4