paradiseo/trunk/paradiseo-peo/docs/html/peoSyncMultiStart_8h-source.html

181 lines
18 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ParadisEO-PEO: peoSyncMultiStart.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="classes.html"><span>Classes</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul></div>
<h1>peoSyncMultiStart.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// "peoSyncMultiStart.h"</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">// (c) OPAC Team, LIFL, August 2005</span>
<a name="l00004"></a>00004
<a name="l00005"></a>00005 <span class="comment">/* </span>
<a name="l00006"></a>00006 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr</span>
<a name="l00007"></a>00007 <span class="comment">*/</span>
<a name="l00008"></a>00008
<a name="l00009"></a>00009 <span class="preprocessor">#ifndef __peoSyncMultiStart_h</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __peoSyncMultiStart_h</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;utils/eoUpdater.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;moAlgo.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;eoSelect.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;eoReplacement.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;eoContinue.h&gt;</span>
<a name="l00018"></a>00018
<a name="l00019"></a>00019 <span class="preprocessor">#include "core/service.h"</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "core/messaging.h"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "core/peo_debug.h"</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="keyword">extern</span> <span class="keywordtype">int</span> getNodeRank();
<a name="l00025"></a>00025
<a name="l00026"></a>00026
<a name="l00028"></a>00028
<a name="l00036"></a><a class="code" href="classpeoSyncMultiStart.html">00036</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keyword">class </span><a class="code" href="classpeoSyncMultiStart.html">peoSyncMultiStart</a> : <span class="keyword">public</span> <a class="code" href="classService.html">Service</a>, <span class="keyword">public</span> eoUpdater {
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keyword">public</span>:
<a name="l00039"></a>00039
<a name="l00047"></a>00047 <a class="code" href="classpeoSyncMultiStart.html#d29f94aad3c1f443bfffc8b6aee0704c">peoSyncMultiStart</a>(
<a name="l00048"></a>00048
<a name="l00049"></a>00049 eoContinue&lt; EOT &gt;&amp; __cont,
<a name="l00050"></a>00050 eoSelect&lt; EOT &gt;&amp; __select,
<a name="l00051"></a>00051 eoReplacement&lt; EOT &gt;&amp; __replace,
<a name="l00052"></a>00052 <a class="codeRef" doxygen="mo.doxytag:../../../paradiseo-mo/docs/html/" href="../../../paradiseo-mo/docs/html/classmo_algo.html">moAlgo&lt; EOT &gt;</a>&amp; __ls,
<a name="l00053"></a>00053 eoPop&lt; EOT &gt;&amp; __pop
<a name="l00054"></a>00054 );
<a name="l00055"></a>00055
<a name="l00058"></a>00058 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#76385b33fe514f91cb83f0fbecbeb3c2">operator()</a>();
<a name="l00059"></a>00059
<a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#8becfab1922b64708dca5a53e2932a5a">packData</a>();
<a name="l00063"></a>00063
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#2903a441b77cded266b5fb651e17a5b5">unpackData</a>();
<a name="l00067"></a>00067
<a name="l00070"></a>00070 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#a4d1c2943c290de540800087b54dc49b">execute</a>();
<a name="l00071"></a>00071
<a name="l00074"></a>00074 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#6c48eb0dae741cff7203b65e226f9616">packResult</a>();
<a name="l00075"></a>00075
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#c3cbd1f10a89d1915c5ccf82a2c34a1d">unpackResult</a>();
<a name="l00079"></a>00079
<a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#32ec0d01d3fd8a9932abd68f4781fc94">notifySendingData</a>();
<a name="l00083"></a>00083
<a name="l00086"></a>00086 <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#fc90282cc4e93cdea8f82fd52dd78fb0">notifySendingAllResourceRequests</a>();
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <span class="keyword">private</span>:
<a name="l00089"></a>00089
<a name="l00090"></a><a class="code" href="classpeoSyncMultiStart.html#43f4fa9b125baef6fc8b968dfd16f437">00090</a> eoContinue&lt; EOT &gt;&amp; <a class="code" href="classpeoSyncMultiStart.html#43f4fa9b125baef6fc8b968dfd16f437">cont</a>;
<a name="l00091"></a><a class="code" href="classpeoSyncMultiStart.html#8fc9a3d046023ddd077defec3c23ab3b">00091</a> eoSelect&lt; EOT &gt;&amp; <a class="code" href="classpeoSyncMultiStart.html#8fc9a3d046023ddd077defec3c23ab3b">select</a>;
<a name="l00092"></a><a class="code" href="classpeoSyncMultiStart.html#a375ccea98e9bf2a0854dac27df4522f">00092</a> eoReplacement&lt; EOT &gt;&amp; <a class="code" href="classpeoSyncMultiStart.html#a375ccea98e9bf2a0854dac27df4522f">replace</a>;
<a name="l00093"></a>00093
<a name="l00094"></a><a class="code" href="classpeoSyncMultiStart.html#4d317966de767dcc87eee0286ea7f95d">00094</a> <a class="codeRef" doxygen="mo.doxytag:../../../paradiseo-mo/docs/html/" href="../../../paradiseo-mo/docs/html/classmo_algo.html">moAlgo&lt; EOT &gt;</a>&amp; <a class="code" href="classpeoSyncMultiStart.html#4d317966de767dcc87eee0286ea7f95d">ls</a>;
<a name="l00095"></a>00095
<a name="l00096"></a><a class="code" href="classpeoSyncMultiStart.html#391178bd6b8a97a08ab4e345f070e967">00096</a> eoPop&lt; EOT &gt;&amp; <a class="code" href="classpeoSyncMultiStart.html#391178bd6b8a97a08ab4e345f070e967">pop</a>;
<a name="l00097"></a><a class="code" href="classpeoSyncMultiStart.html#dbcc1a069ec72ecd8d40c392640d84b3">00097</a> eoPop&lt; EOT &gt; <a class="code" href="classpeoSyncMultiStart.html#dbcc1a069ec72ecd8d40c392640d84b3">sel</a>;
<a name="l00098"></a><a class="code" href="classpeoSyncMultiStart.html#ca10f6d258105e3c4f0d1660db5b7679">00098</a> eoPop&lt; EOT &gt; <a class="code" href="classpeoSyncMultiStart.html#ca10f6d258105e3c4f0d1660db5b7679">impr_sel</a>;
<a name="l00099"></a>00099
<a name="l00100"></a><a class="code" href="classpeoSyncMultiStart.html#2c2ebe46470d1425f0409897deab435b">00100</a> EOT <a class="code" href="classpeoSyncMultiStart.html#2c2ebe46470d1425f0409897deab435b">sol</a>;
<a name="l00101"></a><a class="code" href="classpeoSyncMultiStart.html#64191ef79b7b589964ac9c3e23ae6718">00101</a> <span class="keywordtype">unsigned</span> <a class="code" href="classpeoSyncMultiStart.html#64191ef79b7b589964ac9c3e23ae6718">idx</a>;
<a name="l00102"></a><a class="code" href="classpeoSyncMultiStart.html#773eb9097550d9444f25ca8f48997a30">00102</a> <span class="keywordtype">unsigned</span> <a class="code" href="classpeoSyncMultiStart.html#773eb9097550d9444f25ca8f48997a30">num_term</a>;
<a name="l00103"></a>00103 };
<a name="l00104"></a>00104
<a name="l00105"></a>00105
<a name="l00106"></a><a class="code" href="classpeoSyncMultiStart.html#d29f94aad3c1f443bfffc8b6aee0704c">00106</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <a class="code" href="classpeoSyncMultiStart.html#d29f94aad3c1f443bfffc8b6aee0704c">peoSyncMultiStart&lt; EOT &gt; :: peoSyncMultiStart</a>(
<a name="l00107"></a>00107
<a name="l00108"></a>00108 eoContinue &lt; EOT &gt;&amp; __cont,
<a name="l00109"></a>00109 eoSelect&lt; EOT &gt;&amp; __select,
<a name="l00110"></a>00110 eoReplacement&lt; EOT &gt;&amp; __replace,
<a name="l00111"></a>00111 moAlgo &lt; EOT &gt;&amp; __ls,
<a name="l00112"></a>00112 eoPop&lt; EOT &gt;&amp; __pop
<a name="l00113"></a>00113
<a name="l00114"></a>00114 ) : cont( __cont ), select( __select ), replace( __replace ), ls( __ls ), pop( __pop )
<a name="l00115"></a>00115 {
<a name="l00116"></a>00116
<a name="l00117"></a>00117 }
<a name="l00118"></a>00118
<a name="l00119"></a>00119
<a name="l00120"></a><a class="code" href="classpeoSyncMultiStart.html#8becfab1922b64708dca5a53e2932a5a">00120</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#8becfab1922b64708dca5a53e2932a5a">peoSyncMultiStart&lt; EOT &gt; :: packData</a>() {
<a name="l00121"></a>00121
<a name="l00122"></a>00122 :: pack( <a class="code" href="classpeoSyncMultiStart.html#dbcc1a069ec72ecd8d40c392640d84b3">sel</a>[ <a class="code" href="classpeoSyncMultiStart.html#64191ef79b7b589964ac9c3e23ae6718">idx</a>++ ] );
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124
<a name="l00125"></a>00125
<a name="l00126"></a><a class="code" href="classpeoSyncMultiStart.html#2903a441b77cded266b5fb651e17a5b5">00126</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#2903a441b77cded266b5fb651e17a5b5">peoSyncMultiStart&lt; EOT &gt; :: unpackData</a>() {
<a name="l00127"></a>00127
<a name="l00128"></a>00128 unpack( <a class="code" href="classpeoSyncMultiStart.html#2c2ebe46470d1425f0409897deab435b">sol</a> );
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130
<a name="l00131"></a>00131
<a name="l00132"></a><a class="code" href="classpeoSyncMultiStart.html#a4d1c2943c290de540800087b54dc49b">00132</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#a4d1c2943c290de540800087b54dc49b">peoSyncMultiStart&lt; EOT &gt; :: execute</a>() {
<a name="l00133"></a>00133
<a name="l00134"></a>00134 <a class="code" href="classpeoSyncMultiStart.html#4d317966de767dcc87eee0286ea7f95d">ls</a>( <a class="code" href="classpeoSyncMultiStart.html#2c2ebe46470d1425f0409897deab435b">sol</a> );
<a name="l00135"></a>00135 }
<a name="l00136"></a>00136
<a name="l00137"></a>00137
<a name="l00138"></a><a class="code" href="classpeoSyncMultiStart.html#6c48eb0dae741cff7203b65e226f9616">00138</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#6c48eb0dae741cff7203b65e226f9616">peoSyncMultiStart&lt; EOT &gt; :: packResult</a>() {
<a name="l00139"></a>00139
<a name="l00140"></a>00140 pack( <a class="code" href="classpeoSyncMultiStart.html#2c2ebe46470d1425f0409897deab435b">sol</a> );
<a name="l00141"></a>00141 }
<a name="l00142"></a>00142
<a name="l00143"></a>00143
<a name="l00144"></a><a class="code" href="classpeoSyncMultiStart.html#c3cbd1f10a89d1915c5ccf82a2c34a1d">00144</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#c3cbd1f10a89d1915c5ccf82a2c34a1d">peoSyncMultiStart&lt; EOT &gt; :: unpackResult</a>() {
<a name="l00145"></a>00145
<a name="l00146"></a>00146 unpack( <a class="code" href="classpeoSyncMultiStart.html#2c2ebe46470d1425f0409897deab435b">sol</a> );
<a name="l00147"></a>00147 <a class="code" href="classpeoSyncMultiStart.html#ca10f6d258105e3c4f0d1660db5b7679">impr_sel</a>.push_back( <a class="code" href="classpeoSyncMultiStart.html#2c2ebe46470d1425f0409897deab435b">sol</a> );
<a name="l00148"></a>00148 <a class="code" href="classpeoSyncMultiStart.html#773eb9097550d9444f25ca8f48997a30">num_term</a>++;
<a name="l00149"></a>00149
<a name="l00150"></a>00150 <span class="keywordflow">if</span> ( <a class="code" href="classpeoSyncMultiStart.html#773eb9097550d9444f25ca8f48997a30">num_term</a> == <a class="code" href="classpeoSyncMultiStart.html#dbcc1a069ec72ecd8d40c392640d84b3">sel</a>.size() ) {
<a name="l00151"></a>00151
<a name="l00152"></a>00152 <a class="code" href="classService.html#0dae00309c51a7b7069788142aed799f">getOwner</a>()-&gt;<a class="code" href="classThread.html#e197c46f8f62ecce6d2a7fe95bdc5b38">setActive</a>();
<a name="l00153"></a>00153 <a class="code" href="classpeoSyncMultiStart.html#a375ccea98e9bf2a0854dac27df4522f">replace</a>( <a class="code" href="classpeoSyncMultiStart.html#391178bd6b8a97a08ab4e345f070e967">pop</a>, <a class="code" href="classpeoSyncMultiStart.html#ca10f6d258105e3c4f0d1660db5b7679">impr_sel</a> );
<a name="l00154"></a>00154
<a name="l00155"></a>00155 printDebugMessage( <span class="stringliteral">"replacing the improved individuals in the population."</span> );
<a name="l00156"></a>00156 <a class="code" href="classCommunicable.html#3306a9adb11a0ab5af342c0db9f7bb2a">resume</a>();
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159
<a name="l00160"></a>00160
<a name="l00161"></a><a class="code" href="classpeoSyncMultiStart.html#76385b33fe514f91cb83f0fbecbeb3c2">00161</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#76385b33fe514f91cb83f0fbecbeb3c2">peoSyncMultiStart&lt; EOT &gt; :: operator()</a>() {
<a name="l00162"></a>00162
<a name="l00163"></a>00163 printDebugMessage( <span class="stringliteral">"performing the parallel multi-start hybridization."</span> );
<a name="l00164"></a>00164 <a class="code" href="classpeoSyncMultiStart.html#8fc9a3d046023ddd077defec3c23ab3b">select</a>( <a class="code" href="classpeoSyncMultiStart.html#391178bd6b8a97a08ab4e345f070e967">pop</a>, <a class="code" href="classpeoSyncMultiStart.html#dbcc1a069ec72ecd8d40c392640d84b3">sel</a> );
<a name="l00165"></a>00165 <a class="code" href="classpeoSyncMultiStart.html#ca10f6d258105e3c4f0d1660db5b7679">impr_sel</a>.clear();
<a name="l00166"></a>00166 <a class="code" href="classpeoSyncMultiStart.html#64191ef79b7b589964ac9c3e23ae6718">idx</a> = <a class="code" href="classpeoSyncMultiStart.html#773eb9097550d9444f25ca8f48997a30">num_term</a> = 0;
<a name="l00167"></a>00167 <a class="code" href="classService.html#7e2ae35a9070a05dcd46488df649896d">requestResourceRequest</a>( <a class="code" href="classpeoSyncMultiStart.html#dbcc1a069ec72ecd8d40c392640d84b3">sel</a>.size() );
<a name="l00168"></a>00168 <a class="code" href="classCommunicable.html#cb53e6534b947bc889aa181d9dbbd13b">stop</a>();
<a name="l00169"></a>00169 }
<a name="l00170"></a>00170
<a name="l00171"></a>00171
<a name="l00172"></a><a class="code" href="classpeoSyncMultiStart.html#32ec0d01d3fd8a9932abd68f4781fc94">00172</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#32ec0d01d3fd8a9932abd68f4781fc94">peoSyncMultiStart&lt; EOT &gt; :: notifySendingData</a>() {
<a name="l00173"></a>00173
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175
<a name="l00176"></a>00176
<a name="l00177"></a><a class="code" href="classpeoSyncMultiStart.html#fc90282cc4e93cdea8f82fd52dd78fb0">00177</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSyncMultiStart.html#fc90282cc4e93cdea8f82fd52dd78fb0">peoSyncMultiStart&lt; EOT &gt; :: notifySendingAllResourceRequests</a>() {
<a name="l00178"></a>00178
<a name="l00179"></a>00179 <a class="code" href="classService.html#0dae00309c51a7b7069788142aed799f">getOwner</a>()-&gt;<a class="code" href="classThread.html#20632ffe9ddfa2a478afb0c84dc1096b">setPassive</a>();
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181
<a name="l00182"></a>00182
<a name="l00183"></a>00183 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jan 9 15:47:38 2007 for ParadisEO-PEO by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>