📄 class_easylocal__tabulistmanager.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>EasyLocal++ Documentation</title>
<link href="local.css" rel="stylesheet" type="text/css">
</head>
<body lang="en">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="2"><h1 class="nojustify">EasyLocal++ Documentation</h1>
<hr>
</td>
</tr>
<tr>
<td width="30" align="center"> </td>
<td>
<!-- Generated by Doxygen 1.2.5 on Sat Jun 9 18:59:37 2001 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center>
<hr><h1>easylocal::TabuListManager Class Template Reference</h1><code>#include <<a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>></code>
<p>
Inheritance diagram for easylocal::TabuListManager<p><center><img src="class_easylocal__TabuListManager_inherit_graph.gif" border="0" usemap="#easylocal::TabuListManager_inherit_map" alt="Inheritance graph"></center>
<map name="easylocal::TabuListManager_inherit_map">
<area href="class_easylocal__ProhibitionManager.html" shape="rect" coords="0,0,229,18">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for easylocal::TabuListManager:<p><center><img src="class_easylocal__TabuListManager_coll_graph.gif" border="0" usemap="#easylocal::TabuListManager_coll_map" alt="Collaboration graph"></center>
<map name="easylocal::TabuListManager_coll_map">
<area href="class_easylocal__ProhibitionManager.html" shape="rect" coords="0,0,229,18">
<area href="class_easylocal__ListItem.html" shape="rect" coords="253,0,421,18">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_easylocal__TabuListManager-members.html">List of all members.</a><h2>Public Methods</h2>
<ul>
<li>void <a class="el" href="class_easylocal__TabuListManager.html#a0">InsertMove</a> (const Move &mv, fvalue mv_cost, fvalue curr, fvalue best)
<li>bool <a class="el" href="class_easylocal__TabuListManager.html#a1">ProhibitedMove</a> (const Move &mv, fvalue mv_cost, fvalue curr, fvalue best) const
<li>void <a class="el" href="class_easylocal__TabuListManager.html#a2">SetLength</a> (unsigned int min, unsigned int max)
<li>void <a class="el" href="class_easylocal__TabuListManager.html#a3">Clean</a> ()
<li>unsigned int <a class="el" href="class_easylocal__TabuListManager.html#a4">MinTenure</a> () const
<li>unsigned int <a class="el" href="class_easylocal__TabuListManager.html#a5">MaxTenure</a> () const
<li>virtual bool <a class="el" href="class_easylocal__TabuListManager.html#a6">Inverse</a> (const Move &mv1, const Move &mv2) const=0
</ul>
<h2>Protected Methods</h2>
<ul>
<li><a class="el" href="class_easylocal__TabuListManager.html#b0">TabuListManager</a> (int min=0, int max=0)
<li>virtual <a class="el" href="class_easylocal__TabuListManager.html#b1">~TabuListManager</a> ()
<li>virtual bool <a class="el" href="class_easylocal__TabuListManager.html#b2">Aspiration</a> (const Move &, fvalue mv_cost, fvalue curr, fvalue best) const
<li>void <a class="el" href="class_easylocal__TabuListManager.html#b3">InsertIntoList</a> (const Move &mv)
<li>void <a class="el" href="class_easylocal__TabuListManager.html#b4">UpdateAspirationFunction</a> (fvalue mv_cost, fvalue curr_cost, fvalue best_cost)
<li>bool <a class="el" href="class_easylocal__TabuListManager.html#b5">ListMember</a> (const Move &) const
</ul>
<h2>Protected Attributes</h2>
<ul>
<li>unsigned int <a class="el" href="class_easylocal__TabuListManager.html#n0">min_tenure</a>
<li>unsigned int <a class="el" href="class_easylocal__TabuListManager.html#n1">max_tenure</a>
<li>unsigned long <a class="el" href="class_easylocal__TabuListManager.html#n2">iter</a>
<li>std::list<<a class="el" href="class_easylocal__ListItem.html">ListItem</a><Move> > <a class="el" href="class_easylocal__TabuListManager.html#n3">tlist</a>
</ul>
<h2>Friends</h2>
<ul>
<li>std::ostream& <a class="el" href="class_easylocal__TabuListManager.html#l0">operator<<</a> (std::ostream &, const TabuListManager< Move > &)
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<class Move> class easylocal::TabuListManager</h3>
The Tabu List Manager handles a list of <code>Move</code> elements according to the prohibition mechanisms of tabu search. Namely it maintains an item in the list for a number of iterations that varies randomly in a given range. Each time a new <code>Move</code> is inserted in the list, the ones which their iteration count has expired are removed.
<p>
<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00235">235</a> of file <a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
<a name="b0" doxytag="easylocal::TabuListManager::TabuListManager"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
easylocal::TabuListManager< Move >::TabuListManager<Move> (
</b></td>
<td valign="bottom"><b>
int <em>min</em> = 0,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
int <em>max</em> = 0 )<code> [protected]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructs a tabu list manager object which manages a list of the given tenure (i.e., the number of steps a move is considered tabu).<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>min</em>
</td><td>
the minimum tabu tenure </td></tr>
<tr><td valign=top><em>max</em>
</td><td>
the maximum tabu tenure </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00250">250</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>. </td>
</tr>
</table>
<a name="b1" doxytag="easylocal::TabuListManager::~TabuListManager"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
easylocal::TabuListManager<Move>::~TabuListManager<Move> (
</b></td>
<td valign="bottom"><b>
)<code> [inline, protected, virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Virtual destructor.
<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00273">273</a> of file <a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="b2" doxytag="easylocal::TabuListManager::Aspiration"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
bool easylocal::TabuListManager< Move >::Aspiration (
</b></td>
<td valign="bottom"><b>
const Move & <em>mv</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
fvalue <em>mv_cost</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
fvalue <em>curr</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
fvalue <em>best</em> ) const<code> [protected, virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Checks whether the aspiration criterion is satisfied for a given move. By default, it verifies if the move cost applied to the current state gives a value lower than the best state cost found so far.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>mv</em>
</td><td>
the move </td></tr>
<tr><td valign=top><em>mv_cost</em>
</td><td>
the move cost </td></tr>
<tr><td valign=top><em>curr</em>
</td><td>
the cost of the current state </td></tr>
<tr><td valign=top><em>best</em>
</td><td>
the cost of the best state found so far </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
true if the aspiration criterion is satisfied, false otherwise </dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00340">340</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.
<p>
Referenced by <a class="el" href="EasyLocalTemplates_cpp-source.html#l00279">ProhibitedMove</a>(). </td>
</tr>
</table>
<a name="a3" doxytag="easylocal::TabuListManager::Clean"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
void easylocal::TabuListManager< Move >::Clean (
</b></td>
<td valign="bottom"><b>
)<code> [virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Deletes all the elements of the tabu list.
<p>
Reimplemented from <a class="el" href="class_easylocal__ProhibitionManager.html#a2">easylocal::ProhibitionManager</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00286">286</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>. </td>
</tr>
</table>
<a name="b3" doxytag="easylocal::TabuListManager::InsertIntoList"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
void easylocal::TabuListManager< Move >::InsertIntoList (
</b></td>
<td valign="bottom"><b>
const Move & <em>mv</em> )<code> [protected]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Inserts the move into the tabu list, and update the list removing the moves for which the tenure has elapsed.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>mv</em>
</td><td>
the move to add </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00350">350</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.
<p>
Referenced by <a class="el" href="EasyLocalTemplates_cpp-source.html#l00263">InsertMove</a>(). </td>
</tr>
</table>
<a name="a0" doxytag="easylocal::TabuListManager::InsertMove"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
void easylocal::TabuListManager< Move >::InsertMove (
</b></td>
<td valign="bottom"><b>
const Move & <em>mv</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
fvalue <em>mv_cost</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
fvalue <em>curr</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
fvalue <em>best</em> )<code> [virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Inserts the move in the tabu list and updates the aspiration function.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>mv</em>
</td><td>
the move to add </td></tr>
<tr><td valign=top><em>mv_cost</em>
</td><td>
the move cost </td></tr>
<tr><td valign=top><em>best</em>
</td><td>
the best state cost found so far </td></tr>
</table>
</dl>
<p>
Reimplemented from <a class="el" href="class_easylocal__ProhibitionManager.html#a0">easylocal::ProhibitionManager</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00263">263</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>. </td>
</tr>
</table>
<a name="a6" doxytag="easylocal::TabuListManager::Inverse"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
bool easylocal::TabuListManager<Move>::Inverse (
</b></td>
<td valign="bottom"><b>
const Move & <em>mv1</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
const Move & <em>mv2</em> ) const<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Verifies whether a move is the inverse of another one. Namely it tests whether mv1 is the inverse of mv2 (that will be an element of the tabu list). <dl compact><dt>
<b>Note: </b><dd>
@bf To be implemented in the application. </dl><dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>mv1</em>
</td><td>
the move to be tested </td></tr>
<tr><td valign=top><em>mv2</em>
</td><td>
the move used for comparison </td></tr>
</table>
</dl>
<p>
Referenced by <a class="el" href="EasyLocalTemplates_cpp-source.html#l00297">ListMember</a>(). </td>
</tr>
</table>
<a name="b5" doxytag="easylocal::TabuListManager::ListMember"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2"><b>
template<class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
bool easylocal::TabuListManager< Move >::ListMember (
</b></td>
<td valign="bottom"><b>
const Move & <em>mv</em> ) const<code> [protected]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -