METSlib
0.6
|
Local search algorithm. More...
#include <local-search.hh>
Public Member Functions | |
local_search (evaluable_solution &starting_point, solution_recorder &recorder, move_manager_type &moveman, gol_type epsilon=1e-7, bool short_circuit=false) | |
Creates a local search instance. More... | |
local_search (const local_search &) | |
purposely not implemented (see Effective C++) | |
local_search & | operator= (const local_search &) |
virtual void | throw (no_moves_error) |
This method starts the local search process. More... | |
![]() | |
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_search & | operator== (const abstract_search< move_manager_type > &) |
purposely not implemented (see Effective C++) | |
virtual | ~abstract_search () |
Virtual destructor. | |
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). More... | |
![]() | |
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 | |
bool | short_circuit_m |
gol_type | epsilon_m |
![]() | |
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 |
![]() | |
std::set< observer < abstract_search < move_manager_type > > * > | observers_m |
Additional Inherited Members | |
![]() | |
enum | { MOVE_MADE = 0, IMPROVEMENT_MADE, ITERATION_BEGIN, ITERATION_END, LAST } |
Local search algorithm.
With customary phase alternation and move managers generated neighborhood this can be used to do also a Random Restart Local Search, a Greedy Search, an Iterated Local Search and a Variable Neighborhood Search.
mets::local_search< move_manager_type >::local_search | ( | evaluable_solution & | starting_point, |
solution_recorder & | recorder, | ||
move_manager_type & | moveman, | ||
gol_type | epsilon = 1e-7 , |
||
bool | short_circuit = false |
||
) |
Creates a local search instance.
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 move_manager_type concept used to generate the neighborhood. |
short_circuit | Wether the search should stop on the first improving move or not. |
|
virtual |
This method starts the local search process.
To have a real local search you should provide an move_manager_type than enumerates all feasible moves.
Implements mets::abstract_search< move_manager_type >.
Return to METSlib home page