class_easylocal__localsearchsolver.html

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

HTML
782
字号
<!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:25 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::LocalSearchSolver  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::LocalSearchSolver<p><center><img src="class_easylocal__LocalSearchSolver_inherit_graph.gif" border="0" usemap="#easylocal::LocalSearchSolver_inherit_map" alt="Inheritance graph"></center>
<map name="easylocal::LocalSearchSolver_inherit_map">
<area href="class_easylocal__MultiRunnerSolver.html" shape="rect" coords="96,200,269,218">
<area href="class_easylocal__SimpleLocalSearch.html" shape="rect" coords="293,200,467,218">
<area href="class_easylocal__Solver.html" shape="rect" coords="183,66,380,85">
<area href="class_easylocal__AbstractSolver.html" shape="rect" coords="207,0,356,18">
<area href="class_easylocal__ComparativeSolver.html" shape="rect" coords="0,266,173,285">
<area href="class_easylocal__TokenRingSolver.html" shape="rect" coords="197,266,363,285">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for easylocal::LocalSearchSolver:<p><center><img src="class_easylocal__LocalSearchSolver_coll_graph.gif" border="0" usemap="#easylocal::LocalSearchSolver_coll_map" alt="Collaboration graph"></center>
<map name="easylocal::LocalSearchSolver_coll_map">
<area href="class_easylocal__Solver.html" shape="rect" coords="0,83,197,101">
<area href="class_easylocal__AbstractSolver.html" shape="rect" coords="24,0,173,19">
<area href="class_easylocal__StateManager.html" shape="rect" coords="232,0,459,19">
<area href="class_easylocal__OutputManager.html" shape="rect" coords="312,83,592,101">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_easylocal__LocalSearchSolver-members.html">List of all members.</a><h2>Public Methods</h2>
<ul>
<li>void <a class="el" href="class_easylocal__LocalSearchSolver.html#a0">SetInitTrials</a> (int t)
<li>void <a class="el" href="class_easylocal__LocalSearchSolver.html#a1">Solve</a> ()
<li>virtual void <a class="el" href="class_easylocal__LocalSearchSolver.html#a2">ReSolve</a> ()
<li>virtual void <a class="el" href="class_easylocal__LocalSearchSolver.html#a3">MultiStartSolve</a> (unsigned int n)
<li>void <a class="el" href="class_easylocal__LocalSearchSolver.html#a4">SetInput</a> (Input *in)
<li>virtual void <a class="el" href="class_easylocal__LocalSearchSolver.html#a5">Check</a> ()
<li>fvalue <a class="el" href="class_easylocal__LocalSearchSolver.html#a6">InternalStateCost</a> ()
</ul>
<h2>Protected Methods</h2>
<ul>
<li><a class="el" href="class_easylocal__LocalSearchSolver.html#b0">LocalSearchSolver</a> (<a class="el" href="class_easylocal__StateManager.html">StateManager</a>&lt; Input, State &gt; *sm, <a class="el" href="class_easylocal__OutputManager.html">OutputManager</a>&lt; Input, Output, State &gt; *om, Input *in=NULL, Output *out=NULL)
<li>virtual void <a class="el" href="class_easylocal__LocalSearchSolver.html#b1">Run</a> ()=0
<li>virtual unsigned long <a class="el" href="class_easylocal__LocalSearchSolver.html#b2">NumberOfIterations</a> () const=0
<li>void <a class="el" href="class_easylocal__LocalSearchSolver.html#b3">DeliverOutput</a> ()
<li>virtual void <a class="el" href="class_easylocal__LocalSearchSolver.html#b4">FindInitialState</a> ()
<li>void <a class="el" href="class_easylocal__LocalSearchSolver.html#b5">ComputeCost</a> ()
</ul>
<h2>Protected Attributes</h2>
<ul>
<li><a class="el" href="class_easylocal__StateManager.html">StateManager</a>&lt;Input,State&gt;* <a class="el" href="class_easylocal__LocalSearchSolver.html#n0">p_sm</a>
<li><a class="el" href="class_easylocal__OutputManager.html">OutputManager</a>&lt;Input,Output,<br>
State&gt;* <a class="el" href="class_easylocal__LocalSearchSolver.html#n1">p_om</a>
<li>fvalue <a class="el" href="class_easylocal__LocalSearchSolver.html#n2">internal_state_cost</a>
<li>State <a class="el" href="class_easylocal__LocalSearchSolver.html#n3">internal_state</a>
<li>unsigned int <a class="el" href="class_easylocal__LocalSearchSolver.html#n4">number_of_init_trials</a>
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class Input, class Output, class State&gt;  class easylocal::LocalSearchSolver</h3>

