#include <moRandImprSelect.h>

Public Types | |
| typedef M::EOType::Fitness | Fitness |
| Alias for the fitness. | |
Public Member Functions | |
| void | init (const Fitness &_fitness) |
| Procedure which all that needs a moRandImprSelect. | |
| bool | update (const M &_move, const Fitness &_fitness) |
| Function that updates the fitness and move vectors. | |
| void | operator() (M &_move, Fitness &_fitness) |
| The move selection. | |
Private Attributes | |
| Fitness | initial_fitness |
| Fitness of the current solution. | |
| std::vector< Fitness > | better_fitnesses |
| Candidate fitnesse vector. | |
| std::vector< M > | better_moves |
| Candidate move vector. | |
All the neighbors are considered. One of them that enables an improvment of the objective function is choosen.
Definition at line 49 of file moRandImprSelect.h.
| void moRandImprSelect< M >::init | ( | const Fitness & | _fitness | ) | [inline, virtual] |
Procedure which all that needs a moRandImprSelect.
Give a value to the initialise fitness. Clean the move and fitness vectors.
| _fitness | the current best fitness |
Implements moMoveSelect< M >.
Definition at line 63 of file moRandImprSelect.h.
References moRandImprSelect< M >::better_fitnesses, moRandImprSelect< M >::better_moves, and moRandImprSelect< M >::initial_fitness.
| bool moRandImprSelect< M >::update | ( | const M & | _move, | |
| const Fitness & | _fitness | |||
| ) | [inline, virtual] |
Function that updates the fitness and move vectors.
if a move give a better fitness than the initial fitness, it is saved and the fitness too.
| _move | a new move. | |
| _fitness | a new fitness associated to the new move. |
Implements moMoveSelect< M >.
Definition at line 79 of file moRandImprSelect.h.
References moRandImprSelect< M >::better_fitnesses, moRandImprSelect< M >::better_moves, and moRandImprSelect< M >::initial_fitness.
| void moRandImprSelect< M >::operator() | ( | M & | _move, | |
| Fitness & | _fitness | |||
| ) | [inline, virtual] |
The move selection.
One the saved move is randomly chosen.
| _move | the reference of the move that can be initialised by the function. | |
| _fitness | the reference of the fitness that can be initialised by the function. |
Implements eoBF< M &, M::EOType::Fitness &, void >.
Definition at line 98 of file moRandImprSelect.h.
References moRandImprSelect< M >::better_fitnesses, moRandImprSelect< M >::better_moves, and eoRng::random().
1.5.4