METSlib  0.6
Public Types | Public Member Functions | Protected Attributes | List of all members
mets::tabu_search< move_manager_type > Class Template Reference

Tabu Search algorithm. More...

#include <tabu-search.hh>

Inheritance diagram for mets::tabu_search< move_manager_type >:
Inheritance graph
Collaboration diagram for mets::tabu_search< move_manager_type >:
Collaboration graph

Public Types

enum  { ASPIRATION_CRITERIA_MET = abstract_search<move_manager_type>::LAST, LAST }
 
typedef tabu_search
< move_manager_type > 
search_type
 
- Public Types inherited from mets::abstract_search< move_manager_type >
enum  {
  MOVE_MADE = 0, IMPROVEMENT_MADE, ITERATION_BEGIN, ITERATION_END,
  LAST
}
 

Public Member Functions

 tabu_search (feasible_solution &starting_solution, solution_recorder &best_recorder, move_manager_type &move_manager_inst, tabu_list_chain &tabus, aspiration_criteria_chain &aspiration, termination_criteria_chain &termination)
 Creates a tabu Search instance. More...
 
 tabu_search (const search_type &)
 
search_typeoperator= (const search_type &)
 
void throw (no_moves_error)
 This method starts the tabu search process. More...
 
const tabu_list_chainget_tabu_list () const
 The tabu list used by this tabu search.
 
const aspiration_criteria_chainget_aspiration_criteria () const
 The aspiration criteria used by this tabu search.
 
const termination_criteria_chainget_termination_criteria () const
 The termination criteria used by this tabu search.
 
- Public Member Functions inherited from mets::abstract_search< move_manager_type >
 abstract_search (feasible_solution &working, solution_recorder &recorder, move_manager_type &moveman)
 Set some common values needed for neighborhood based metaheuristics. More...
 
 abstract_search (const abstract_search< move_manager_type > &)
 purposely not implemented (see Effective C++)
 
abstract_searchoperator== (const abstract_search< move_manager_type > &)
 purposely not implemented (see Effective C++)
 
virtual ~abstract_search ()
 Virtual destructor.
 
const solution_recorderrecorder () const
 The solution recorder instance.
 
const feasible_solutionworking () const
 The current working solution.
 
feasible_solutionworking ()
 
const movecurrent_move () const
 The last move made.
 
movecurrent_move ()
 The last move made.
 
const move_manager_type & move_manager () const
 The move manager used by this search.
 
move_manager_type & move_manager ()
 The move manager used by this search.
 
int step () const
 The current step of the algorithm (to be used by the observers). More...
 
- Public Member Functions inherited from mets::subject< abstract_search< move_manager_type > >
virtual void attach (observer< abstract_search< move_manager_type > > &o)
 Attach a new observer to this subject. More...
 
virtual void detach (observer< abstract_search< move_manager_type > > &o)
 Detach a new observer to this subject. More...
 
virtual void notify ()
 Notify all attached observers. More...
 

Protected Attributes

tabu_list_chaintabu_list_m
 
aspiration_criteria_chainaspiration_criteria_m
 
termination_criteria_chaintermination_criteria_m
 
- Protected Attributes inherited from mets::abstract_search< move_manager_type >
solution_recordersolution_recorder_m
 
feasible_solutionworking_solution_m
 
move_manager_type & moves_m
 
move_manager_type::iterator current_move_m
 
int step_m
 
- Protected Attributes inherited from mets::subject< abstract_search< move_manager_type > >
std::set< observer
< abstract_search
< move_manager_type > > * > 
observers_m
 

Detailed Description

template<typename move_manager_type>
class mets::tabu_search< move_manager_type >

Tabu Search algorithm.

This implements decorator pattern. You can build many different solvers decorating tabu_search class in different ways.

Constructor & Destructor Documentation

template<typename move_manager_type >
mets::tabu_search< move_manager_type >::tabu_search ( feasible_solution starting_solution,
solution_recorder best_recorder,
move_manager_type &  move_manager_inst,
tabu_list_chain tabus,
aspiration_criteria_chain aspiration,
termination_criteria_chain termination 
)

Creates a tabu Search instance.

Parameters
starting_solutionThe working solution (this will be modified during search).
best_recorderA solution recorder used to record the best solution found during the search.
move_manager_instA problem specific implementation of the move_manager_type used to generate the neighborhood.
tabusThe tabu list used to decorate this search instance.
aspirationThe aspiration criteria to use in this tabu search.
terminationThe termination criteria used to terminate the search process, this is an extension to the standard Simulated Annealing: you can give a termination criteria that termiantes when temperature reaches 0.

Member Function Documentation

template<typename move_manager_type >
void mets::tabu_search< move_manager_type >::throw ( no_moves_error  )
virtual

This method starts the tabu search process.

Remember that this is a minimization process.

An exception mets::no_moves_error is risen when no move is possible.

Implements mets::abstract_search< move_manager_type >.


The documentation for this class was generated from the following file:

Return to METSlib home page