class_easylocal__tabusearch.html

来自「一个tabu search算法框架」· HTML 代码 · 共 606 行 · 第 1/2 页

HTML
606
字号
<!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:38 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::TabuSearch  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::TabuSearch<p><center><img src="class_easylocal__TabuSearch_inherit_graph.gif" border="0" usemap="#easylocal::TabuSearch_inherit_map" alt="Inheritance graph"></center>
<map name="easylocal::TabuSearch_inherit_map">
<area href="class_easylocal__MoveRunner.html" shape="rect" coords="0,67,261,85">
<area href="class_easylocal__Runner.html" shape="rect" coords="35,0,227,19">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for easylocal::TabuSearch:<p><center><img src="class_easylocal__TabuSearch_coll_graph.gif" border="0" usemap="#easylocal::TabuSearch_coll_map" alt="Collaboration graph"></center>
<map name="easylocal::TabuSearch_coll_map">
<area href="class_easylocal__MoveRunner.html" shape="rect" coords="145,165,407,184">
<area href="class_easylocal__Runner.html" shape="rect" coords="0,82,192,101">
<area href="class_easylocal__StateManager.html" shape="rect" coords="137,0,364,18">
<area href="class_easylocal__NeighborhoodExplorer.html" shape="rect" coords="307,82,621,101">
<area href="class_easylocal__ProhibitionManager.html" shape="rect" coords="408,0,637,18">
<area href="class_easylocal__TabuListManager.html" shape="rect" coords="645,82,864,101">
<area href="class_easylocal__ListItem.html" shape="rect" coords="671,0,839,18">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_easylocal__TabuSearch-members.html">List of all members.</a><h2>Public Methods</h2>
<ul>
<li>void <a class="el" href="class_easylocal__TabuSearch.html#a0">ReadParameters</a> ()
<li>void <a class="el" href="class_easylocal__TabuSearch.html#a1">Print</a> (std::ostream &amp;os=std::cout) const
<li>void <a class="el" href="class_easylocal__TabuSearch.html#a2">SetInput</a> (Input *in)
<li>void <a class="el" href="class_easylocal__TabuSearch.html#a3">SetParameters</a> (const <a class="el" href="class_easylocal__ParameterBox.html">ParameterBox</a> &amp;pb)
</ul>
<h2>Protected Methods</h2>
<ul>
<li><a class="el" href="class_easylocal__TabuSearch.html#b0">TabuSearch</a> (<a class="el" href="class_easylocal__StateManager.html">StateManager</a>&lt; Input, State &gt; *s, <a class="el" href="class_easylocal__NeighborhoodExplorer.html">NeighborhoodExplorer</a>&lt; Input, State, Move &gt; *ne, <a class="el" href="class_easylocal__TabuListManager.html">TabuListManager</a>&lt; Move &gt; *tlm, Input *in=NULL)
<li>void <a class="el" href="class_easylocal__TabuSearch.html#b1">SetTabuListManager</a> (<a class="el" href="class_easylocal__TabuListManager.html">TabuListManager</a>&lt; Move &gt; *tlm, int min_tabu=0, int max_tabu=0)
<li>void <a class="el" href="class_easylocal__TabuSearch.html#b2">InitializeRun</a> ()
<li>bool <a class="el" href="class_easylocal__TabuSearch.html#b3">StopCriterion</a> ()
<li>void <a class="el" href="class_easylocal__TabuSearch.html#b4">SelectMove</a> ()
<li>bool <a class="el" href="class_easylocal__TabuSearch.html#b5">AcceptableMove</a> ()
<li>void <a class="el" href="class_easylocal__TabuSearch.html#b6">StoreMove</a> ()
</ul>
<h2>Protected Attributes</h2>
<ul>
<li><a class="el" href="class_easylocal__TabuListManager.html">TabuListManager</a>&lt;Move&gt;* <a class="el" href="class_easylocal__TabuSearch.html#n0">p_pm</a>
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class Input, class State, class Move&gt;  class easylocal::TabuSearch</h3>

