#include <moRandImprSelect.h>
Inheritance diagram for moRandImprSelect< M >:

Public Types | |
| typedef M::EOType::Fitness | Fitness |
| Alias for the fitness. | |
Public Member Functions | |
| void | init (const Fitness &__fit) |
| Procedure which all that needs a moRandImprSelect. | |
| bool | update (const M &__move, const Fitness &__fit) |
| Function that updates the fitness and move vectors. | |
| void | operator() (M &__move, Fitness &__fit) throw (EmptySelection) |
| The move selection. | |
Private Attributes | |
| Fitness | init_fit |
| Fitness of the current solution. | |
| std::vector< Fitness > | vect_better_fit |
| Candidate fitnesse vector. | |
| std::vector< M > | vect_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 25 of file moRandImprSelect.h.
| void moRandImprSelect< M >::init | ( | const Fitness & | __fit | ) | [inline, virtual] |
Procedure which all that needs a moRandImprSelect.
Give a value to the initialise fitness. Clean the move and fitness vectors.
| __fit | the current best fitness |
Implements moMoveSelect< M >.
Definition at line 40 of file moRandImprSelect.h.
References moRandImprSelect< M >::init_fit, moRandImprSelect< M >::vect_better_fit, and moRandImprSelect< M >::vect_better_moves.
| bool moRandImprSelect< M >::update | ( | const M & | __move, | |
| const Fitness & | __fit | |||
| ) | [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. | |
| __fit | a new fitness associated to the new move. |
Implements moMoveSelect< M >.
Definition at line 56 of file moRandImprSelect.h.
References moRandImprSelect< M >::init_fit, moRandImprSelect< M >::vect_better_fit, and moRandImprSelect< M >::vect_better_moves.
| void moRandImprSelect< M >::operator() | ( | M & | __move, | |
| Fitness & | __fit | |||
| ) | throw (EmptySelection) [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. | |
| __fit | the reference of the fitness that can be initialised by the function. |
| EmptySelection | If no move which improves the current fitness are found. |
Implements eoBF< M &, M::EOType::Fitness &, void >.
Definition at line 77 of file moRandImprSelect.h.
References moRandImprSelect< M >::vect_better_fit, and moRandImprSelect< M >::vect_better_moves.
1.5.1