paradiseo/trunk/paradiseo-peo/doc/html/peoSynchronousMultiStart_8h-source.html
legrand abc68c9e88 completed doc
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@665 331e1502-861f-0410-8da2-ba01fb791d7f
2007-10-08 09:41:23 +00:00

298 lines
39 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-PEOMovingObjects: peoSynchronousMultiStart.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>peoSynchronousMultiStart.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* </span>
<a name="l00002"></a>00002 <span class="comment">* &lt;peoSynchronousMultiStart.h&gt;</span>
<a name="l00003"></a>00003 <span class="comment">* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007</span>
<a name="l00004"></a>00004 <span class="comment">* (C) OPAC Team, LIFL, 2002-2007</span>
<a name="l00005"></a>00005 <span class="comment">*</span>
<a name="l00006"></a>00006 <span class="comment">* Sebastien Cahon, Alexandru-Adrian Tantar</span>
<a name="l00007"></a>00007 <span class="comment">*</span>
<a name="l00008"></a>00008 <span class="comment">* This software is governed by the CeCILL license under French law and</span>
<a name="l00009"></a>00009 <span class="comment">* abiding by the rules of distribution of free software. You can use,</span>
<a name="l00010"></a>00010 <span class="comment">* modify and/ or redistribute the software under the terms of the CeCILL</span>
<a name="l00011"></a>00011 <span class="comment">* license as circulated by CEA, CNRS and INRIA at the following URL</span>
<a name="l00012"></a>00012 <span class="comment">* "http://www.cecill.info".</span>
<a name="l00013"></a>00013 <span class="comment">*</span>
<a name="l00014"></a>00014 <span class="comment">* As a counterpart to the access to the source code and rights to copy,</span>
<a name="l00015"></a>00015 <span class="comment">* modify and redistribute granted by the license, users are provided only</span>
<a name="l00016"></a>00016 <span class="comment">* with a limited warranty and the software's author, the holder of the</span>
<a name="l00017"></a>00017 <span class="comment">* economic rights, and the successive licensors have only limited liability.</span>
<a name="l00018"></a>00018 <span class="comment">*</span>
<a name="l00019"></a>00019 <span class="comment">* In this respect, the user's attention is drawn to the risks associated</span>
<a name="l00020"></a>00020 <span class="comment">* with loading, using, modifying and/or developing or reproducing the</span>
<a name="l00021"></a>00021 <span class="comment">* software by the user in light of its specific status of free software,</span>
<a name="l00022"></a>00022 <span class="comment">* that may mean that it is complicated to manipulate, and that also</span>
<a name="l00023"></a>00023 <span class="comment">* therefore means that it is reserved for developers and experienced</span>
<a name="l00024"></a>00024 <span class="comment">* professionals having in-depth computer knowledge. Users are therefore</span>
<a name="l00025"></a>00025 <span class="comment">* encouraged to load and test the software's suitability as regards their</span>
<a name="l00026"></a>00026 <span class="comment">* requirements in conditions enabling the security of their systems and/or</span>
<a name="l00027"></a>00027 <span class="comment">* data to be ensured and, more generally, to use and operate it in the</span>
<a name="l00028"></a>00028 <span class="comment">* same conditions as regards security.</span>
<a name="l00029"></a>00029 <span class="comment">* The fact that you are presently reading this means that you have had</span>
<a name="l00030"></a>00030 <span class="comment">* knowledge of the CeCILL license and that you accept its terms.</span>
<a name="l00031"></a>00031 <span class="comment">*</span>
<a name="l00032"></a>00032 <span class="comment">* ParadisEO WebSite : http://paradiseo.gforge.inria.fr</span>
<a name="l00033"></a>00033 <span class="comment">* Contact: paradiseo-help@lists.gforge.inria.fr</span>
<a name="l00034"></a>00034 <span class="comment">*</span>
<a name="l00035"></a>00035 <span class="comment">*/</span>
<a name="l00036"></a>00036 <span class="preprocessor">#ifndef __peoSynchronousMultiStart_h</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define __peoSynchronousMultiStart_h</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="preprocessor">#include "core/service.h"</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include "core/messaging.h"</span>
<a name="l00043"></a>00043
<a name="l00044"></a>00044
<a name="l00045"></a><a class="code" href="classpeoSynchronousMultiStart.html">00045</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keyword">class </span><a class="code" href="classpeoSynchronousMultiStart.html">peoSynchronousMultiStart</a> : <span class="keyword">public</span> <a class="code" href="classService.html">Service</a> {
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="keyword">public</span>:
<a name="l00048"></a>00048
<a name="l00049"></a><a class="code" href="classpeoSynchronousMultiStart.html#e9a336c61dd6216d7d15253ff9c9d2a3">00049</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> AlgorithmType &gt; <a class="code" href="classpeoSynchronousMultiStart.html#e9a336c61dd6216d7d15253ff9c9d2a3">peoSynchronousMultiStart</a>( AlgorithmType&amp; externalAlgorithm ) {
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <a class="code" href="classpeoSynchronousMultiStart.html#ea22b8cd0f4974da519ec416904d772e">singularAlgorithm</a> = <span class="keyword">new</span> Algorithm&lt; AlgorithmType &gt;( externalAlgorithm );
<a name="l00052"></a>00052 <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>.push_back( <a class="code" href="classpeoSynchronousMultiStart.html#ea22b8cd0f4974da519ec416904d772e">singularAlgorithm</a> );
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <a class="code" href="classpeoSynchronousMultiStart.html#abcd58d71eabf2fab35c662fb300e61c">aggregationFunction</a> = <span class="keyword">new</span> NoAggregationFunction();
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056
<a name="l00057"></a><a class="code" href="classpeoSynchronousMultiStart.html#689374232ff67f266ddaa5d309ea54ac">00057</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> AlgorithmType, <span class="keyword">typename</span> AggregationFunctionType &gt; <a class="code" href="classpeoSynchronousMultiStart.html#e9a336c61dd6216d7d15253ff9c9d2a3">peoSynchronousMultiStart</a>( std::vector&lt; AlgorithmType* &gt;&amp; externalAlgorithms, AggregationFunctionType&amp; externalAggregationFunction ) {
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 0; index &lt; externalAlgorithms; index++ ) {
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>.push_back( <span class="keyword">new</span> Algorithm&lt; AlgorithmType &gt;( *externalAlgorithms[ index ] ) );
<a name="l00062"></a>00062 }
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <a class="code" href="classpeoSynchronousMultiStart.html#abcd58d71eabf2fab35c662fb300e61c">aggregationFunction</a> = <span class="keyword">new</span> Algorithm&lt; AggregationFunctionType &gt;( externalAggregationFunction );
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066
<a name="l00067"></a>00067
<a name="l00068"></a><a class="code" href="classpeoSynchronousMultiStart.html#f9ec55d67f5f45f5a737064fae569277">00068</a> <a class="code" href="classpeoSynchronousMultiStart.html#f9ec55d67f5f45f5a737064fae569277">~peoSynchronousMultiStart</a>() {
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 0; index &lt; <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>.size(); index++ ) <span class="keyword">delete</span> <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>[ index ];
<a name="l00071"></a>00071 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 0; index &lt; <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>.size(); index++ ) <span class="keyword">delete</span> <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>[ index ];
<a name="l00072"></a>00072
<a name="l00073"></a>00073 <span class="keyword">delete</span> <a class="code" href="classpeoSynchronousMultiStart.html#abcd58d71eabf2fab35c662fb300e61c">aggregationFunction</a>;
<a name="l00074"></a>00074 }
<a name="l00075"></a>00075
<a name="l00076"></a>00076
<a name="l00077"></a><a class="code" href="classpeoSynchronousMultiStart.html#1fd09337a6edcf173edff1fdda2387c7">00077</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> Type &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#1fd09337a6edcf173edff1fdda2387c7">operator()</a>( Type&amp; externalData ) {
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="keywordflow">for</span> ( <span class="keyword">typename</span> Type::iterator externalDataIterator = externalData.begin(); externalDataIterator != externalData.end(); externalDataIterator++ ) {
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>.push_back( <span class="keyword">new</span> DataType&lt; EntityType &gt;( *externalDataIterator ) );
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">functionIndex</a> = <a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">dataIndex</a> = <a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">idx</a> = <a class="code" href="classpeoSynchronousMultiStart.html#e8c889e6228535ce02086c76d3480cbb">num_term</a> = 0;
<a name="l00085"></a>00085 <a class="code" href="classService.html#7e2ae35a9070a05dcd46488df649896d">requestResourceRequest</a>( <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>.size() * <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>.size() );
<a name="l00086"></a>00086 <a class="code" href="classCommunicable.html#cb53e6534b947bc889aa181d9dbbd13b">stop</a>();
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088
<a name="l00089"></a>00089
<a name="l00090"></a><a class="code" href="classpeoSynchronousMultiStart.html#45372c26ac5b979d29458815debceff8">00090</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> Type &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#1fd09337a6edcf173edff1fdda2387c7">operator()</a>( <span class="keyword">const</span> Type&amp; externalDataBegin, <span class="keyword">const</span> Type&amp; externalDataEnd ) {
<a name="l00091"></a>00091
<a name="l00092"></a>00092 <span class="keywordflow">for</span> ( Type externalDataIterator = externalDataBegin; externalDataIterator != externalDataEnd; externalDataIterator++ ) {
<a name="l00093"></a>00093
<a name="l00094"></a>00094 <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>.push_back( <span class="keyword">new</span> DataType&lt; EntityType &gt;( *externalDataIterator ) );
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096
<a name="l00097"></a>00097 <a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">functionIndex</a> = <a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">dataIndex</a> = <a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">idx</a> = <a class="code" href="classpeoSynchronousMultiStart.html#e8c889e6228535ce02086c76d3480cbb">num_term</a> = 0;
<a name="l00098"></a>00098 <a class="code" href="classService.html#7e2ae35a9070a05dcd46488df649896d">requestResourceRequest</a>( <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>.size() * <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>.size() );
<a name="l00099"></a>00099 <a class="code" href="classCommunicable.html#cb53e6534b947bc889aa181d9dbbd13b">stop</a>();
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#c73358b4f04f258c55f631660a7992fb">packData</a>();
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#9881b3f05c9f90bcb3c3ec0af8109ccc">unpackData</a>();
<a name="l00106"></a>00106
<a name="l00107"></a>00107 <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#da98ee86056eca293b3f08c89584b701">execute</a>();
<a name="l00108"></a>00108
<a name="l00109"></a>00109 <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#0a5e0e1c1db5af61351e201e019f5a89">packResult</a>();
<a name="l00110"></a>00110
<a name="l00111"></a>00111 <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#976b78c11073ee3be09c1aed7826411a">unpackResult</a>();
<a name="l00112"></a>00112
<a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#de581c634fa9f952d571f9ed0a6611ed">notifySendingData</a>();
<a name="l00114"></a>00114
<a name="l00115"></a>00115 <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#e328547d97849bfc85f2a7356e5e7927">notifySendingAllResourceRequests</a>();
<a name="l00116"></a>00116
<a name="l00117"></a>00117
<a name="l00118"></a>00118 <span class="keyword">private</span>:
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <span class="keyword">template</span> &lt; <span class="keyword">typename</span> Type &gt; <span class="keyword">struct </span>DataType;
<a name="l00121"></a>00121
<a name="l00122"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">00122</a> <span class="keyword">struct </span><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a> {
<a name="l00123"></a>00123
<a name="l00124"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html#4d868a93f8e97621ec5c7b6a2e28b265">00124</a> <span class="keyword">virtual</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html#4d868a93f8e97621ec5c7b6a2e28b265">~AbstractDataType</a>() { }
<a name="l00125"></a>00125
<a name="l00126"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html#a4addfca8a9acecadb4c786deed36934">00126</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> Type &gt; <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html#a4addfca8a9acecadb4c786deed36934">operator Type&amp; </a>() {
<a name="l00127"></a>00127
<a name="l00128"></a>00128 <span class="keywordflow">return</span> ( <span class="keyword">dynamic_cast</span>&lt; <a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html">DataType&lt; Type &gt;</a>&amp; &gt;( *<span class="keyword">this</span> ) ).data;
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 };
<a name="l00131"></a>00131
<a name="l00132"></a><a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html">00132</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> Type &gt; <span class="keyword">struct </span><a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html">DataType</a> : <span class="keyword">public</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a> {
<a name="l00133"></a>00133
<a name="l00134"></a><a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html#cf5b9add5416139738e152b461008a89">00134</a> <a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html#cf5b9add5416139738e152b461008a89">DataType</a>( Type&amp; externalData ) : <a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html#76abc322ae058a820b2c964907bc0d80">data</a>( externalData ) { }
<a name="l00135"></a>00135
<a name="l00136"></a><a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html#76abc322ae058a820b2c964907bc0d80">00136</a> Type&amp; <a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html#76abc322ae058a820b2c964907bc0d80">data</a>;
<a name="l00137"></a>00137 };
<a name="l00138"></a>00138
<a name="l00139"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAlgorithm.html">00139</a> <span class="keyword">struct </span><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAlgorithm.html">AbstractAlgorithm</a> {
<a name="l00140"></a>00140
<a name="l00141"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAlgorithm.html#c77be114590c79c1b96d3afbe73596e0">00141</a> <span class="keyword">virtual</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAlgorithm.html#c77be114590c79c1b96d3afbe73596e0">~AbstractAlgorithm</a>() { }
<a name="l00142"></a>00142
<a name="l00143"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAlgorithm.html#a5f7790ac2b99e798e4e84f2d5a5f78c">00143</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAlgorithm.html#a5f7790ac2b99e798e4e84f2d5a5f78c">operator()</a>( <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstance ) {}
<a name="l00144"></a>00144 };
<a name="l00145"></a>00145
<a name="l00146"></a><a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html">00146</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> AlgorithmType &gt; <span class="keyword">struct </span><a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html">Algorithm</a> : <span class="keyword">public</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAlgorithm.html">AbstractAlgorithm</a> {
<a name="l00147"></a>00147
<a name="l00148"></a><a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#8ba4ac2674ca61a8e6b0af2e8e25ba66">00148</a> <a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#8ba4ac2674ca61a8e6b0af2e8e25ba66">Algorithm</a>( AlgorithmType&amp; externalAlgorithm ) : <a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#2d533c96d2eefea51a72d241d39abf22">algorithm</a>( externalAlgorithm ) { }
<a name="l00149"></a>00149
<a name="l00150"></a><a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#d8902e501b61a8d5727589a5a106bb10">00150</a> <span class="keywordtype">void</span> <a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#d8902e501b61a8d5727589a5a106bb10">operator()</a>( <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstance ) { <a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#2d533c96d2eefea51a72d241d39abf22">algorithm</a>( dataTypeInstance ); }
<a name="l00151"></a>00151
<a name="l00152"></a><a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#2d533c96d2eefea51a72d241d39abf22">00152</a> AlgorithmType&amp; <a class="code" href="structpeoSynchronousMultiStart_1_1Algorithm.html#2d533c96d2eefea51a72d241d39abf22">algorithm</a>;
<a name="l00153"></a>00153 };
<a name="l00154"></a>00154
<a name="l00155"></a>00155
<a name="l00156"></a>00156
<a name="l00157"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html">00157</a> <span class="keyword">struct </span><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html">AbstractAggregationAlgorithm</a> {
<a name="l00158"></a>00158
<a name="l00159"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html#d5bb9f3712564b788bb7c6da71ef2d3f">00159</a> <span class="keyword">virtual</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html#d5bb9f3712564b788bb7c6da71ef2d3f">~AbstractAggregationAlgorithm</a>() { }
<a name="l00160"></a>00160
<a name="l00161"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html#cf9b3275e26f24984c9bb839e7f07ba6">00161</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html#cf9b3275e26f24984c9bb839e7f07ba6">operator()</a>( <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstanceA, <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstanceB ) {};
<a name="l00162"></a>00162 };
<a name="l00163"></a>00163
<a name="l00164"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html">00164</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> AggregationAlgorithmType &gt; <span class="keyword">struct </span><a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html">AggregationAlgorithm</a> : <span class="keyword">public</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html">AbstractAggregationAlgorithm</a> {
<a name="l00165"></a>00165
<a name="l00166"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#1e03bf7728d19f4649366238962ca365">00166</a> <a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#1e03bf7728d19f4649366238962ca365">AggregationAlgorithm</a>( AggregationAlgorithmType&amp; externalAggregationAlgorithm ) : <a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#3c701a64f21aa00278c58b5b4ac914a1">aggregationAlgorithm</a>( externalAggregationAlgorithm ) { }
<a name="l00167"></a>00167
<a name="l00168"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#f8abe94db942aa42f0e3d9c1657db581">00168</a> <span class="keywordtype">void</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#f8abe94db942aa42f0e3d9c1657db581">operator()</a>( <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstanceA, <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstanceB ) {
<a name="l00169"></a>00169
<a name="l00170"></a>00170 <a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#3c701a64f21aa00278c58b5b4ac914a1">aggregationAlgorithm</a>( dataTypeInstanceA, dataTypeInstanceB );
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172
<a name="l00173"></a><a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#3c701a64f21aa00278c58b5b4ac914a1">00173</a> AggregationAlgorithmType&amp; <a class="code" href="structpeoSynchronousMultiStart_1_1AggregationAlgorithm.html#3c701a64f21aa00278c58b5b4ac914a1">aggregationAlgorithm</a>;
<a name="l00174"></a>00174 };
<a name="l00175"></a>00175
<a name="l00176"></a><a class="code" href="structpeoSynchronousMultiStart_1_1NoAggregationFunction.html">00176</a> <span class="keyword">struct </span><a class="code" href="structpeoSynchronousMultiStart_1_1NoAggregationFunction.html">NoAggregationFunction</a> : <span class="keyword">public</span> <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractAggregationAlgorithm.html">AbstractAggregationAlgorithm</a> {
<a name="l00177"></a>00177
<a name="l00178"></a><a class="code" href="structpeoSynchronousMultiStart_1_1NoAggregationFunction.html#d094bb3cca92a48de0afadf576cda044">00178</a> <span class="keywordtype">void</span> <a class="code" href="structpeoSynchronousMultiStart_1_1NoAggregationFunction.html#d094bb3cca92a48de0afadf576cda044">operator()</a>( <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstanceA, <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>&amp; dataTypeInstanceB ) {
<a name="l00179"></a>00179
<a name="l00180"></a>00180 static_cast&lt; EntityType&amp; &gt;( dataTypeInstanceA ) = static_cast&lt; EntityType&amp; &gt;( dataTypeInstanceB );
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182 };
<a name="l00183"></a>00183
<a name="l00184"></a>00184
<a name="l00185"></a>00185
<a name="l00186"></a><a class="code" href="classpeoSynchronousMultiStart.html#ea22b8cd0f4974da519ec416904d772e">00186</a> AbstractAlgorithm* <a class="code" href="classpeoSynchronousMultiStart.html#ea22b8cd0f4974da519ec416904d772e">singularAlgorithm</a>;
<a name="l00187"></a>00187
<a name="l00188"></a><a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">00188</a> std::vector&lt; AbstractAlgorithm* &gt; <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>;
<a name="l00189"></a><a class="code" href="classpeoSynchronousMultiStart.html#abcd58d71eabf2fab35c662fb300e61c">00189</a> AbstractAggregationAlgorithm* <a class="code" href="classpeoSynchronousMultiStart.html#abcd58d71eabf2fab35c662fb300e61c">aggregationFunction</a>;
<a name="l00190"></a>00190
<a name="l00191"></a>00191
<a name="l00192"></a><a class="code" href="classpeoSynchronousMultiStart.html#6efedfa64f7a4f3a0d81002e8226dcea">00192</a> EntityType <a class="code" href="classpeoSynchronousMultiStart.html#6efedfa64f7a4f3a0d81002e8226dcea">entityTypeInstance</a>;
<a name="l00193"></a><a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">00193</a> std::vector&lt; AbstractDataType* &gt; <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>;
<a name="l00194"></a>00194
<a name="l00195"></a><a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">00195</a> <span class="keywordtype">unsigned</span> <a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">idx</a>;
<a name="l00196"></a><a class="code" href="classpeoSynchronousMultiStart.html#e8c889e6228535ce02086c76d3480cbb">00196</a> <span class="keywordtype">unsigned</span> <a class="code" href="classpeoSynchronousMultiStart.html#e8c889e6228535ce02086c76d3480cbb">num_term</a>;
<a name="l00197"></a><a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">00197</a> <span class="keywordtype">unsigned</span> <a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">dataIndex</a>;
<a name="l00198"></a><a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">00198</a> <span class="keywordtype">unsigned</span> <a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">functionIndex</a>;
<a name="l00199"></a>00199 };
<a name="l00200"></a>00200
<a name="l00201"></a>00201
<a name="l00202"></a><a class="code" href="classpeoSynchronousMultiStart.html#c73358b4f04f258c55f631660a7992fb">00202</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#c73358b4f04f258c55f631660a7992fb">peoSynchronousMultiStart&lt; EntityType &gt;::packData</a>() {
<a name="l00203"></a>00203
<a name="l00204"></a>00204 ::pack( <a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">functionIndex</a> );
<a name="l00205"></a>00205 ::pack( <a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">idx</a> );
<a name="l00206"></a>00206 ::pack( ( EntityType&amp; ) *<a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>[ <a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">idx</a>++ ] );
<a name="l00207"></a>00207
<a name="l00208"></a>00208 <span class="comment">// done with functionIndex for the entire data set - moving to another</span>
<a name="l00209"></a>00209 <span class="comment">// function/algorithm starting all over with the entire data set ( idx is set to 0 )</span>
<a name="l00210"></a>00210 <span class="keywordflow">if</span> ( <a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">idx</a> == <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>.size() ) {
<a name="l00211"></a>00211
<a name="l00212"></a>00212 ++<a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">functionIndex</a>; <a class="code" href="classpeoSynchronousMultiStart.html#0264a28725fb4a030ed1e4010e07e69e">idx</a> = 0;
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215
<a name="l00216"></a><a class="code" href="classpeoSynchronousMultiStart.html#9881b3f05c9f90bcb3c3ec0af8109ccc">00216</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#9881b3f05c9f90bcb3c3ec0af8109ccc">peoSynchronousMultiStart&lt; EntityType &gt;::unpackData</a>() {
<a name="l00217"></a>00217
<a name="l00218"></a>00218 ::unpack( <a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">functionIndex</a> );
<a name="l00219"></a>00219 ::unpack( <a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">dataIndex</a> );
<a name="l00220"></a>00220 ::unpack( <a class="code" href="classpeoSynchronousMultiStart.html#6efedfa64f7a4f3a0d81002e8226dcea">entityTypeInstance</a> );
<a name="l00221"></a>00221 }
<a name="l00222"></a>00222
<a name="l00223"></a><a class="code" href="classpeoSynchronousMultiStart.html#da98ee86056eca293b3f08c89584b701">00223</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#da98ee86056eca293b3f08c89584b701">peoSynchronousMultiStart&lt; EntityType &gt;::execute</a>() {
<a name="l00224"></a>00224
<a name="l00225"></a>00225 <span class="comment">// wrapping the unpacked data - the definition of an abstract algorithm imposes</span>
<a name="l00226"></a>00226 <span class="comment">// that its internal function operator acts only on abstract data types</span>
<a name="l00227"></a>00227 <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>* entityWrapper = <span class="keyword">new</span> <a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html">DataType&lt; EntityType &gt;</a>( <a class="code" href="classpeoSynchronousMultiStart.html#6efedfa64f7a4f3a0d81002e8226dcea">entityTypeInstance</a> );
<a name="l00228"></a>00228 <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>[ <a class="code" href="classpeoSynchronousMultiStart.html#20cff9a01fb7bb621264b901dab7f336">functionIndex</a> ]-&gt;operator()( *entityWrapper );
<a name="l00229"></a>00229
<a name="l00230"></a>00230 <span class="keyword">delete</span> entityWrapper;
<a name="l00231"></a>00231 }
<a name="l00232"></a>00232
<a name="l00233"></a><a class="code" href="classpeoSynchronousMultiStart.html#0a5e0e1c1db5af61351e201e019f5a89">00233</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#0a5e0e1c1db5af61351e201e019f5a89">peoSynchronousMultiStart&lt; EntityType &gt;::packResult</a>() {
<a name="l00234"></a>00234
<a name="l00235"></a>00235 ::pack( <a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">dataIndex</a> );
<a name="l00236"></a>00236 ::pack( <a class="code" href="classpeoSynchronousMultiStart.html#6efedfa64f7a4f3a0d81002e8226dcea">entityTypeInstance</a> );
<a name="l00237"></a>00237 }
<a name="l00238"></a>00238
<a name="l00239"></a><a class="code" href="classpeoSynchronousMultiStart.html#976b78c11073ee3be09c1aed7826411a">00239</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#976b78c11073ee3be09c1aed7826411a">peoSynchronousMultiStart&lt; EntityType &gt;::unpackResult</a>() {
<a name="l00240"></a>00240
<a name="l00241"></a>00241 ::unpack( <a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">dataIndex</a> );
<a name="l00242"></a>00242 ::unpack( <a class="code" href="classpeoSynchronousMultiStart.html#6efedfa64f7a4f3a0d81002e8226dcea">entityTypeInstance</a> );
<a name="l00243"></a>00243
<a name="l00244"></a>00244 <span class="comment">// wrapping the unpacked data - the definition of an abstract algorithm imposes</span>
<a name="l00245"></a>00245 <span class="comment">// that its internal function operator acts only on abstract data types</span>
<a name="l00246"></a>00246 <a class="code" href="structpeoSynchronousMultiStart_1_1AbstractDataType.html">AbstractDataType</a>* entityWrapper = <span class="keyword">new</span> <a class="code" href="structpeoSynchronousMultiStart_1_1DataType.html">DataType&lt; EntityType &gt;</a>( <a class="code" href="classpeoSynchronousMultiStart.html#6efedfa64f7a4f3a0d81002e8226dcea">entityTypeInstance</a> );
<a name="l00247"></a>00247 <a class="code" href="classpeoSynchronousMultiStart.html#abcd58d71eabf2fab35c662fb300e61c">aggregationFunction</a>-&gt;operator()( *<a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>[ <a class="code" href="classpeoSynchronousMultiStart.html#a49cb2d76e6fdbfdbe0788c8388d6a0f">dataIndex</a> ], *entityWrapper );
<a name="l00248"></a>00248 <span class="keyword">delete</span> entityWrapper;
<a name="l00249"></a>00249
<a name="l00250"></a>00250 <a class="code" href="classpeoSynchronousMultiStart.html#e8c889e6228535ce02086c76d3480cbb">num_term</a>++;
<a name="l00251"></a>00251
<a name="l00252"></a>00252 <span class="keywordflow">if</span> ( <a class="code" href="classpeoSynchronousMultiStart.html#e8c889e6228535ce02086c76d3480cbb">num_term</a> == <a class="code" href="classpeoSynchronousMultiStart.html#f729f5a1671437dce7607ad5b7253560">data</a>.size() * <a class="code" href="classpeoSynchronousMultiStart.html#f47bb795f53df73f04c0d1528fa346a6">algorithms</a>.size() ) {
<a name="l00253"></a>00253
<a name="l00254"></a>00254 <a class="code" href="classService.html#0dae00309c51a7b7069788142aed799f">getOwner</a>()-&gt;<a class="code" href="classThread.html#e197c46f8f62ecce6d2a7fe95bdc5b38">setActive</a>();
<a name="l00255"></a>00255 <a class="code" href="classCommunicable.html#3306a9adb11a0ab5af342c0db9f7bb2a">resume</a>();
<a name="l00256"></a>00256 }
<a name="l00257"></a>00257 }
<a name="l00258"></a>00258
<a name="l00259"></a><a class="code" href="classpeoSynchronousMultiStart.html#de581c634fa9f952d571f9ed0a6611ed">00259</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#de581c634fa9f952d571f9ed0a6611ed">peoSynchronousMultiStart&lt; EntityType &gt;::notifySendingData</a>() {
<a name="l00260"></a>00260
<a name="l00261"></a>00261 }
<a name="l00262"></a>00262
<a name="l00263"></a><a class="code" href="classpeoSynchronousMultiStart.html#e328547d97849bfc85f2a7356e5e7927">00263</a> <span class="keyword">template</span> &lt; <span class="keyword">typename</span> EntityType &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoSynchronousMultiStart.html#e328547d97849bfc85f2a7356e5e7927">peoSynchronousMultiStart&lt; EntityType &gt;::notifySendingAllResourceRequests</a>() {
<a name="l00264"></a>00264
<a name="l00265"></a>00265 <a class="code" href="classService.html#0dae00309c51a7b7069788142aed799f">getOwner</a>()-&gt;<a class="code" href="classThread.html#20632ffe9ddfa2a478afb0c84dc1096b">setPassive</a>();
<a name="l00266"></a>00266 }
<a name="l00267"></a>00267
<a name="l00268"></a>00268
<a name="l00269"></a>00269 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 11:16:46 2007 for ParadisEO-PEOMovingObjects 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>