_Graph | The graph type the algorithm runs on. | |
_Value | The values' type associated to the nodes. | |
_Policy | Controlls the search. Determinates when to stop, or how manage stuck search. Default value is IterationPolicy . | |
_Traits | Collection of needed types. Default value is TabuSearchDefaultTraits . |
#include <lemon/tabu_search.h>
Classes | |
class | BadParameterError |
Thrown by setting the size of the tabu-set and the given size is less than 2. More... | |
Public Types | |
typedef TabuSearch< GRAPH, VALUE, POLICY, TRAITS > | SelfType |
Public types. | |
Public Member Functions | |
TabuSearch (const Graph &graph, const HeightMap &hm, const int tabusz=3, Policy p=Policy()) | |
Constructor. | |
~TabuSearch () | |
Destructor. | |
void | tabuSize (const unsigned int size) |
Set/Get the size of the tabu set. | |
void | policy (Policy p) |
Set/Get Policy. | |
Execution control | |
The simplest way to execute the algorithm is to use the member functions called run ( 'startnode' ). | |
void | init (const Node startn) |
Initializes the internal data. | |
bool | step () |
Does one iteration. | |
void | run (const Node startn) |
Runs a search while the Policy stops it. | |
Query Functions | |
Node | current () const |
The node, the search is standing on. | |
Node | best () const |
The best node found until now. | |
TabuIterator | tabu_begin () const |
Beginning to iterate on the current tabu set. | |
TabuIterator | tabu_end () const |
Ending to iterate on the current tabu set. | |
Protected Attributes | |
std::deque< Node > | tabu |
The tabu set. Teh current node is the first. | |
unsigned int | mts |
Maximal tabu size. | |
Node | b |
The best Node found. |
TabuSearch | ( | const Graph & | graph, | |
const HeightMap & | hm, | |||
const int | tabusz = 3 , |
|||
Policy | p = Policy() | |||
) | [inline] |
graph | the graph the algorithm will run on. | |
hm | the height map used by the algorithm. | |
tabusz | the maximal size of the tabu set. Default value is 3 | |
p | the Policy controlling the search. |
void init | ( | const Node | startn | ) | [inline] |
startn | The start node where the search begins. |
bool step | ( | ) | [inline] |
If the Policy allows it searches for the best next node, then steps onto it.
Request premmision from ControllPolicy
Find the best next potential node
Handle stuck search
Move on...
void run | ( | const Node | startn | ) | [inline] |
startn | The start node where the search begins. |