In the TSP, the fitness has to be minimized ... with all the needed modification (for example, moSA.h)

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@587 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jboisson 2007-08-03 14:28:06 +00:00
commit 1d94071693
170 changed files with 748 additions and 837 deletions

View file

@ -84,13 +84,13 @@
<a name="l00091"></a>00091
<a name="l00092"></a>00092 M move;
<a name="l00093"></a>00093
<a name="l00094"></a>00094 <a class="code" href="classmo_t_s.html#90d19d468c12ab5bd796948ce1ce79b1" title="Alias for the type.">EOT</a> best_sol = __sol, new_sol;
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a" title="Stop criterion.">cont</a>.init ();
<a name="l00097"></a>00097
<a name="l00098"></a>00098 <span class="keywordflow">do</span>
<a name="l00099"></a>00099 {
<a name="l00100"></a>00100
<a name="l00094"></a>00094 <a class="code" href="classmo_t_s.html#90d19d468c12ab5bd796948ce1ce79b1" title="Alias for the type.">EOT</a> best_sol, new_sol;
<a name="l00095"></a>00095 best_sol = __sol;
<a name="l00096"></a>00096
<a name="l00097"></a>00097 <a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a" title="Stop criterion.">cont</a>.init ();
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="keywordflow">do</span>
<a name="l00100"></a>00100 {
<a name="l00101"></a>00101 new_sol = __sol;
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="keywordflow">try</span>
@ -105,34 +105,33 @@
<a name="l00112"></a>00112 <span class="keywordflow">break</span>;
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114
<a name="l00115"></a>00115 <span class="comment">/* Updating the best solution</span>
<a name="l00116"></a>00116 <span class="comment"> found until now ? */</span>
<a name="l00117"></a>00117 <span class="keywordflow">if</span> (new_sol.fitness () &gt; __sol.fitness ())
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119 best_sol = new_sol;
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121
<a name="l00122"></a>00122 __sol = new_sol;
<a name="l00123"></a>00123
<a name="l00124"></a>00124 }
<a name="l00125"></a>00125 <span class="keywordflow">while</span> (<a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a" title="Stop criterion.">cont</a> (__sol));
<a name="l00126"></a>00126
<a name="l00127"></a>00127 __sol = best_sol;
<a name="l00128"></a>00128
<a name="l00129"></a>00129 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131
<a name="l00132"></a>00132 <span class="keyword">private</span>:
<a name="l00133"></a>00133
<a name="l00135"></a><a class="code" href="classmo_t_s.html#06914ddc90ca96e9158c8dbe182a7865">00135</a> moMoveExpl &lt; M &gt; &amp;<a class="code" href="classmo_t_s.html#06914ddc90ca96e9158c8dbe182a7865" title="Neighborhood explorer.">move_expl</a>;
<a name="l00136"></a>00136
<a name="l00138"></a><a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a">00138</a> moSolContinue &lt; EOT &gt; &amp;<a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a" title="Stop criterion.">cont</a>;
<a name="l00139"></a>00139
<a name="l00141"></a><a class="code" href="classmo_t_s.html#fb67eddae5d0bfca4ed881995523231e">00141</a> eoEvalFunc &lt; EOT &gt; &amp;<a class="code" href="classmo_t_s.html#fb67eddae5d0bfca4ed881995523231e" title="Full evaluation function.">full_eval</a>;
<a name="l00142"></a>00142 };
<a name="l00143"></a>00143
<a name="l00144"></a>00144 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Aug 2 09:02:25 2007 for PARADISEO-MO by&nbsp;
<a name="l00115"></a>00115 <span class="comment">/* Updating the best solution found until now ? */</span>
<a name="l00116"></a>00116 <span class="keywordflow">if</span> (new_sol.fitness () &gt; __sol.fitness ())
<a name="l00117"></a>00117 {
<a name="l00118"></a>00118 best_sol = new_sol;
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120
<a name="l00121"></a>00121 __sol = new_sol;
<a name="l00122"></a>00122
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="keywordflow">while</span> (<a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a" title="Stop criterion.">cont</a> (__sol));
<a name="l00125"></a>00125
<a name="l00126"></a>00126 __sol = best_sol;
<a name="l00127"></a>00127
<a name="l00128"></a>00128 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="keyword">private</span>:
<a name="l00132"></a>00132
<a name="l00134"></a><a class="code" href="classmo_t_s.html#06914ddc90ca96e9158c8dbe182a7865">00134</a> moMoveExpl &lt; M &gt; &amp;<a class="code" href="classmo_t_s.html#06914ddc90ca96e9158c8dbe182a7865" title="Neighborhood explorer.">move_expl</a>;
<a name="l00135"></a>00135
<a name="l00137"></a><a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a">00137</a> moSolContinue &lt; EOT &gt; &amp;<a class="code" href="classmo_t_s.html#969371cd2202f3d29cbb426f57ac7d3a" title="Stop criterion.">cont</a>;
<a name="l00138"></a>00138
<a name="l00140"></a><a class="code" href="classmo_t_s.html#fb67eddae5d0bfca4ed881995523231e">00140</a> eoEvalFunc &lt; EOT &gt; &amp;<a class="code" href="classmo_t_s.html#fb67eddae5d0bfca4ed881995523231e" title="Full evaluation function.">full_eval</a>;
<a name="l00141"></a>00141 };
<a name="l00142"></a>00142
<a name="l00143"></a>00143 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Aug 3 16:25:56 2007 for PARADISEO-MO by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
</body>