class_easylocal__simulatedannealing.html

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

HTML
657
字号
<!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:34 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::SimulatedAnnealing  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::SimulatedAnnealing<p><center><img src="class_easylocal__SimulatedAnnealing_inherit_graph.gif" border="0" usemap="#easylocal::SimulatedAnnealing_inherit_map" alt="Inheritance graph"></center>
<map name="easylocal::SimulatedAnnealing_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::SimulatedAnnealing:<p><center><img src="class_easylocal__SimulatedAnnealing_coll_graph.gif" border="0" usemap="#easylocal::SimulatedAnnealing_coll_map" alt="Collaboration graph"></center>
<map name="easylocal::SimulatedAnnealing_coll_map">
<area href="class_easylocal__MoveRunner.html" shape="rect" coords="109,165,371,184">
<area href="class_easylocal__Runner.html" shape="rect" coords="0,82,192,101">
<area href="class_easylocal__StateManager.html" shape="rect" coords="127,0,353,18">
<area href="class_easylocal__NeighborhoodExplorer.html" shape="rect" coords="307,82,621,101">
<area href="class_easylocal__ProhibitionManager.html" shape="rect" coords="377,0,607,18">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_easylocal__SimulatedAnnealing-members.html">List of all members.</a><h2>Public Methods</h2>
<ul>
<li>void <a class="el" href="class_easylocal__SimulatedAnnealing.html#a0">ReadParameters</a> ()
<li>void <a class="el" href="class_easylocal__SimulatedAnnealing.html#a1">SetParameters</a> (const <a class="el" href="class_easylocal__ParameterBox.html">ParameterBox</a> &amp;pb)
<li>void <a class="el" href="class_easylocal__SimulatedAnnealing.html#a2">Print</a> (std::ostream &amp;os=std::cout) const
</ul>
<h2>Protected Methods</h2>
<ul>
<li><a class="el" href="class_easylocal__SimulatedAnnealing.html#b0">SimulatedAnnealing</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, Input *in=NULL)
<li>void <a class="el" href="class_easylocal__SimulatedAnnealing.html#b1">InitializeRun</a> ()
<li>void <a class="el" href="class_easylocal__SimulatedAnnealing.html#b2">TerminateRun</a> ()
<li>bool <a class="el" href="class_easylocal__SimulatedAnnealing.html#b3">StopCriterion</a> ()
<li>void <a class="el" href="class_easylocal__SimulatedAnnealing.html#b4">UpdateIterationCounter</a> ()
<li>void <a class="el" href="class_easylocal__SimulatedAnnealing.html#b5">SelectMove</a> ()
<li>bool <a class="el" href="class_easylocal__SimulatedAnnealing.html#b6">AcceptableMove</a> ()
</ul>
<h2>Protected Attributes</h2>
<ul>
<li>double <a class="el" href="class_easylocal__SimulatedAnnealing.html#n0">temperature</a>
<li>double <a class="el" href="class_easylocal__SimulatedAnnealing.html#n1">start_temperature</a>
<li>double <a class="el" href="class_easylocal__SimulatedAnnealing.html#n2">min_temperature</a>
<li>double <a class="el" href="class_easylocal__SimulatedAnnealing.html#n3">cooling_rate</a>
<li>unsigned int <a class="el" href="class_easylocal__SimulatedAnnealing.html#n4">neighbor_sample</a>
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class Input, class State, class Move&gt;  class easylocal::SimulatedAnnealing</h3>

The Simulated annealing runner relies on a probabilistic local search technique whose name comes from the fact that it simulates the cooling of a collection of hot vibrating atoms.
<p>
At each iteration a candidate move is generated at random, and it is always accepted if it is an improving move. Instead, if the move is a worsening one, the new solution is accepted with time decreasing probability. 
<p>

<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00739">739</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::SimulatedAnnealing::SimulatedAnnealing"></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::SimulatedAnnealing&lt; Input, State, Move &gt;::SimulatedAnnealing&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>
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 simulated annealing runner by linking it to a state manager,  a neighborhood explorer, 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>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#l01443">1443</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="b6" doxytag="easylocal::SimulatedAnnealing::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::SimulatedAnnealing&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>
A move is surely accepted if it improves the cost function or with exponentially decreasing probability if it is  a worsening one. 
<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#l01554">1554</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="b1" doxytag="easylocal::SimulatedAnnealing::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::SimulatedAnnealing&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 setting the temperature to the start value. 
<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#l01469">1469</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a2" doxytag="easylocal::SimulatedAnnealing::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::SimulatedAnnealing&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 simulated annealing 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#l01516">1516</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a0" doxytag="easylocal::SimulatedAnnealing::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::SimulatedAnnealing&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 simulated annealing 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#l01453">1453</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="b5" doxytag="easylocal::SimulatedAnnealing::SelectMove"></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::SimulatedAnnealing&lt; Input, State, Move &gt;::SelectMove (
          </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>
A move is randomly picked. 
<p>
Reimplemented from <a class="el" href="class_easylocal__MoveRunner.html#b7">easylocal::MoveRunner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01490">1490</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a1" doxytag="easylocal::SimulatedAnnealing::SetParameters"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>

⌨️ 快捷键说明

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