solver  1.0
Classes | Public Member Functions | Private Attributes | List of all members
TabuList Class Reference

A short-term memory, containing a list of forbidden moves, that mitigates the risk of cycling. More...

#include <DataStructures.h>

+ Collaboration diagram for TabuList:

Classes

struct  Element
 An element of the tabu list. More...
 

Public Member Functions

 TabuList (const uint32_t &tabuListSize)
 Constructs a tabu list with the fixed size.
 
bool isTabu (Location *l, RobotPowerMode *from, RobotPowerMode *to) const
 It checks whether the modification of a partial solution is allowed, i.e. the move/modification is not tabu. More...
 
void addTabu (Location *l, RobotPowerMode *from, RobotPowerMode *to)
 It adds a performed modification into the tabu list. More...
 
void diversify ()
 

Private Attributes

uint32_t mListIdx
 Current index to the tabu list, i.e. a current write position.
 
std::vector< ElementmTabu
 Tabu list containing the forbidden modifications.
 

Detailed Description

A short-term memory, containing a list of forbidden moves, that mitigates the risk of cycling.

Tabu search meta-heuristic employs a tabu list, a list of recently performed modifications, to avoid cycling in the solution space. The list is a short-term memory, i.e. the oldest modifications are gradually replaced by the newer ones, that allows to intensify the searching process.

See also
HeuristicAlgorithms::heuristicPowerModeSelection

Definition at line 254 of file DataStructures.h.

Member Function Documentation

void TabuList::addTabu ( Location l,
RobotPowerMode from,
RobotPowerMode to 
)
inline

It adds a performed modification into the tabu list.

Parameters
lA location where the selected power saving mode was applied.
from,toThe power saving mode from was switched to to.

Definition at line 274 of file DataStructures.h.

void TabuList::diversify ( )
inline

If the tabu list contains all the viable modifications, i.e. there is not a modification that could be applied, then some random tabu list elements are removed to allow the sub-heuristic to progress.

Definition at line 288 of file DataStructures.h.

bool TabuList::isTabu ( Location l,
RobotPowerMode from,
RobotPowerMode to 
) const
inline

It checks whether the modification of a partial solution is allowed, i.e. the move/modification is not tabu.

Parameters
lA location where the selected power saving mode will be changed.
from,toThe power saving mode of the robot will be switched from from to to.
Returns
Whether the modification is allowed.

Definition at line 265 of file DataStructures.h.


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