|
METSlib 0.5
|
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++) | |
| abstract_search & | operator== (const abstract_search< move_manager_type > &) |
| purposely not implemented (see Effective C++) | |
| virtual | ~abstract_search () |
| Virtual destructor. | |
| virtual void | search () throw (no_moves_error) =0 |
| This method starts the search. | |
| const solution_recorder & | recorder () const |
| The solution recorder instance. | |
| const feasible_solution & | working () const |
| The current working solution. | |
| feasible_solution & | working () |
| 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. | |
| int | step () const |
| The current step of the algorithm (to be used by the observers). | |
| 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. | |
| virtual void | detach (observer< abstract_search< move_manager_type > > &o) |
| Detach a new observer to this subject. | |
| virtual void | notify () |
| Notify all attached observers. | |
Protected Attributes | |
| solution_recorder & | solution_recorder_m |
| feasible_solution & | working_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 |
An abstract search.
| anonymous enum |
|
inline |
Set some common values needed for neighborhood based metaheuristics.
|
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::local_search< move_manager_type >, mets::simulated_annealing< move_manager_type >, and mets::tabu_search< move_manager_type >.
|
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.).
Return to METSlib home page