A Local Search <a class="el" href="class_easylocal__Solver.html">Solver</a> has an internal state, and defines the ways for dealing with a local search algorithm. 
<p>

<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00826">826</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::LocalSearchSolver::LocalSearchSolver"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
easylocal::LocalSearchSolver&lt; Input, Output, State &gt;::LocalSearchSolver&lt;Input, Output, State&gt; (
          </b></td>
          <td valign="bottom"><b>
<a class="el" href="class_easylocal__StateManager.html">StateManager</a>&lt; Input, State &gt; * <em>sm</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
<a class="el" href="class_easylocal__OutputManager.html">OutputManager</a>&lt; Input, Output, State &gt; * <em>om</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
Input * <em>in</em> = NULL, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
Output * <em>out</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 local search solver by providing it a state manager, an output manager, an input object, and an output object.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>sm</em>
&nbsp;</td><td>
 a pointer to a compatible state manager </td></tr>
<tr><td valign=top><em>om</em>
&nbsp;</td><td>
 a pointer to a compatible output manager </td></tr>
<tr><td valign=top><em>in</em>
&nbsp;</td><td>
 a pointer to an input object </td></tr>
<tr><td valign=top><em>out</em>
&nbsp;</td><td>
 a pointer to an output object </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01644">1644</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="a5" doxytag="easylocal::LocalSearchSolver::Check"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::LocalSearchSolver&lt; Input, Output, State &gt;::Check (
          </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>
Checks wether the object state is consistent with all the related objects. 
<p>
Reimplemented in <a class="el" href="class_easylocal__TokenRingSolver.html#a2">easylocal::TokenRingSolver</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01681">1681</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="b5" doxytag="easylocal::LocalSearchSolver::ComputeCost"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::LocalSearchSolver&lt; Input, Output, State &gt;::ComputeCost (
          </b></td>
          <td valign="bottom"><b>
)<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
The cost of the internal state is computed by the state manager. 
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01672">1672</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#l01954">easylocal::TokenRingSolver::Run</a>().    </td>
  </tr>
</table>
<a name="b3" doxytag="easylocal::LocalSearchSolver::DeliverOutput"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::LocalSearchSolver&lt; Input, Output, State &gt;::DeliverOutput (
          </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>
The output is delivered by converting the final internal state to an output object by means of the output manager. 
<p>
Reimplemented from <a class="el" href="class_easylocal__Solver.html#b1">easylocal::Solver</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01657">1657</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#l01782">MultiStartSolve</a>(), <a class="el" href="EasyLocalTemplates_cpp-source.html#l01769">ReSolve</a>(), and <a class="el" href="EasyLocalTemplates_cpp-source.html#l01757">Solve</a>().    </td>
  </tr>
</table>
<a name="b4" doxytag="easylocal::LocalSearchSolver::FindInitialState"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::LocalSearchSolver&lt; Input, Output, State &gt;::FindInitialState (
          </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>
The initial state is generated by delegating this task to  the state manager. The function invokes the SampleState function. 
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01665">1665</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#l01782">MultiStartSolve</a>(), and <a class="el" href="EasyLocalTemplates_cpp-source.html#l01757">Solve</a>().    </td>
  </tr>
</table>
<a name="a6" doxytag="easylocal::LocalSearchSolver::InternalStateCost"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
fvalue easylocal::LocalSearchSolver&lt; Input, Output, State &gt;::InternalStateCost (
          </b></td>
          <td valign="bottom"><b>
)
          </b></td>
        </tr>

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

<p>
Returns the cost of the internal state.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
 the cost of the internal state </dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01631">1631</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a3" doxytag="easylocal::LocalSearchSolver::MultiStartSolve"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::LocalSearchSolver&lt; Input, Output, State &gt;::MultiStartSolve (
          </b></td>
          <td valign="bottom"><b>
unsigned int <em>n</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>
Tries multiple runs on different initial states and records the best one.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>n</em>
&nbsp;</td><td>
 the number of trials </td></tr>
</table>
</dl>
<p>
Reimplemented from <a class="el" href="class_easylocal__AbstractSolver.html#a3">easylocal::AbstractSolver</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01782">1782</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="b2" doxytag="easylocal::LocalSearchSolver::NumberOfIterations"></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 Output, class State&gt;           </b></td>
        </tr>
        <tr>

⌨️ 快捷键说明

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