#include <mets.h>
Public Member Functions | |
abstract_search (feasible_solution &working, feasible_solution &best_so_far, move_manager &moveman) | |
Set some common values needed for single point metaheuristics. | |
abstract_search (const abstract_search &) | |
purposely not implemented (see Effective C++) | |
virtual | ~abstract_search () |
Virtual destructor. | |
virtual void | search ()=0 throw (no_moves_error) |
This method starts the search process. | |
virtual const feasible_solution & | best () const |
The best solution so far. | |
virtual const feasible_solution & | working () const |
The current working solution. | |
virtual feasible_solution & | working () |
virtual const move & | current_move () const |
The last move made. | |
virtual move & | current_move () |
The last move made. | |
const move_manager & | get_move_manager () const |
The move manager used by this tabu search. | |
move_manager & | get_move_manager () |
The move manager used by this tabu search. | |
virtual int | step () const |
The current step of the algorithm. | |
virtual gol_type | best_cost () const |
Best solution cost so far. | |
Static Public Attributes | |
static const int | MOVE_MADE = 0 |
We just made a move. | |
static const int | IMPROVEMENT_MADE = 1 |
We just made a globel improvement. | |
Protected Attributes | |
feasible_solution & | best_solution_m |
feasible_solution & | working_solution_m |
move_manager & | moves_m |
move_manager::iterator | current_move_m |
int | step_m |
This has a method that should be implemented by subclasses to start the actual search.
mets::abstract_search::abstract_search | ( | feasible_solution & | working, | |
feasible_solution & | best_so_far, | |||
move_manager & | moveman | |||
) | [inline] |
Set some common values needed for single point metaheuristics.
working | The working solution (this will be modified during search) | |
best_so_far | A different solution instance used to store the best solution found | |
moveman | A problem specific implementation of the mets::move_manager used to generate the neighborhood. |
virtual void mets::abstract_search::search | ( | ) | throw (no_moves_error) [pure virtual] |
This method starts the search process.
Remember that this is a minimization process.
An exception mets::no_moves_error can be risen when no move is possible.
Implemented in mets::local_search, mets::simulated_annealing, and mets::tabu_search.
virtual int mets::abstract_search::step | ( | ) | const [inline, virtual] |
The current step of the algorithm.
for use of the observers.
When you implement a new type of search you should set step_m protected variable to the status of the algorithm ("MOVE_MADE", "IMPROVEMENT_MADE", etc.).
Reimplemented in mets::tabu_search.
Return to METSlib home page