The Tabu Search runner explores a subset of the current neighborhood. Among the elements in it, the one that gives the minimum value of the cost function becomes the new current state, independently of the fact whether its value is less or greater than the current one.
<p>
Such a choice allows the algorithm to escape from local minima, but creates the risk of cycling among a set of states. In order to prevent cycling, the so-called tabu list is used, which determines the forbidden moves. This list stores the most recently accepted moves, and the inverses of the moves in the list are forbidden. 
<p>

<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00707">707</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::TabuSearch::TabuSearch"></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 Input, class State, class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
easylocal::TabuSearch&lt; Input, State, Move &gt;::TabuSearch&lt;Input, State, Move&gt; (
          </b></td>
          <td valign="bottom"><b>
<a class="el" href="class_easylocal__StateManager.html">StateManager</a>&lt; Input, State &gt; * <em>s</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
<a class="el" href="class_easylocal__NeighborhoodExplorer.html">NeighborhoodExplorer</a>&lt; Input, State, Move &gt; * <em>ne</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
<a class="el" href="class_easylocal__TabuListManager.html">TabuListManager</a>&lt; Move &gt; * <em>tlm</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
Input * <em>in</em> = NULL&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 search runner by linking it to a state manager,  a neighborhood explorer, a tabu list manager, and an input object.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>s</em>
&nbsp;</td><td>
 a pointer to a compatible state manager </td></tr>
<tr><td valign=top><em>ne</em>
&nbsp;</td><td>
 a pointer to a compatible neighborhood explorer </td></tr>
<tr><td valign=top><em>tlm</em>
&nbsp;</td><td>
 a pointer to a compatible tabu list manager </td></tr>
<tr><td valign=top><em>in</em>
&nbsp;</td><td>
 a poiter to an input object </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01282">1282</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="b5" doxytag="easylocal::TabuSearch::AcceptableMove"></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 Input, class State, class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
bool easylocal::TabuSearch&lt; Input, State, Move &gt;::AcceptableMove (
          </b></td>
          <td valign="bottom"><b>
)<code> [protected, virtual]</code>
          </b></td>
        </tr>

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

<p>
In tabu search the selected move is always accepted. That is, the acceptability test is replaced by the  prohibition mechanism which is managed inside the selection. 
<p>
Reimplemented from <a class="el" href="class_easylocal__MoveRunner.html#b8">easylocal::MoveRunner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01371">1371</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="b2" doxytag="easylocal::TabuSearch::InitializeRun"></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 Input, class State, class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::TabuSearch&lt; Input, State, Move &gt;::InitializeRun (
          </b></td>
          <td valign="bottom"><b>
)<code> [protected, virtual]</code>
          </b></td>
        </tr>

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

<p>
Initializes the run by invoking the companion superclass method, and cleans the tabu list. 
<p>
Reimplemented from <a class="el" href="class_easylocal__MoveRunner.html#b1">easylocal::MoveRunner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01342">1342</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a1" doxytag="easylocal::TabuSearch::Print"></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 Input, class State, class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::TabuSearch&lt; Input, State, Move &gt;::Print (
          </b></td>
          <td valign="bottom"><b>
std::ostream &amp; <em>os</em> = std::cout&nbsp;) const<code> [virtual]</code>
          </b></td>
        </tr>

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

<p>
Outputs some tabu search statistics on a given output stream.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>os</em>
&nbsp;</td><td>
 the output stream </td></tr>
</table>
</dl>
<p>
Reimplemented from <a class="el" href="class_easylocal__MoveRunner.html#a15">easylocal::MoveRunner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01411">1411</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a0" doxytag="easylocal::TabuSearch::ReadParameters"></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 Input, class State, class Move&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::TabuSearch&lt; Input, State, Move &gt;::ReadParameters (
          </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>
Reads the tabu search parameters from the standard input. 
<p>
Reimplemented from <a class="el" href="class_easylocal__Runner.html#a13">easylocal::Runner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01309">1309</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="b4" doxytag="easylocal::TabuSearch::SelectMove"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>

⌨️ 快捷键说明

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