mets::abstract_search Class Reference

#include <mets.h>

Inheritance diagram for mets::abstract_search:

Inheritance graph
[legend]
Collaboration diagram for mets::abstract_search:

Collaboration graph
[legend]

List of all members.


Detailed Description

An abstract search process.

This has a method that should be implemented by subclasses to start the actual search.

See also:
mets::tabu_search, mets::simulated_annealing, mets::local_search

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_solutionbest () const
 The best solution so far.
virtual const feasible_solutionworking () const
 The current working solution.
virtual feasible_solutionworking ()
virtual const movecurrent_move () const
 The last move made.
virtual movecurrent_move ()
 The last move made.
const move_managerget_move_manager () const
 The move manager used by this tabu search.
move_managerget_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_solutionbest_solution_m
feasible_solutionworking_solution_m
move_managermoves_m
move_manager::iterator current_move_m
int step_m

Constructor & Destructor Documentation

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.

Parameters:
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.


Member Function Documentation

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.


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

Return to METSlib home page