An abstract search. More...
#include <abstract-search.hh>

Public Types | |
| enum | { MOVE_MADE = 0, IMPROVEMENT_MADE, ITERATION_BEGIN, ITERATION_END, LAST } |
Public Member Functions | |
| abstract_search (feasible_solution &working, solution_recorder &recorder, move_manager_type &moveman) | |
| Set some common values needed for neighborhood based metaheuristics. | |
| abstract_search (const abstract_search< move_manager_type > &) | |
| purposely not implemented (see Effective C++) | |
| const move & | current_move () const |
| The last move made. | |
| move & | current_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. | |
| abstract_search & | operator== (const abstract_search< move_manager_type > &) |
| purposely not implemented (see Effective C++) | |
| const solution_recorder & | recorder () const |
| The solution recorder instance. | |
| virtual void | search ()=0 throw (no_moves_error) |
| This method starts the search. | |
| int | step () const |
| The current step of the algorithm (to be used by the observers). | |
| const feasible_solution & | working () const |
| The current working solution. | |
| feasible_solution & | working () |
| virtual | ~abstract_search () |
| Virtual destructor. | |
Protected Attributes | |
| move_manager_type::iterator | current_move_m |
| move_manager_type & | moves_m |
| solution_recorder & | solution_recorder_m |
| int | step_m |
| feasible_solution & | working_solution_m |
An abstract search.
Definition at line 80 of file abstract-search.hh.
| anonymous enum |
Definition at line 116 of file abstract-search.hh.
| mets::abstract_search< move_manager_type >::abstract_search | ( | feasible_solution & | working, |
| solution_recorder & | recorder, | ||
| move_manager_type & | moveman | ||
| ) | [inline] |
Set some common values needed for neighborhood based metaheuristics.
| working | The starting point solution (this will be modified during search as the working solution) |
| recorder | A solution recorder instance used to record the best solution found |
| moveman | A problem specific implementation of the move_manager_type used to generate the neighborhood. |
Definition at line 95 of file abstract-search.hh.
| mets::abstract_search< move_manager_type >::abstract_search | ( | const abstract_search< move_manager_type > & | ) |
purposely not implemented (see Effective C++)
| virtual mets::abstract_search< move_manager_type >::~abstract_search | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 113 of file abstract-search.hh.
| const move& mets::abstract_search< move_manager_type >::current_move | ( | ) | const [inline] |
The last move made.
Definition at line 155 of file abstract-search.hh.
| move& mets::abstract_search< move_manager_type >::current_move | ( | ) | [inline] |
The last move made.
Definition at line 160 of file abstract-search.hh.
| const move_manager_type& mets::abstract_search< move_manager_type >::move_manager | ( | ) | const [inline] |
The move manager used by this search.
Definition at line 165 of file abstract-search.hh.
| move_manager_type& mets::abstract_search< move_manager_type >::move_manager | ( | ) | [inline] |
The move manager used by this search.
Definition at line 170 of file abstract-search.hh.
| abstract_search& mets::abstract_search< move_manager_type >::operator== | ( | const abstract_search< move_manager_type > & | ) |
purposely not implemented (see Effective C++)
| const solution_recorder& mets::abstract_search< move_manager_type >::recorder | ( | ) | const [inline] |
The solution recorder instance.
Definition at line 141 of file abstract-search.hh.
| virtual void mets::abstract_search< move_manager_type >::search | ( | ) | throw (no_moves_error) [pure virtual] |
This method starts the search.
Remember that this is a minimization.
An exception mets::no_moves_error can be risen when no move is possible.
Implemented in mets::tabu_search< move_manager_type >, mets::simulated_annealing< move_manager_type >, and mets::local_search< move_manager_type >.
| int mets::abstract_search< move_manager_type >::step | ( | ) | const [inline] |
The current step of the algorithm (to be used by the observers).
When you implement a new type of search you should set step_m protected variable to the status of the algorithm (0 = "MOVE_MADE", 1 = "IMPROVEMENT_MADE", etc.).
Definition at line 180 of file abstract-search.hh.
| const feasible_solution& mets::abstract_search< move_manager_type >::working | ( | ) | const [inline] |
The current working solution.
Definition at line 146 of file abstract-search.hh.
| feasible_solution& mets::abstract_search< move_manager_type >::working | ( | ) | [inline] |
Definition at line 150 of file abstract-search.hh.
move_manager_type::iterator mets::abstract_search< move_manager_type >::current_move_m [protected] |
Definition at line 187 of file abstract-search.hh.
move_manager_type& mets::abstract_search< move_manager_type >::moves_m [protected] |
Definition at line 186 of file abstract-search.hh.
solution_recorder& mets::abstract_search< move_manager_type >::solution_recorder_m [protected] |
Definition at line 184 of file abstract-search.hh.
int mets::abstract_search< move_manager_type >::step_m [protected] |
Definition at line 188 of file abstract-search.hh.
feasible_solution& mets::abstract_search< move_manager_type >::working_solution_m [protected] |
Definition at line 185 of file abstract-search.hh.