⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class_easylocal__tabulistmanager.html

📁 一个tabu search算法框架
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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">&nbsp;</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> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>easylocal::TabuListManager  Class Template Reference</h1><code>#include &lt;<a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>&gt;</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 &amp;mv, fvalue mv_cost, fvalue curr, fvalue best)
<li>bool <a class="el" href="class_easylocal__TabuListManager.html#a1">ProhibitedMove</a> (const Move &amp;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 &amp;mv1, const Move &amp;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 &amp;, fvalue mv_cost, fvalue curr, fvalue best) const
<li>void <a class="el" href="class_easylocal__TabuListManager.html#b3">InsertIntoList</a> (const Move &amp;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 &amp;) 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&lt;<a class="el" href="class_easylocal__ListItem.html">ListItem</a>&lt;Move&gt; &gt; <a class="el" href="class_easylocal__TabuListManager.html#n3">tlist</a>
</ul>
<h2>Friends</h2>
<ul>
<li>std::ostream&amp; <a class="el" href="class_easylocal__TabuListManager.html#l0">operator&lt;&lt;</a> (std::ostream &amp;, const TabuListManager&lt; Move &gt; &amp;)
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class Move&gt;  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 &amp; 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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
easylocal::TabuListManager&lt; Move &gt;::TabuListManager&lt;Move&gt; (
          </b></td>
          <td valign="bottom"><b>
int <em>min</em> = 0, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
int <em>max</em> = 0&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</td><td>
 the minimum tabu tenure </td></tr>
<tr><td valign=top><em>max</em>
&nbsp;</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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
easylocal::TabuListManager&lt;Move&gt;::~TabuListManager&lt;Move&gt; (
          </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>
      &nbsp;
    </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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
bool easylocal::TabuListManager&lt; Move &gt;::Aspiration (
          </b></td>
          <td valign="bottom"><b>
const Move &amp; <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>&nbsp;) const<code> [protected, virtual]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</td><td>
 the move </td></tr>
<tr><td valign=top><em>mv_cost</em>
&nbsp;</td><td>
 the move cost </td></tr>
<tr><td valign=top><em>curr</em>
&nbsp;</td><td>
 the cost of the current state </td></tr>
<tr><td valign=top><em>best</em>
&nbsp;</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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::TabuListManager&lt; Move &gt;::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>
      &nbsp;
    </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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::TabuListManager&lt; Move &gt;::InsertIntoList (
          </b></td>
          <td valign="bottom"><b>
const Move &amp; <em>mv</em>&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::TabuListManager&lt; Move &gt;::InsertMove (
          </b></td>
          <td valign="bottom"><b>
const Move &amp; <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>&nbsp;)<code> [virtual]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</td><td>
 the move to add </td></tr>
<tr><td valign=top><em>mv_cost</em>
&nbsp;</td><td>
 the move cost </td></tr>
<tr><td valign=top><em>best</em>
&nbsp;</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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
bool easylocal::TabuListManager&lt;Move&gt;::Inverse (
          </b></td>
          <td valign="bottom"><b>
const Move &amp; <em>mv1</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
const Move &amp; <em>mv2</em>&nbsp;) const<code> [pure virtual]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</td><td>
 the move to be tested </td></tr>
<tr><td valign=top><em>mv2</em>
&nbsp;</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&lt;class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
bool easylocal::TabuListManager&lt; Move &gt;::ListMember (
          </b></td>
          <td valign="bottom"><b>
const Move &amp; <em>mv</em>&nbsp;) const<code> [protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -