mets::simple_tabu_list Class Reference

Simplistic implementation of a tabu-list. More...

#include <mets.h>

Inherits mets::tabu_list_chain.

Inheritance diagram for mets::simple_tabu_list:

Inheritance graph
[legend]
Collaboration diagram for mets::simple_tabu_list:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::deque< move
* >::const_iterator 
const_iterator
 Tabu list iterator.
typedef std::deque< move
* >::size_type 
size_type
 Tabu list size type.

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.
const_iterator begin () const
const_iterator end () const
void tabu (feasible_solution &sol, move &mov)
 Make a m ove tabu.
bool is_tabu (feasible_solution &sol, move &mov)
 True if the move is tabu for the given solution.
virtual unsigned int tenure ()
 Tenure of this tabu list.
unsigned int tenure (unsigned int tenure_value)
 Change the tenure (length) of this tabu list.

Protected Attributes

std::deque< move * > tabu_moves_m
hash_set< mana_move *, mana_move_hash,
mana_move_eq
tabu_hash_m

Detailed Description

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==.

Definition at line 839 of file mets.h.


Member Typedef Documentation

typedef std::deque<move*>::const_iterator mets::simple_tabu_list::const_iterator

Tabu list iterator.

Definition at line 865 of file mets.h.

typedef std::deque<move*>::size_type mets::simple_tabu_list::size_type

Tabu list size type.

Definition at line 867 of file mets.h.


Constructor & Destructor Documentation

mets::simple_tabu_list::simple_tabu_list ( unsigned int  tenure  )  [inline]

Ctor. Makes a tabu list of the specified tenure.

Parameters:
tenure Tenure (length) of the tabu list

Definition at line 846 of file mets.h.

mets::simple_tabu_list::simple_tabu_list ( tabu_list_chain next,
unsigned int  tenure 
) [inline]

Ctor. Makes a tabu list of the specified tenure.

Parameters:
tenure Tenure (length) of the tabu list
next Next list to invoke when this returns false

Definition at line 855 of file mets.h.

mets::simple_tabu_list::~simple_tabu_list (  ) 

Destructor.

Definition at line 143 of file tabu-search.cc.

References tabu_moves_m.


Member Function Documentation

void mets::simple_tabu_list::tabu ( feasible_solution sol,
move mov 
) [virtual]

Make a m ove tabu.

This implementation simply remembers tenure moves.

Parameters:
sol The current working solution
mov The move to make tabu

Implements mets::tabu_list_chain.

Definition at line 151 of file tabu-search.cc.

References mets::tabu_list_chain::tabu(), tabu_hash_m, tabu_moves_m, and tenure().

Referenced by is_tabu().

bool mets::simple_tabu_list::is_tabu ( feasible_solution sol,
move mov 
) [virtual]

True if the move is tabu for the given solution.

This implementation considers tabu each move already made less then tenure() moves ago.

Parameters:
sol The current working solution
mov The move to make tabu
Returns:
True if this move was already made during the last tenure iterations

Implements mets::tabu_list_chain.

Definition at line 167 of file tabu-search.cc.

References mets::tabu_list_chain::is_tabu(), tabu(), and tabu_hash_m.

virtual unsigned int mets::simple_tabu_list::tenure (  )  [inline, virtual]

Tenure of this tabu list.

The tenure is the length of the tabu-list (the order of the tabu memory)

Reimplemented from mets::tabu_list_chain.

Definition at line 901 of file mets.h.

References mets::tabu_list_chain::tenure_m.

Referenced by tabu().

unsigned int mets::simple_tabu_list::tenure ( unsigned int  tenure_value  )  [inline, virtual]

Change the tenure (length) of this tabu list.

Parameters:
tenure,: the new tenure of the list.

Implements mets::tabu_list_chain.

Definition at line 907 of file mets.h.

References mets::tabu_list_chain::tenure_m.


The documentation for this class was generated from the following files:
Generated on Tue Nov 21 00:58:38 2006 for METSlib by  doxygen 1.5.1