class_easylocal__statemanager.html

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

HTML
640
字号
<!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:36 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::StateManager  Class Template Reference</h1><code>#include &lt;<a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>&gt;</code>
<p>
<a href="class_easylocal__StateManager-members.html">List of all members.</a><h2>Public Methods</h2>
<ul>
<li>virtual void <a class="el" href="class_easylocal__StateManager.html#a0">RandomState</a> (State &amp;st)=0
<li>virtual void <a class="el" href="class_easylocal__StateManager.html#a1">UpdateRedundantStateData</a> (State &amp;st)
<li>virtual fvalue <a class="el" href="class_easylocal__StateManager.html#a2">SampleState</a> (State &amp;st, int samples)
<li>virtual fvalue <a class="el" href="class_easylocal__StateManager.html#a3">ImprovedSampleState</a> (State &amp;st, int samples, <a class="el" href="class_easylocal__Runner.html">Runner</a>&lt; Input, State &gt; *r)
<li>virtual fvalue <a class="el" href="class_easylocal__StateManager.html#a4">CostFunction</a> (const State &amp;st) const
<li>virtual fvalue <a class="el" href="class_easylocal__StateManager.html#a5">Objective</a> (const State &amp;st) const
<li>virtual fvalue <a class="el" href="class_easylocal__StateManager.html#a6">Violations</a> (const State &amp;st) const
<li>virtual void <a class="el" href="class_easylocal__StateManager.html#a7">PrintState</a> (const State &amp;st) const
<li>virtual void <a class="el" href="class_easylocal__StateManager.html#a8">Check</a> () const
<li>void <a class="el" href="class_easylocal__StateManager.html#a9">SetInput</a> (Input *in)
<li>Input* <a class="el" href="class_easylocal__StateManager.html#a10">GetInput</a> ()
</ul>
<h2>Protected Methods</h2>
<ul>
<li><a class="el" href="class_easylocal__StateManager.html#b0">StateManager</a> (Input *in=NULL)
</ul>
<h2>Protected Attributes</h2>
<ul>
<li>Input* <a class="el" href="class_easylocal__StateManager.html#n0">p_in</a>
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class Input, class State&gt;  class easylocal::StateManager</h3>

The State Manager is responsible for all operations on the state which are independent of the neighborhood definition, such as generating a random state, and computing the cost of a state. No <code>Move</code> template is supplied to it. 
<p>

<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00117">117</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::StateManager::StateManager"></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&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
easylocal::StateManager&lt; Input, State &gt;::StateManager&lt;Input, State&gt; (
          </b></td>
          <td valign="bottom"><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>
Builds a state manager object linked to the provided input.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>in</em>
&nbsp;</td><td>
 a pointer to an input object </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00176">176</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="a8" doxytag="easylocal::StateManager::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 State&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
void easylocal::StateManager&lt; Input, State &gt;::Check (
          </b></td>
          <td valign="bottom"><b>
) const<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>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00167">167</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a4" doxytag="easylocal::StateManager::CostFunction"></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&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
fvalue easylocal::StateManager&lt; Input, State &gt;::CostFunction (
          </b></td>
          <td valign="bottom"><b>
const State &amp; <em>st</em>&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>
Evaluates the cost function value in a given state.  The tentative definition computes a weighted sum of the violation  function and the objective function.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>st</em>
&nbsp;</td><td>
 the state to be evaluated </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 the value of the cost function in the given state </dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00099">99</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#l00061">ImprovedSampleState</a>(), <a class="el" href="EasyLocalTemplates_cpp-source.html#l00108">PrintState</a>(), and <a class="el" href="EasyLocalTemplates_cpp-source.html#l00029">SampleState</a>().    </td>
  </tr>
</table>
<a name="a10" doxytag="easylocal::StateManager::GetInput"></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&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
Input * easylocal::StateManager&lt; Input, State &gt;::GetInput (
          </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 input pointer which the object is attached to.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
 the pointer to the input object </dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00159">159</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a3" doxytag="easylocal::StateManager::ImprovedSampleState"></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&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
fvalue easylocal::StateManager&lt; Input, State &gt;::ImprovedSampleState (
          </b></td>
          <td valign="bottom"><b>
State &amp; <em>st</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
int <em>samples</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
<a class="el" href="class_easylocal__Runner.html">Runner</a>&lt; Input, State &gt; * <em>r</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>
Looks for the best state out of a given number of states which are obtained by random generation and are improved  running a local search algorithm upon them.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>st</em>
&nbsp;</td><td>
 the best state found </td></tr>
<tr><td valign=top><em>samples</em>
&nbsp;</td><td>
 the number of sampled states </td></tr>
<tr><td valign=top><em>r</em>
&nbsp;</td><td>
 a pointer to a runner to be used to improve the sampled </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00061">61</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>.    </td>
  </tr>
</table>
<a name="a5" doxytag="easylocal::StateManager::Objective"></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&gt;           </b></td>
        </tr>
        <tr>
          <td nowrap valign="top"><b> 
fvalue easylocal::StateManager&lt; Input, State &gt;::Objective (
          </b></td>
          <td valign="bottom"><b>
const State &amp; <em>st</em>&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>
A tentative definition of the objective function:  by default, it simply returns 0 and outputs a warning message.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>st</em>
&nbsp;</td><td>
 the state to be evaluated </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 the value of the violations function in the given state </dl>
<p>

⌨️ 快捷键说明

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