Simplistic implementation of a tabu-list. More...
#include <tabu-search.hh>
Public Member Functions | |
simple_tabu_list (unsigned int tenure) | |
Ctor. Makes a tabu list of the specified tenure. | |
simple_tabu_list (tabu_list_chain *next, unsigned int tenure) | |
Ctor. Makes a tabu list of the specified tenure. | |
~simple_tabu_list () | |
Destructor. | |
void | tabu (feasible_solution &sol, move &mov) |
Make move a tabu. | |
bool | is_tabu (feasible_solution &sol, move &mov) const |
True if the move is tabu for the given solution. | |
Protected Types | |
typedef std::deque< move * > | move_list_type |
typedef std::tr1::unordered_map < mana_move *, int, mana_move_hash, dereferenced_equal_to < mana_move * > > | move_map_type |
Protected Attributes | |
move_list_type | tabu_moves_m |
move_map_type | tabu_hash_m |
Simplistic implementation of a tabu-list.
This class implements one of the simplest and less memory hungry tabu lists. This tabu list memorizes only the moves (not the solutions).
Moves must be of mets::mana_move type.
The comparison between moves is demanded to the move implementation.
A mets::mana_move is tabu if it's in the tabu list by means of its operator== and hash function.
mets::simple_tabu_list::simple_tabu_list | ( | unsigned int | tenure | ) | [inline] |
Ctor. Makes a tabu list of the specified tenure.
tenure | Tenure (length) of the tabu list |
mets::simple_tabu_list::simple_tabu_list | ( | tabu_list_chain * | next, | |
unsigned int | tenure | |||
) | [inline] |
Ctor. Makes a tabu list of the specified tenure.
tenure | Tenure (length) of the tabu list | |
next | Next list to invoke when this returns false |
bool mets::simple_tabu_list::is_tabu | ( | feasible_solution & | sol, | |
move & | mov | |||
) | const [virtual] |
True if the move is tabu for the given solution.
This implementation considers tabu each move already made less then tenure() moves ago.
sol | The current working solution | |
mov | The move to make tabu |
Implements mets::tabu_list_chain.
void mets::simple_tabu_list::tabu | ( | feasible_solution & | sol, | |
move & | mov | |||
) | [virtual] |
Make move a tabu.
This implementation simply remembers "tenure" moves.
sol | The current working solution | |
mov | The move to make tabu |
Implements mets::tabu_list_chain.
Return to METSlib home page