📄 class_easylocal__moverunner.html
字号:
<!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"> </td>
<td>
<!-- Generated by Doxygen 1.2.5 on Sat Jun 9 18:59:26 2001 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center>
<hr><h1>easylocal::MoveRunner Class Template Reference</h1><code>#include <<a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>></code>
<p>
Inheritance diagram for easylocal::MoveRunner<p><center><img src="class_easylocal__MoveRunner_inherit_graph.gif" border="0" usemap="#easylocal::MoveRunner_inherit_map" alt="Inheritance graph"></center>
<map name="easylocal::MoveRunner_inherit_map">
<area href="class_easylocal__HillClimbing.html" shape="rect" coords="0,133,141,152">
<area href="class_easylocal__SimulatedAnnealing.html" shape="rect" coords="165,133,344,152">
<area href="class_easylocal__SteepestDescent.html" shape="rect" coords="368,133,525,152">
<area href="class_easylocal__TabuSearch.html" shape="rect" coords="549,133,683,152">
<area href="class_easylocal__Runner.html" shape="rect" coords="255,0,447,19">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for easylocal::MoveRunner:<p><center><img src="class_easylocal__MoveRunner_coll_graph.gif" border="0" usemap="#easylocal::MoveRunner_coll_map" alt="Collaboration graph"></center>
<map name="easylocal::MoveRunner_coll_map">
<area href="class_easylocal__Runner.html" shape="rect" coords="0,83,192,101">
<area href="class_easylocal__StateManager.html" shape="rect" coords="127,0,353,19">
<area href="class_easylocal__NeighborhoodExplorer.html" shape="rect" coords="307,83,621,101">
<area href="class_easylocal__ProhibitionManager.html" shape="rect" coords="377,0,607,19">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_easylocal__MoveRunner-members.html">List of all members.</a><h2>Public Methods</h2>
<ul>
<li>virtual <a class="el" href="class_easylocal__MoveRunner.html#a0">~MoveRunner</a> ()
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a1">Go</a> ()
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a2">Step</a> (unsigned int n)
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a3">SetCurrentState</a> (const State &s)
<li>State <a class="el" href="class_easylocal__MoveRunner.html#a4">GetCurrentState</a> ()
<li>fvalue <a class="el" href="class_easylocal__MoveRunner.html#a5">CurrentStateCost</a> ()
<li>State <a class="el" href="class_easylocal__MoveRunner.html#a6">GetBestState</a> ()
<li>fvalue <a class="el" href="class_easylocal__MoveRunner.html#a7">BestStateCost</a> ()
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a8">ComputeCost</a> ()
<li>bool <a class="el" href="class_easylocal__MoveRunner.html#a9">LowerBoundReached</a> ()
<li>unsigned long <a class="el" href="class_easylocal__MoveRunner.html#a10">NumberOfIterations</a> () const
<li>unsigned long <a class="el" href="class_easylocal__MoveRunner.html#a11">MaxIteration</a> () const
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a12">SetMaxIteration</a> (unsigned long max)
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a13">SetInput</a> (Input *in)
<li>Input* <a class="el" href="class_easylocal__MoveRunner.html#a14">GetInput</a> ()
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a15">Print</a> (std::ostream &os=std::cout) const
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a16">SetParameters</a> (const <a class="el" href="class_easylocal__ParameterBox.html">ParameterBox</a> &pb)
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a17">SetPlotStream</a> (std::ostream *os=&std::cerr)
<li>void <a class="el" href="class_easylocal__MoveRunner.html#a18">Check</a> ()
</ul>
<h2>Protected Methods</h2>
<ul>
<li><a class="el" href="class_easylocal__MoveRunner.html#b0">MoveRunner</a> (<a class="el" href="class_easylocal__StateManager.html">StateManager</a>< Input, State > *s, <a class="el" href="class_easylocal__NeighborhoodExplorer.html">NeighborhoodExplorer</a>< Input, State, Move > *ne, Input *in=NULL, std::string <a class="el" href="class_easylocal__Runner.html#n0">name</a>="<a class="el" href="class_easylocal__Runner.html">Runner</a> <a class="el" href="class_easylocal__Runner.html#n0">name</a>", std::string <a class="el" href="class_easylocal__Runner.html#n1">type</a>="Move <a class="el" href="class_easylocal__Runner.html">Runner</a>")
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b1">InitializeRun</a> ()
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b2">TerminateRun</a> ()
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b3">ComputeMoveCost</a> ()
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b4">UpdateIterationCounter</a> ()
<li>bool <a class="el" href="class_easylocal__MoveRunner.html#b5">MaxIterationExpired</a> ()
<li>virtual bool <a class="el" href="class_easylocal__MoveRunner.html#b6">StopCriterion</a> ()=0
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b7">SelectMove</a> ()=0
<li>virtual bool <a class="el" href="class_easylocal__MoveRunner.html#b8">AcceptableMove</a> ()
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b9">MakeMove</a> ()
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b10">StoreMove</a> ()
<li>virtual void <a class="el" href="class_easylocal__MoveRunner.html#b11">UpdateStateCost</a> ()
</ul>
<h2>Protected Attributes</h2>
<ul>
<li>Input* <a class="el" href="class_easylocal__MoveRunner.html#n0">p_in</a>
<li><a class="el" href="class_easylocal__StateManager.html">StateManager</a><Input,State>* <a class="el" href="class_easylocal__MoveRunner.html#n1">p_sm</a>
<li><a class="el" href="class_easylocal__NeighborhoodExplorer.html">NeighborhoodExplorer</a><Input,<br>
State,Move>* <a class="el" href="class_easylocal__MoveRunner.html#n2">p_nhe</a>
<li>State <a class="el" href="class_easylocal__MoveRunner.html#n3">current_state</a>
<li>fvalue <a class="el" href="class_easylocal__MoveRunner.html#n4">current_state_cost</a>
<li>bool <a class="el" href="class_easylocal__MoveRunner.html#n5">current_state_set</a>
<li>Move <a class="el" href="class_easylocal__MoveRunner.html#n6">current_move</a>
<li>fvalue <a class="el" href="class_easylocal__MoveRunner.html#n7">current_move_cost</a>
<li>State <a class="el" href="class_easylocal__MoveRunner.html#n8">best_state</a>
<li>fvalue <a class="el" href="class_easylocal__MoveRunner.html#n9">best_state_cost</a>
<li>unsigned long <a class="el" href="class_easylocal__MoveRunner.html#n10">iteration_of_best</a>
<li>unsigned long <a class="el" href="class_easylocal__MoveRunner.html#n11">max_idle_iteration</a>
<li>unsigned long <a class="el" href="class_easylocal__MoveRunner.html#n12">number_of_iterations</a>
<li>unsigned long <a class="el" href="class_easylocal__MoveRunner.html#n13">max_iteration</a>
<li>std::ostream* <a class="el" href="class_easylocal__MoveRunner.html#n14">pos</a>
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<class Input, class State, class Move> class easylocal::MoveRunner</h3>
A Move <a class="el" href="class_easylocal__Runner.html">Runner</a> is an instance of the <a class="el" href="class_easylocal__Runner.html">Runner</a> interface which it compel with a particular definition of @Move (given as template instantiation). It is at the root of the inheritance hierarchy of actual runners.
<p>
<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00564">564</a> of file <a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
<a name="a0" doxytag="easylocal::MoveRunner::~MoveRunner"></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<class Input, class State, class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
easylocal::MoveRunner<Input, State, Move>::~MoveRunner<Input, State, Move> (
</b></td>
<td valign="bottom"><b>
)<code> [inline, virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Virtual destructor.
<p>
Definition at line <a class="el" href="EasyLocal_h-source.html#l00568">568</a> of file <a class="el" href="EasyLocal_h-source.html">EasyLocal.h</a>. </td>
</tr>
</table>
<a name="b0" doxytag="easylocal::MoveRunner::MoveRunner"></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<class Input, class State, class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
easylocal::MoveRunner< Input, State, Move >::MoveRunner<Input, State, Move> (
</b></td>
<td valign="bottom"><b>
<a class="el" href="class_easylocal__StateManager.html">StateManager</a>< Input, State > * <em>sm</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
<a class="el" href="class_easylocal__NeighborhoodExplorer.html">NeighborhoodExplorer</a>< Input, State, Move > * <em>ne</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
Input * <em>in</em> = NULL,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
std::string <em>name</em> = "<a class="el" href="class_easylocal__Runner.html">Runner</a> <a class="el" href="class_easylocal__Runner.html#n0">name</a>",
</b></td>
</tr>
<tr>
<td></td>
<td><b>
std::string <em>type</em> = "Move <a class="el" href="class_easylocal__Runner.html">Runner</a>" )<code> [protected]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Creates a move runner and links it to a given state manager, neighborhood explorer and input objects. In addition, it sets its name and type to the given values.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>sm</em>
</td><td>
a pointer to a compatible state manager </td></tr>
<tr><td valign=top><em>ne</em>
</td><td>
a pointer to a compatible neighborhood explorer </td></tr>
<tr><td valign=top><em>in</em>
</td><td>
a pointer to the input object </td></tr>
<tr><td valign=top><em>name</em>
</td><td>
the name of the runner </td></tr>
<tr><td valign=top><em>type</em>
</td><td>
the type of the runner </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00779">779</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="b8" doxytag="easylocal::MoveRunner::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<class Input, class State, class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
bool easylocal::MoveRunner< Input, State, Move >::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>
</td>
<td>
<p>
Checks whether the selected move can be performed. Its tentative definition simply returns true
<p>
Reimplemented in <a class="el" href="class_easylocal__SteepestDescent.html#b4">easylocal::SteepestDescent</a>, <a class="el" href="class_easylocal__HillClimbing.html#b4">easylocal::HillClimbing</a>, <a class="el" href="class_easylocal__TabuSearch.html#b5">easylocal::TabuSearch</a>, and <a class="el" href="class_easylocal__SimulatedAnnealing.html#b6">easylocal::SimulatedAnnealing</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l01054">1054</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#l00942">Go</a>(), and <a class="el" href="EasyLocalTemplates_cpp-source.html#l01006">Step</a>(). </td>
</tr>
</table>
<a name="a7" doxytag="easylocal::MoveRunner::BestStateCost"></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<class Input, class State, class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
fvalue easylocal::MoveRunner< Input, State, Move >::BestStateCost (
</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>
</td>
<td>
<p>
Returns the cost of the best state found so far by the runner.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
the cost of the best state found </dl>
<p>
Reimplemented from <a class="el" href="class_easylocal__Runner.html#a9">easylocal::Runner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00880">880</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>. </td>
</tr>
</table>
<a name="a18" doxytag="easylocal::MoveRunner::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<class Input, class State, class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
void easylocal::MoveRunner< Input, State, Move >::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>
</td>
<td>
<p>
Checks wether the object state is consistent with all the related objects.
<p>
Reimplemented from <a class="el" href="class_easylocal__Runner.html#a19">easylocal::Runner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00826">826</a> of file <a class="el" href="EasyLocalTemplates_cpp-source.html">EasyLocalTemplates.cpp</a>. </td>
</tr>
</table>
<a name="a8" doxytag="easylocal::MoveRunner::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<class Input, class State, class Move> </b></td>
</tr>
<tr>
<td nowrap valign="top"><b>
void easylocal::MoveRunner< Input, State, Move >::ComputeCost (
</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>
</td>
<td>
<p>
Computes explicitely the cost of the current state (used at the beginning of a run for consistency purpose).
<p>
Reimplemented from <a class="el" href="class_easylocal__Runner.html#a10">easylocal::Runner</a>.
<p>
Definition at line <a class="el" href="EasyLocalTemplates_cpp-source.html#l00888">888</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#l01068">InitializeRun</a>(). </td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -