git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@684 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
legrand 2007-10-08 14:57:50 +00:00
commit 2dfb873e6e
552 changed files with 10511 additions and 14621 deletions

View file

@ -21,108 +21,133 @@
</form>
</li>
</ul></div>
<h1>FlowShopBenchmarkParser.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopBenchmarkParser.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;stdexcept&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;FlowShopBenchmarkParser.h&gt;</span>
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classFlowShopBenchmarkParser.html#2787b88a1be9d4d37438c557bf32f137">00016</a> <a class="code" href="classFlowShopBenchmarkParser.html#2787b88a1be9d4d37438c557bf32f137">FlowShopBenchmarkParser::FlowShopBenchmarkParser</a>(<span class="keyword">const</span> std::string _benchmarkFileName)
<a name="l00017"></a>00017 {
<a name="l00018"></a>00018 <a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">init</a>(_benchmarkFileName);
<a name="l00019"></a>00019 }
<a name="l00020"></a>00020
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="classFlowShopBenchmarkParser.html#8d5042c2f8727e235f94c947b2ba00a5">00022</a> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#8d5042c2f8727e235f94c947b2ba00a5">FlowShopBenchmarkParser::getM</a>()
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>;
<a name="l00025"></a>00025 }
<a name="l00026"></a>00026
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classFlowShopBenchmarkParser.html#fe16df4df5104aee3d792e60bb32a66d">00028</a> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#fe16df4df5104aee3d792e60bb32a66d">FlowShopBenchmarkParser::getN</a>()
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>;
<a name="l00031"></a>00031 }
<a name="l00032"></a>00032
<a name="l00033"></a>00033
<a name="l00034"></a><a class="code" href="classFlowShopBenchmarkParser.html#2df87bf8a18a55266729ab105955d7bf">00034</a> <span class="keyword">const</span> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; <a class="code" href="classFlowShopBenchmarkParser.html#2df87bf8a18a55266729ab105955d7bf">FlowShopBenchmarkParser::getP</a>()
<a name="l00035"></a>00035 {
<a name="l00036"></a>00036 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>;
<a name="l00037"></a>00037 }
<a name="l00038"></a>00038
<a name="l00039"></a>00039
<a name="l00040"></a><a class="code" href="classFlowShopBenchmarkParser.html#b362d0042273be436c55637828d8582d">00040</a> <span class="keyword">const</span> std::vector&lt;unsigned int&gt; <a class="code" href="classFlowShopBenchmarkParser.html#b362d0042273be436c55637828d8582d">FlowShopBenchmarkParser::getD</a>()
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a>;
<a name="l00043"></a>00043 }
<a name="l00044"></a>00044
<h1>FlowShopBenchmarkParser.cpp</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;FlowShopBenchmarkParser.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;stdexcept&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;FlowShopBenchmarkParser.h&gt;</span>
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classFlowShopBenchmarkParser.html#2787b88a1be9d4d37438c557bf32f137">00041</a> <a class="code" href="classFlowShopBenchmarkParser.html#2787b88a1be9d4d37438c557bf32f137">FlowShopBenchmarkParser::FlowShopBenchmarkParser</a>(<span class="keyword">const</span> std::string _benchmarkFileName)
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043 <a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">init</a>(_benchmarkFileName);
<a name="l00044"></a>00044 }
<a name="l00045"></a>00045
<a name="l00046"></a><a class="code" href="classFlowShopBenchmarkParser.html#69c9ba47e774da4b06424a724573265d">00046</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#69c9ba47e774da4b06424a724573265d">FlowShopBenchmarkParser::printOn</a>(std::ostream &amp; _os)<span class="keyword"> const</span>
<a name="l00047"></a>00047 <span class="keyword"></span>{
<a name="l00048"></a>00048 _os &lt;&lt; <span class="stringliteral">"M="</span> &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a> &lt;&lt; <span class="stringliteral">" N="</span> &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a> &lt;&lt; std::endl;
<a name="l00049"></a>00049 _os &lt;&lt; <span class="stringliteral">"*** processing times"</span> &lt;&lt; std::endl;
<a name="l00050"></a>00050 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>; i++) {
<a name="l00051"></a>00051 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0; j&lt;<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>; j++) {
<a name="l00052"></a>00052 _os &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>[i][j] &lt;&lt; <span class="stringliteral">" "</span>;
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054 _os &lt;&lt; std::endl;
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056 _os &lt;&lt; <span class="stringliteral">"*** due-dates"</span> &lt;&lt; std::endl;
<a name="l00057"></a>00057 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0; j&lt;<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>; j++) {
<a name="l00058"></a>00058 _os &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a>[j] &lt;&lt; <span class="stringliteral">" "</span>;
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 _os &lt;&lt; std::endl &lt;&lt; std::endl;
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classFlowShopBenchmarkParser.html#8d5042c2f8727e235f94c947b2ba00a5">00047</a> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#8d5042c2f8727e235f94c947b2ba00a5">FlowShopBenchmarkParser::getM</a>()
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>;
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051
<a name="l00052"></a>00052
<a name="l00053"></a><a class="code" href="classFlowShopBenchmarkParser.html#fe16df4df5104aee3d792e60bb32a66d">00053</a> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#fe16df4df5104aee3d792e60bb32a66d">FlowShopBenchmarkParser::getN</a>()
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>;
<a name="l00056"></a>00056 }
<a name="l00057"></a>00057
<a name="l00058"></a>00058
<a name="l00059"></a><a class="code" href="classFlowShopBenchmarkParser.html#2df87bf8a18a55266729ab105955d7bf">00059</a> <span class="keyword">const</span> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; <a class="code" href="classFlowShopBenchmarkParser.html#2df87bf8a18a55266729ab105955d7bf">FlowShopBenchmarkParser::getP</a>()
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>;
<a name="l00062"></a>00062 }
<a name="l00063"></a>00063
<a name="l00064"></a><a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">00064</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">FlowShopBenchmarkParser::init</a>(<span class="keyword">const</span> std::string _benchmarkFileName)
<a name="l00065"></a>00065 {
<a name="l00066"></a>00066 std::string buffer;
<a name="l00067"></a>00067 std::string::size_type start, end;
<a name="l00068"></a>00068 std::ifstream inputFile(_benchmarkFileName.data(), std::ios::in);
<a name="l00069"></a>00069 <span class="comment">// opening of the benchmark file</span>
<a name="l00070"></a>00070 <span class="keywordflow">if</span> (! inputFile)
<a name="l00071"></a>00071 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"*** ERROR : Unable to open the benchmark file"</span>);
<a name="l00072"></a>00072 <span class="comment">// number of jobs (N)</span>
<a name="l00073"></a>00073 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00074"></a>00074 <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a> = atoi(buffer.data());
<a name="l00075"></a>00075 <span class="comment">// number of machines M</span>
<a name="l00076"></a>00076 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00077"></a>00077 <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a> = atoi(buffer.data());
<a name="l00078"></a>00078 <span class="comment">// initial and current seeds (not used)</span>
<a name="l00079"></a>00079 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00080"></a>00080 <span class="comment">// processing times and due-dates</span>
<a name="l00081"></a>00081 <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a> = std::vector&lt; std::vector&lt;unsigned int&gt; &gt; (<a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>,<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>);
<a name="l00082"></a>00082 <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a> = std::vector&lt;unsigned int&gt; (<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>);
<a name="l00083"></a>00083 <span class="comment">// for each job...</span>
<a name="l00084"></a>00084 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0 ; j&lt;<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a> ; j++) {
<a name="l00085"></a>00085 <span class="comment">// index of the job (&lt;=&gt; j)</span>
<a name="l00086"></a>00086 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00087"></a>00087 <span class="comment">// due-date of the job j</span>
<a name="l00088"></a>00088 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00089"></a>00089 d[j] = atoi(buffer.data());
<a name="l00090"></a>00090 <span class="comment">// processing times of the job j on each machine</span>
<a name="l00091"></a>00091 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00092"></a>00092 start = buffer.find_first_not_of(<span class="stringliteral">" "</span>);
<a name="l00093"></a>00093 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0 ; i&lt;M ; i++) {
<a name="l00094"></a>00094 end = buffer.find_first_of(<span class="stringliteral">" "</span>, start);
<a name="l00095"></a>00095 <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>[i][j] = atoi(buffer.substr(start, end-start).data());
<a name="l00096"></a>00096 start = buffer.find_first_not_of(<span class="stringliteral">" "</span>, end);
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099 <span class="comment">// closing of the input file</span>
<a name="l00100"></a>00100 inputFile.close();
<a name="l00101"></a>00101 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00064"></a>00064
<a name="l00065"></a><a class="code" href="classFlowShopBenchmarkParser.html#b362d0042273be436c55637828d8582d">00065</a> <span class="keyword">const</span> std::vector&lt;unsigned int&gt; <a class="code" href="classFlowShopBenchmarkParser.html#b362d0042273be436c55637828d8582d">FlowShopBenchmarkParser::getD</a>()
<a name="l00066"></a>00066 {
<a name="l00067"></a>00067 <span class="keywordflow">return</span> <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a>;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069
<a name="l00070"></a>00070
<a name="l00071"></a><a class="code" href="classFlowShopBenchmarkParser.html#69c9ba47e774da4b06424a724573265d">00071</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#69c9ba47e774da4b06424a724573265d">FlowShopBenchmarkParser::printOn</a>(std::ostream &amp; _os)<span class="keyword"> const</span>
<a name="l00072"></a>00072 <span class="keyword"></span>{
<a name="l00073"></a>00073 _os &lt;&lt; <span class="stringliteral">"M="</span> &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a> &lt;&lt; <span class="stringliteral">" N="</span> &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a> &lt;&lt; std::endl;
<a name="l00074"></a>00074 _os &lt;&lt; <span class="stringliteral">"*** processing times"</span> &lt;&lt; std::endl;
<a name="l00075"></a>00075 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>; i++) {
<a name="l00076"></a>00076 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0; j&lt;<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>; j++) {
<a name="l00077"></a>00077 _os &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>[i][j] &lt;&lt; <span class="stringliteral">" "</span>;
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 _os &lt;&lt; std::endl;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 _os &lt;&lt; <span class="stringliteral">"*** due-dates"</span> &lt;&lt; std::endl;
<a name="l00082"></a>00082 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0; j&lt;<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>; j++) {
<a name="l00083"></a>00083 _os &lt;&lt; <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a>[j] &lt;&lt; <span class="stringliteral">" "</span>;
<a name="l00084"></a>00084 }
<a name="l00085"></a>00085 _os &lt;&lt; std::endl &lt;&lt; std::endl;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087
<a name="l00088"></a>00088
<a name="l00089"></a><a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">00089</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">FlowShopBenchmarkParser::init</a>(<span class="keyword">const</span> std::string _benchmarkFileName)
<a name="l00090"></a>00090 {
<a name="l00091"></a>00091 std::string buffer;
<a name="l00092"></a>00092 std::string::size_type start, end;
<a name="l00093"></a>00093 std::ifstream inputFile(_benchmarkFileName.data(), std::ios::in);
<a name="l00094"></a>00094 <span class="comment">// opening of the benchmark file</span>
<a name="l00095"></a>00095 <span class="keywordflow">if</span> (! inputFile)
<a name="l00096"></a>00096 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"*** ERROR : Unable to open the benchmark file"</span>);
<a name="l00097"></a>00097 <span class="comment">// number of jobs (N)</span>
<a name="l00098"></a>00098 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00099"></a>00099 <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a> = atoi(buffer.data());
<a name="l00100"></a>00100 <span class="comment">// number of machines M</span>
<a name="l00101"></a>00101 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00102"></a>00102 <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a> = atoi(buffer.data());
<a name="l00103"></a>00103 <span class="comment">// initial and current seeds (not used)</span>
<a name="l00104"></a>00104 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00105"></a>00105 <span class="comment">// processing times and due-dates</span>
<a name="l00106"></a>00106 <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a> = std::vector&lt; std::vector&lt;unsigned int&gt; &gt; (<a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>,<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>);
<a name="l00107"></a>00107 <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a> = std::vector&lt;unsigned int&gt; (<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>);
<a name="l00108"></a>00108 <span class="comment">// for each job...</span>
<a name="l00109"></a>00109 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0 ; j&lt;<a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a> ; j++) {
<a name="l00110"></a>00110 <span class="comment">// index of the job (&lt;=&gt; j)</span>
<a name="l00111"></a>00111 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00112"></a>00112 <span class="comment">// due-date of the job j</span>
<a name="l00113"></a>00113 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00114"></a>00114 d[j] = atoi(buffer.data());
<a name="l00115"></a>00115 <span class="comment">// processing times of the job j on each machine</span>
<a name="l00116"></a>00116 getline(inputFile, buffer, <span class="charliteral">'\n'</span>);
<a name="l00117"></a>00117 start = buffer.find_first_not_of(<span class="stringliteral">" "</span>);
<a name="l00118"></a>00118 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0 ; i&lt;M ; i++) {
<a name="l00119"></a>00119 end = buffer.find_first_of(<span class="stringliteral">" "</span>, start);
<a name="l00120"></a>00120 <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>[i][j] = atoi(buffer.substr(start, end-start).data());
<a name="l00121"></a>00121 start = buffer.find_first_not_of(<span class="stringliteral">" "</span>, end);
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="comment">// closing of the input file</span>
<a name="l00125"></a>00125 inputFile.close();
<a name="l00126"></a>00126 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,61 +21,86 @@
</form>
</li>
</ul></div>
<h1>FlowShopBenchmarkParser.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopBenchmarkParser.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPBENCHMARKPARSER_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPBENCHMARKPARSER_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00019"></a>00019
<a name="l00023"></a><a class="code" href="classFlowShopBenchmarkParser.html">00023</a> <span class="keyword">class </span><a class="code" href="classFlowShopBenchmarkParser.html">FlowShopBenchmarkParser</a>
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 <span class="keyword">public</span>:
<a name="l00026"></a>00026
<a name="l00031"></a>00031 <a class="code" href="classFlowShopBenchmarkParser.html#2787b88a1be9d4d37438c557bf32f137">FlowShopBenchmarkParser</a>(<span class="keyword">const</span> std::string _benchmarkFileName);
<a name="l00032"></a>00032
<a name="l00033"></a>00033
<a name="l00037"></a>00037 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#8d5042c2f8727e235f94c947b2ba00a5">getM</a>();
<a name="l00038"></a>00038
<a name="l00039"></a>00039
<a name="l00043"></a>00043 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#fe16df4df5104aee3d792e60bb32a66d">getN</a>();
<h1>FlowShopBenchmarkParser.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;FlowShopBenchmarkParser.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPBENCHMARKPARSER_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPBENCHMARKPARSER_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00044"></a>00044
<a name="l00045"></a>00045
<a name="l00049"></a>00049 <span class="keyword">const</span> std::vector &lt; std::vector &lt; unsigned int &gt; &gt; <a class="code" href="classFlowShopBenchmarkParser.html#2df87bf8a18a55266729ab105955d7bf">getP</a>();
<a name="l00050"></a>00050
<a name="l00048"></a><a class="code" href="classFlowShopBenchmarkParser.html">00048</a> <span class="keyword">class </span><a class="code" href="classFlowShopBenchmarkParser.html">FlowShopBenchmarkParser</a>
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050 <span class="keyword">public</span>:
<a name="l00051"></a>00051
<a name="l00055"></a>00055 <span class="keyword">const</span> std::vector &lt; unsigned int &gt; <a class="code" href="classFlowShopBenchmarkParser.html#b362d0042273be436c55637828d8582d">getD</a>();
<a name="l00056"></a>00056
<a name="l00056"></a>00056 <a class="code" href="classFlowShopBenchmarkParser.html#2787b88a1be9d4d37438c557bf32f137">FlowShopBenchmarkParser</a>(<span class="keyword">const</span> std::string _benchmarkFileName);
<a name="l00057"></a>00057
<a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#69c9ba47e774da4b06424a724573265d">printOn</a>(std::ostream &amp; _os) <span class="keyword">const</span>;
<a name="l00062"></a>00062
<a name="l00058"></a>00058
<a name="l00062"></a>00062 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#8d5042c2f8727e235f94c947b2ba00a5">getM</a>();
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="keyword">private</span>:
<a name="l00065"></a>00065
<a name="l00067"></a><a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">00067</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>;
<a name="l00069"></a><a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">00069</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>;
<a name="l00071"></a><a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">00071</a> std::vector &lt; std::vector &lt; unsigned int &gt; &gt; <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>;
<a name="l00073"></a><a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">00073</a> std::vector &lt; unsigned int &gt; <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a>;
<a name="l00074"></a>00074
<a name="l00064"></a>00064
<a name="l00068"></a>00068 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#fe16df4df5104aee3d792e60bb32a66d">getN</a>();
<a name="l00069"></a>00069
<a name="l00070"></a>00070
<a name="l00074"></a>00074 <span class="keyword">const</span> std::vector &lt; std::vector &lt; unsigned int &gt; &gt; <a class="code" href="classFlowShopBenchmarkParser.html#2df87bf8a18a55266729ab105955d7bf">getP</a>();
<a name="l00075"></a>00075
<a name="l00080"></a>00080 <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">init</a>(<span class="keyword">const</span> std::string _benchmarkFileName);
<a name="l00076"></a>00076
<a name="l00080"></a>00080 <span class="keyword">const</span> std::vector &lt; unsigned int &gt; <a class="code" href="classFlowShopBenchmarkParser.html#b362d0042273be436c55637828d8582d">getD</a>();
<a name="l00081"></a>00081
<a name="l00082"></a>00082 };
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPBENCHMARKPARSER_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00082"></a>00082
<a name="l00086"></a>00086 <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#69c9ba47e774da4b06424a724573265d">printOn</a>(std::ostream &amp; _os) <span class="keyword">const</span>;
<a name="l00087"></a>00087
<a name="l00088"></a>00088
<a name="l00089"></a>00089 <span class="keyword">private</span>:
<a name="l00090"></a>00090
<a name="l00092"></a><a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">00092</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#4cc02556c751afe32e8800544160c7c7">M</a>;
<a name="l00094"></a><a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">00094</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopBenchmarkParser.html#fb220e40e9f94e3c1d3a7eb437aeffce">N</a>;
<a name="l00096"></a><a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">00096</a> std::vector &lt; std::vector &lt; unsigned int &gt; &gt; <a class="code" href="classFlowShopBenchmarkParser.html#4c1ce3d710b6605ddcc723101b808de5">p</a>;
<a name="l00098"></a><a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">00098</a> std::vector &lt; unsigned int &gt; <a class="code" href="classFlowShopBenchmarkParser.html#8898519f54465b2d23a846053363bf4b">d</a>;
<a name="l00099"></a>00099
<a name="l00100"></a>00100
<a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="classFlowShopBenchmarkParser.html#4e6de6a0ec2859e1a2fb758fb06dc915">init</a>(<span class="keyword">const</span> std::string _benchmarkFileName);
<a name="l00106"></a>00106
<a name="l00107"></a>00107 };
<a name="l00108"></a>00108
<a name="l00109"></a>00109 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPBENCHMARKPARSER_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,114 +21,139 @@
</form>
</li>
</ul></div>
<h1>FlowShopEA.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopEA.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013
<a name="l00014"></a>00014 <span class="comment">// moeo general include</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;moeo&gt;</span>
<a name="l00016"></a>00016 <span class="comment">// for the creation of an evaluator</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;make_eval_FlowShop.h&gt;</span>
<a name="l00018"></a>00018 <span class="comment">// for the creation of an initializer</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;make_genotype_FlowShop.h&gt;</span>
<a name="l00020"></a>00020 <span class="comment">// for the creation of the variation operators</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;make_op_FlowShop.h&gt;</span>
<a name="l00022"></a>00022 <span class="comment">// how to initialize the population</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;do/make_pop.h&gt;</span>
<a name="l00024"></a>00024 <span class="comment">// the stopping criterion</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;do/make_continue_moeo.h&gt;</span>
<a name="l00026"></a>00026 <span class="comment">// outputs (stats, population dumps, ...)</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;do/make_checkpoint_moeo.h&gt;</span>
<a name="l00028"></a>00028 <span class="comment">// evolution engine (selection and replacement)</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;do/make_ea_moeo.h&gt;</span>
<a name="l00030"></a>00030 <span class="comment">// simple call to the algo</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;do/make_run.h&gt;</span>
<a name="l00032"></a>00032 <span class="comment">// checks for help demand, and writes the status file and make_help; in libutils</span>
<a name="l00033"></a>00033 <span class="keywordtype">void</span> make_help(<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_parser.html">eoParser</a> &amp; _parser);
<a name="l00034"></a>00034 <span class="comment">// definition of the representation</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00036"></a>00036
<h1>FlowShopEA.cpp</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;FlowShopEA.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keyword">using namespace </span>std;
<a name="l00039"></a>00039
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043 <span class="keywordflow">try</span>
<a name="l00044"></a>00044 {
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_parser.html">eoParser</a> parser(argc, argv); <span class="comment">// for user-parameter reading</span>
<a name="l00047"></a>00047 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_state.html">eoState</a> state; <span class="comment">// to keep all things allocated</span>
<a name="l00048"></a>00048
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="comment">/*** the representation-dependent things ***/</span>
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="comment">// The fitness evaluation</span>
<a name="l00053"></a>00053 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_eval_func_counter.html">eoEvalFuncCounter&lt;FlowShop&gt;</a>&amp; eval = do_make_eval(parser, state);
<a name="l00054"></a>00054 <span class="comment">// the genotype (through a genotype initializer)</span>
<a name="l00055"></a>00055 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_init.html">eoInit&lt;FlowShop&gt;</a>&amp; init = do_make_genotype(parser, state);
<a name="l00056"></a>00056 <span class="comment">// the variation operators</span>
<a name="l00057"></a>00057 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_gen_op.html">eoGenOp&lt;FlowShop&gt;</a>&amp; op = do_make_op(parser, state);
<a name="l00058"></a>00058
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="comment">/*** the representation-independent things ***/</span>
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="comment">// moeo general include</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;moeo&gt;</span>
<a name="l00041"></a>00041 <span class="comment">// for the creation of an evaluator</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;make_eval_FlowShop.h&gt;</span>
<a name="l00043"></a>00043 <span class="comment">// for the creation of an initializer</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &lt;make_genotype_FlowShop.h&gt;</span>
<a name="l00045"></a>00045 <span class="comment">// for the creation of the variation operators</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;make_op_FlowShop.h&gt;</span>
<a name="l00047"></a>00047 <span class="comment">// how to initialize the population</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;do/make_pop.h&gt;</span>
<a name="l00049"></a>00049 <span class="comment">// the stopping criterion</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;do/make_continue_moeo.h&gt;</span>
<a name="l00051"></a>00051 <span class="comment">// outputs (stats, population dumps, ...)</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &lt;do/make_checkpoint_moeo.h&gt;</span>
<a name="l00053"></a>00053 <span class="comment">// evolution engine (selection and replacement)</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &lt;do/make_ea_moeo.h&gt;</span>
<a name="l00055"></a>00055 <span class="comment">// simple call to the algo</span>
<a name="l00056"></a>00056 <span class="preprocessor">#include &lt;do/make_run.h&gt;</span>
<a name="l00057"></a>00057 <span class="comment">// checks for help demand, and writes the status file and make_help; in libutils</span>
<a name="l00058"></a>00058 <span class="keywordtype">void</span> make_help(<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_parser.html">eoParser</a> &amp; _parser);
<a name="l00059"></a>00059 <span class="comment">// definition of the representation</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="comment">// initialization of the population</span>
<a name="l00063"></a>00063 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt;FlowShop&gt;</a>&amp; pop = do_make_pop(parser, state, init);
<a name="l00064"></a>00064 <span class="comment">// definition of the archive</span>
<a name="l00065"></a>00065 <a class="code" href="classmoeoArchive.html">moeoArchive&lt;FlowShop&gt;</a> arch;
<a name="l00066"></a>00066 <span class="comment">// stopping criteria</span>
<a name="l00067"></a>00067 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_continue.html">eoContinue&lt;FlowShop&gt;</a>&amp; term = do_make_continue_moeo(parser, state, eval);
<a name="l00068"></a>00068 <span class="comment">// output</span>
<a name="l00069"></a>00069 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_check_point.html">eoCheckPoint&lt;FlowShop&gt;</a>&amp; checkpoint = do_make_checkpoint_moeo(parser, state, eval, term, pop, arch);
<a name="l00070"></a>00070 <span class="comment">// algorithm</span>
<a name="l00071"></a>00071 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_algo.html">eoAlgo&lt;FlowShop&gt;</a>&amp; algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch);
<a name="l00072"></a>00072
<a name="l00062"></a>00062
<a name="l00063"></a>00063 <span class="keyword">using namespace </span>std;
<a name="l00064"></a>00064
<a name="l00065"></a>00065
<a name="l00066"></a>00066 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068 <span class="keywordflow">try</span>
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070
<a name="l00071"></a>00071 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_parser.html">eoParser</a> parser(argc, argv); <span class="comment">// for user-parameter reading</span>
<a name="l00072"></a>00072 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_state.html">eoState</a> state; <span class="comment">// to keep all things allocated</span>
<a name="l00073"></a>00073
<a name="l00074"></a>00074 <span class="comment">/*** Go ! ***/</span>
<a name="l00075"></a>00075
<a name="l00076"></a>00076 <span class="comment">// help ?</span>
<a name="l00077"></a>00077 make_help(parser);
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="comment">// first evalution</span>
<a name="l00080"></a>00080 apply&lt;FlowShop&gt;(eval, pop);
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="comment">// printing of the initial population</span>
<a name="l00083"></a>00083 cout &lt;&lt; <span class="stringliteral">"Initial Population\n"</span>;
<a name="l00084"></a>00084 pop.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html#b6572898562eebe5bab105c4475a9a64">sortedPrintOn</a>(cout);
<a name="l00085"></a>00085 cout &lt;&lt; endl;
<a name="l00074"></a>00074
<a name="l00075"></a>00075 <span class="comment">/*** the representation-dependent things ***/</span>
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="comment">// The fitness evaluation</span>
<a name="l00078"></a>00078 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_eval_func_counter.html">eoEvalFuncCounter&lt;FlowShop&gt;</a>&amp; eval = do_make_eval(parser, state);
<a name="l00079"></a>00079 <span class="comment">// the genotype (through a genotype initializer)</span>
<a name="l00080"></a>00080 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_init.html">eoInit&lt;FlowShop&gt;</a>&amp; init = do_make_genotype(parser, state);
<a name="l00081"></a>00081 <span class="comment">// the variation operators</span>
<a name="l00082"></a>00082 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_gen_op.html">eoGenOp&lt;FlowShop&gt;</a>&amp; op = do_make_op(parser, state);
<a name="l00083"></a>00083
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="comment">/*** the representation-independent things ***/</span>
<a name="l00086"></a>00086
<a name="l00087"></a>00087 <span class="comment">// run the algo</span>
<a name="l00088"></a>00088 do_run(algo, pop);
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="comment">// printing of the final population</span>
<a name="l00091"></a>00091 cout &lt;&lt; <span class="stringliteral">"Final Population\n"</span>;
<a name="l00092"></a>00092 pop.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html#b6572898562eebe5bab105c4475a9a64">sortedPrintOn</a>(cout);
<a name="l00093"></a>00093 cout &lt;&lt; endl;
<a name="l00094"></a>00094
<a name="l00095"></a>00095 <span class="comment">// printing of the final archive</span>
<a name="l00096"></a>00096 cout &lt;&lt; <span class="stringliteral">"Final Archive\n"</span>;
<a name="l00097"></a>00097 arch.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html#b6572898562eebe5bab105c4475a9a64">sortedPrintOn</a>(cout);
<a name="l00098"></a>00098 cout &lt;&lt; endl;
<a name="l00099"></a>00099
<a name="l00087"></a>00087 <span class="comment">// initialization of the population</span>
<a name="l00088"></a>00088 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt;FlowShop&gt;</a>&amp; pop = do_make_pop(parser, state, init);
<a name="l00089"></a>00089 <span class="comment">// definition of the archive</span>
<a name="l00090"></a>00090 <a class="code" href="classmoeoArchive.html">moeoArchive&lt;FlowShop&gt;</a> arch;
<a name="l00091"></a>00091 <span class="comment">// stopping criteria</span>
<a name="l00092"></a>00092 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_continue.html">eoContinue&lt;FlowShop&gt;</a>&amp; term = do_make_continue_moeo(parser, state, eval);
<a name="l00093"></a>00093 <span class="comment">// output</span>
<a name="l00094"></a>00094 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_check_point.html">eoCheckPoint&lt;FlowShop&gt;</a>&amp; checkpoint = do_make_checkpoint_moeo(parser, state, eval, term, pop, arch);
<a name="l00095"></a>00095 <span class="comment">// algorithm</span>
<a name="l00096"></a>00096 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_algo.html">eoAlgo&lt;FlowShop&gt;</a>&amp; algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch);
<a name="l00097"></a>00097
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="comment">/*** Go ! ***/</span>
<a name="l00100"></a>00100
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102 <span class="keywordflow">catch</span> (exception&amp; e)
<a name="l00103"></a>00103 {
<a name="l00104"></a>00104 cout &lt;&lt; e.what() &lt;&lt; endl;
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106 <span class="keywordflow">return</span> EXIT_SUCCESS;
<a name="l00107"></a>00107 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00101"></a>00101 <span class="comment">// help ?</span>
<a name="l00102"></a>00102 make_help(parser);
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <span class="comment">// first evalution</span>
<a name="l00105"></a>00105 apply&lt;FlowShop&gt;(eval, pop);
<a name="l00106"></a>00106
<a name="l00107"></a>00107 <span class="comment">// printing of the initial population</span>
<a name="l00108"></a>00108 cout &lt;&lt; <span class="stringliteral">"Initial Population\n"</span>;
<a name="l00109"></a>00109 pop.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html#b6572898562eebe5bab105c4475a9a64">sortedPrintOn</a>(cout);
<a name="l00110"></a>00110 cout &lt;&lt; endl;
<a name="l00111"></a>00111
<a name="l00112"></a>00112 <span class="comment">// run the algo</span>
<a name="l00113"></a>00113 do_run(algo, pop);
<a name="l00114"></a>00114
<a name="l00115"></a>00115 <span class="comment">// printing of the final population</span>
<a name="l00116"></a>00116 cout &lt;&lt; <span class="stringliteral">"Final Population\n"</span>;
<a name="l00117"></a>00117 pop.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html#b6572898562eebe5bab105c4475a9a64">sortedPrintOn</a>(cout);
<a name="l00118"></a>00118 cout &lt;&lt; endl;
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <span class="comment">// printing of the final archive</span>
<a name="l00121"></a>00121 cout &lt;&lt; <span class="stringliteral">"Final Archive\n"</span>;
<a name="l00122"></a>00122 arch.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html#b6572898562eebe5bab105c4475a9a64">sortedPrintOn</a>(cout);
<a name="l00123"></a>00123 cout &lt;&lt; endl;
<a name="l00124"></a>00124
<a name="l00125"></a>00125
<a name="l00126"></a>00126 }
<a name="l00127"></a>00127 <span class="keywordflow">catch</span> (exception&amp; e)
<a name="l00128"></a>00128 {
<a name="l00129"></a>00129 cout &lt;&lt; e.what() &lt;&lt; endl;
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131 <span class="keywordflow">return</span> EXIT_SUCCESS;
<a name="l00132"></a>00132 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,71 +21,96 @@
</form>
</li>
</ul></div>
<h1>FlowShopEval.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopEval.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;FlowShopEval.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classFlowShopEval.html#f830293ad66a253a4008937fd6d68fce">00016</a> <a class="code" href="classFlowShopEval.html#f830293ad66a253a4008937fd6d68fce">FlowShopEval::FlowShopEval</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _M, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N, <span class="keyword">const</span> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; &amp; _p, <span class="keyword">const</span> std::vector&lt;unsigned int&gt; &amp; _d) :
<a name="l00017"></a>00017 M(_M), N (_N), p(_p), d(_d)
<a name="l00018"></a>00018 {}
<a name="l00019"></a>00019
<a name="l00020"></a>00020
<a name="l00021"></a><a class="code" href="classFlowShopEval.html#d6ea74de6e62c2b104b52aa68b5da3a5">00021</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopEval.html#d6ea74de6e62c2b104b52aa68b5da3a5">FlowShopEval::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00022"></a>00022 {
<a name="l00023"></a>00023 <a class="code" href="classmoeoRealObjectiveVector.html">FlowShopObjectiveVector</a> objVector;
<a name="l00024"></a>00024 objVector[0] = <a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">makespan</a>(_flowshop);
<a name="l00025"></a>00025 objVector[1] = <a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">tardiness</a>(_flowshop);
<a name="l00026"></a>00026 _flowshop.<a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>(objVector);
<a name="l00027"></a>00027 }
<a name="l00028"></a>00028
<a name="l00029"></a>00029
<a name="l00030"></a>00030
<a name="l00031"></a><a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">00031</a> <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">FlowShopEval::makespan</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 <span class="comment">// completion times computation for each job on each machine</span>
<a name="l00034"></a>00034 <span class="comment">// C[i][j] = completion of the jth job of the scheduling on the ith machine</span>
<a name="l00035"></a>00035 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; C = <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">completionTime</a>(_flowshop);
<a name="l00036"></a>00036 <span class="keywordflow">return</span> C[<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>-1][_flowshop[<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>-1]];
<a name="l00037"></a>00037 }
<a name="l00038"></a>00038
<h1>FlowShopEval.cpp</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;FlowShopEval.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;FlowShopEval.h&gt;</span>
<a name="l00039"></a>00039
<a name="l00040"></a><a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">00040</a> <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">FlowShopEval::tardiness</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 <span class="comment">// completion times computation for each job on each machine</span>
<a name="l00043"></a>00043 <span class="comment">// C[i][j] = completion of the jth job of the scheduling on the ith machine</span>
<a name="l00044"></a>00044 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; C = <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">completionTime</a>(_flowshop);
<a name="l00045"></a>00045 <span class="comment">// tardiness computation</span>
<a name="l00046"></a>00046 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="keywordtype">long</span> sum = 0;
<a name="l00047"></a>00047 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0 ; j&lt;<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a> ; j++)
<a name="l00048"></a>00048 sum += (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) std::max (0, (<span class="keywordtype">int</span>) (C[<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>-1][_flowshop[j]] - <a class="code" href="classFlowShopEval.html#a283f1bfd433ec1bd3a45c46bd6e3ba4">d</a>[_flowshop[j]]));
<a name="l00049"></a>00049 <span class="keywordflow">return</span> sum;
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051
<a name="l00052"></a>00052
<a name="l00053"></a><a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">00053</a> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">FlowShopEval::completionTime</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop) {
<a name="l00054"></a>00054 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; C(<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>,<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>);
<a name="l00055"></a>00055 C[0][_flowshop[0]] = <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[0][_flowshop[0]];
<a name="l00056"></a>00056 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=1; j&lt;<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>; j++)
<a name="l00057"></a>00057 C[0][_flowshop[j]] = C[0][_flowshop[j-1]] + <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[0][_flowshop[j]];
<a name="l00058"></a>00058 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=1; i&lt;<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>; i++)
<a name="l00059"></a>00059 C[i][_flowshop[0]] = C[i-1][_flowshop[0]] + <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[i][_flowshop[0]];
<a name="l00060"></a>00060 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=1; i&lt;M; i++)
<a name="l00061"></a>00061 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=1; j&lt;N; j++)
<a name="l00062"></a>00062 C[i][_flowshop[j]] = std::max(C[i][_flowshop[j-1]], C[i-1][_flowshop[j]]) + <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[i][_flowshop[j]];
<a name="l00063"></a>00063 <span class="keywordflow">return</span> C;
<a name="l00064"></a>00064 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classFlowShopEval.html#f830293ad66a253a4008937fd6d68fce">00041</a> <a class="code" href="classFlowShopEval.html#f830293ad66a253a4008937fd6d68fce">FlowShopEval::FlowShopEval</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _M, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N, <span class="keyword">const</span> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; &amp; _p, <span class="keyword">const</span> std::vector&lt;unsigned int&gt; &amp; _d) :
<a name="l00042"></a>00042 M(_M), N (_N), p(_p), d(_d)
<a name="l00043"></a>00043 {}
<a name="l00044"></a>00044
<a name="l00045"></a>00045
<a name="l00046"></a><a class="code" href="classFlowShopEval.html#d6ea74de6e62c2b104b52aa68b5da3a5">00046</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopEval.html#d6ea74de6e62c2b104b52aa68b5da3a5">FlowShopEval::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 <a class="code" href="classmoeoRealObjectiveVector.html">FlowShopObjectiveVector</a> objVector;
<a name="l00049"></a>00049 objVector[0] = <a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">makespan</a>(_flowshop);
<a name="l00050"></a>00050 objVector[1] = <a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">tardiness</a>(_flowshop);
<a name="l00051"></a>00051 _flowshop.<a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>(objVector);
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053
<a name="l00054"></a>00054
<a name="l00055"></a>00055
<a name="l00056"></a><a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">00056</a> <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">FlowShopEval::makespan</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 <span class="comment">// completion times computation for each job on each machine</span>
<a name="l00059"></a>00059 <span class="comment">// C[i][j] = completion of the jth job of the scheduling on the ith machine</span>
<a name="l00060"></a>00060 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; C = <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">completionTime</a>(_flowshop);
<a name="l00061"></a>00061 <span class="keywordflow">return</span> C[<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>-1][_flowshop[<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>-1]];
<a name="l00062"></a>00062 }
<a name="l00063"></a>00063
<a name="l00064"></a>00064
<a name="l00065"></a><a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">00065</a> <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">FlowShopEval::tardiness</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00066"></a>00066 {
<a name="l00067"></a>00067 <span class="comment">// completion times computation for each job on each machine</span>
<a name="l00068"></a>00068 <span class="comment">// C[i][j] = completion of the jth job of the scheduling on the ith machine</span>
<a name="l00069"></a>00069 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; C = <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">completionTime</a>(_flowshop);
<a name="l00070"></a>00070 <span class="comment">// tardiness computation</span>
<a name="l00071"></a>00071 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="keywordtype">long</span> sum = 0;
<a name="l00072"></a>00072 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=0 ; j&lt;<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a> ; j++)
<a name="l00073"></a>00073 sum += (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) std::max (0, (<span class="keywordtype">int</span>) (C[<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>-1][_flowshop[j]] - <a class="code" href="classFlowShopEval.html#a283f1bfd433ec1bd3a45c46bd6e3ba4">d</a>[_flowshop[j]]));
<a name="l00074"></a>00074 <span class="keywordflow">return</span> sum;
<a name="l00075"></a>00075 }
<a name="l00076"></a>00076
<a name="l00077"></a>00077
<a name="l00078"></a><a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">00078</a> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">FlowShopEval::completionTime</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop) {
<a name="l00079"></a>00079 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; C(<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>,<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>);
<a name="l00080"></a>00080 C[0][_flowshop[0]] = <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[0][_flowshop[0]];
<a name="l00081"></a>00081 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=1; j&lt;<a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>; j++)
<a name="l00082"></a>00082 C[0][_flowshop[j]] = C[0][_flowshop[j-1]] + <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[0][_flowshop[j]];
<a name="l00083"></a>00083 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=1; i&lt;<a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>; i++)
<a name="l00084"></a>00084 C[i][_flowshop[0]] = C[i-1][_flowshop[0]] + <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[i][_flowshop[0]];
<a name="l00085"></a>00085 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=1; i&lt;M; i++)
<a name="l00086"></a>00086 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j=1; j&lt;N; j++)
<a name="l00087"></a>00087 C[i][_flowshop[j]] = std::max(C[i][_flowshop[j-1]], C[i-1][_flowshop[j]]) + <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>[i][_flowshop[j]];
<a name="l00088"></a>00088 <span class="keywordflow">return</span> C;
<a name="l00089"></a>00089 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,55 +21,80 @@
</form>
</li>
</ul></div>
<h1>FlowShopEval.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopEval.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPEVAL_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPEVAL_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;core/moeoEvalFunc.h&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00019"></a>00019
<a name="l00023"></a><a class="code" href="classFlowShopEval.html">00023</a> <span class="keyword">class </span><a class="code" href="classFlowShopEval.html">FlowShopEval</a> : <span class="keyword">public</span> <a class="code" href="classmoeoEvalFunc.html">moeoEvalFunc</a>&lt;FlowShop&gt;
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 <span class="keyword">public</span>:
<a name="l00026"></a>00026
<a name="l00034"></a>00034 <a class="code" href="classFlowShopEval.html#f830293ad66a253a4008937fd6d68fce">FlowShopEval</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _M, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N, <span class="keyword">const</span> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; &amp; _p, <span class="keyword">const</span> std::vector&lt;unsigned int&gt; &amp; _d);
<a name="l00035"></a>00035
<a name="l00036"></a>00036
<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classFlowShopEval.html#d6ea74de6e62c2b104b52aa68b5da3a5">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00042"></a>00042
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keyword">private</span>:
<a name="l00045"></a>00045
<a name="l00047"></a><a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">00047</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>;
<a name="l00049"></a><a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">00049</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>;
<a name="l00051"></a><a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">00051</a> std::vector&lt; std::vector &lt; unsigned int &gt; &gt; <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>;
<a name="l00053"></a><a class="code" href="classFlowShopEval.html#a283f1bfd433ec1bd3a45c46bd6e3ba4">00053</a> std::vector &lt; unsigned int &gt; <a class="code" href="classFlowShopEval.html#a283f1bfd433ec1bd3a45c46bd6e3ba4">d</a>;
<a name="l00054"></a>00054
<a name="l00055"></a>00055
<a name="l00060"></a>00060 <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">makespan</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<h1>FlowShopEval.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;FlowShopEval.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPEVAL_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPEVAL_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;core/moeoEvalFunc.h&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00044"></a>00044
<a name="l00048"></a><a class="code" href="classFlowShopEval.html">00048</a> <span class="keyword">class </span><a class="code" href="classFlowShopEval.html">FlowShopEval</a> : <span class="keyword">public</span> <a class="code" href="classmoeoEvalFunc.html">moeoEvalFunc</a>&lt;FlowShop&gt;
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050 <span class="keyword">public</span>:
<a name="l00051"></a>00051
<a name="l00059"></a>00059 <a class="code" href="classFlowShopEval.html#f830293ad66a253a4008937fd6d68fce">FlowShopEval</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _M, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N, <span class="keyword">const</span> std::vector&lt; std::vector&lt;unsigned int&gt; &gt; &amp; _p, <span class="keyword">const</span> std::vector&lt;unsigned int&gt; &amp; _d);
<a name="l00060"></a>00060
<a name="l00061"></a>00061
<a name="l00062"></a>00062
<a name="l00067"></a>00067 <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">tardiness</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classFlowShopEval.html#d6ea74de6e62c2b104b52aa68b5da3a5">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00067"></a>00067
<a name="l00068"></a>00068
<a name="l00069"></a>00069
<a name="l00075"></a>00075 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">completionTime</a> (<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00076"></a>00076
<a name="l00077"></a>00077 };
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPEVAL_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00069"></a>00069 <span class="keyword">private</span>:
<a name="l00070"></a>00070
<a name="l00072"></a><a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">00072</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopEval.html#9c7c7263d8c04d18d66729f4875d46cd">M</a>;
<a name="l00074"></a><a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">00074</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopEval.html#48c4a108b54c2c949cb649e470c9e8c4">N</a>;
<a name="l00076"></a><a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">00076</a> std::vector&lt; std::vector &lt; unsigned int &gt; &gt; <a class="code" href="classFlowShopEval.html#f4152ec0542e13cbc8f4c4ece284a2b4">p</a>;
<a name="l00078"></a><a class="code" href="classFlowShopEval.html#a283f1bfd433ec1bd3a45c46bd6e3ba4">00078</a> std::vector &lt; unsigned int &gt; <a class="code" href="classFlowShopEval.html#a283f1bfd433ec1bd3a45c46bd6e3ba4">d</a>;
<a name="l00079"></a>00079
<a name="l00080"></a>00080
<a name="l00085"></a>00085 <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#8b383e0c6cfd68fdf61e987b5fc91cf3">makespan</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00086"></a>00086
<a name="l00087"></a>00087
<a name="l00092"></a>00092 <span class="keywordtype">double</span> <a class="code" href="classFlowShopEval.html#25d04be8fd17b5589fdac732accaaf9e">tardiness</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00093"></a>00093
<a name="l00094"></a>00094
<a name="l00100"></a>00100 std::vector&lt; std::vector&lt;unsigned int&gt; &gt; <a class="code" href="classFlowShopEval.html#84cfc6f7bee1c0e4b1a29ca99e3c129b">completionTime</a> (<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00101"></a>00101
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPEVAL_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,46 +21,71 @@
</form>
</li>
</ul></div>
<h1>FlowShopInit.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopInit.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;FlowShopInit.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classFlowShopInit.html#8ede459984d5de13c6a181c72cf4551e">00016</a> <a class="code" href="classFlowShopInit.html#8ede459984d5de13c6a181c72cf4551e">FlowShopInit::FlowShopInit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N) : N(_N)
<a name="l00017"></a>00017 {}
<a name="l00018"></a>00018
<a name="l00019"></a>00019
<a name="l00020"></a><a class="code" href="classFlowShopInit.html#3df0d9e3834cdfa494683df7e8646025">00020</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopInit.html#3df0d9e3834cdfa494683df7e8646025">FlowShopInit::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022 <span class="comment">// scheduling vector</span>
<a name="l00023"></a>00023 std::vector&lt;unsigned int&gt; scheduling(<a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a>);
<a name="l00024"></a>00024 <span class="comment">// initialisation of possible values</span>
<a name="l00025"></a>00025 std::vector&lt;unsigned int&gt; possibles(<a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a>);
<a name="l00026"></a>00026 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0 ; i&lt;<a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a> ; i++)
<a name="l00027"></a>00027 possibles[i] = i;
<a name="l00028"></a>00028 <span class="comment">// random initialization</span>
<a name="l00029"></a>00029 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rInd; <span class="comment">// random index</span>
<a name="l00030"></a>00030 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;N; i++)
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 rInd = (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#50dfb052f11ae50326e552cb223d88e4">uniform</a>(N-i);
<a name="l00033"></a>00033 scheduling[i] = possibles[rInd];
<a name="l00034"></a>00034 possibles[rInd] = possibles[N-i-1];
<a name="l00035"></a>00035 }
<a name="l00036"></a>00036 _flowshop.resize(N);
<a name="l00037"></a>00037 _flowshop.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(scheduling);
<a name="l00038"></a>00038 _flowshop.<a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">invalidate</a>(); <span class="comment">// IMPORTANT in case the _genotype is old</span>
<a name="l00039"></a>00039 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShopInit.cpp</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;FlowShopInit.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;FlowShopInit.h&gt;</span>
<a name="l00039"></a>00039
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classFlowShopInit.html#8ede459984d5de13c6a181c72cf4551e">00041</a> <a class="code" href="classFlowShopInit.html#8ede459984d5de13c6a181c72cf4551e">FlowShopInit::FlowShopInit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N) : N(_N)
<a name="l00042"></a>00042 {}
<a name="l00043"></a>00043
<a name="l00044"></a>00044
<a name="l00045"></a><a class="code" href="classFlowShopInit.html#3df0d9e3834cdfa494683df7e8646025">00045</a> <span class="keywordtype">void</span> <a class="code" href="classFlowShopInit.html#3df0d9e3834cdfa494683df7e8646025">FlowShopInit::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="comment">// scheduling vector</span>
<a name="l00048"></a>00048 std::vector&lt;unsigned int&gt; scheduling(<a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a>);
<a name="l00049"></a>00049 <span class="comment">// initialisation of possible values</span>
<a name="l00050"></a>00050 std::vector&lt;unsigned int&gt; possibles(<a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a>);
<a name="l00051"></a>00051 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0 ; i&lt;<a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a> ; i++)
<a name="l00052"></a>00052 possibles[i] = i;
<a name="l00053"></a>00053 <span class="comment">// random initialization</span>
<a name="l00054"></a>00054 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rInd; <span class="comment">// random index</span>
<a name="l00055"></a>00055 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;N; i++)
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 rInd = (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#50dfb052f11ae50326e552cb223d88e4">uniform</a>(N-i);
<a name="l00058"></a>00058 scheduling[i] = possibles[rInd];
<a name="l00059"></a>00059 possibles[rInd] = possibles[N-i-1];
<a name="l00060"></a>00060 }
<a name="l00061"></a>00061 _flowshop.resize(N);
<a name="l00062"></a>00062 _flowshop.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(scheduling);
<a name="l00063"></a>00063 _flowshop.<a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">invalidate</a>(); <span class="comment">// IMPORTANT in case the _genotype is old</span>
<a name="l00064"></a>00064 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,42 +21,67 @@
</form>
</li>
</ul></div>
<h1>FlowShopInit.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopInit.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPINIT_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPINIT_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;eoInit.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00018"></a>00018
<a name="l00022"></a><a class="code" href="classFlowShopInit.html">00022</a> <span class="keyword">class </span><a class="code" href="classFlowShopInit.html">FlowShopInit</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_init.html">eoInit</a>&lt;FlowShop&gt;
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keyword">public</span>:
<a name="l00025"></a>00025
<a name="l00030"></a>00030 <a class="code" href="classFlowShopInit.html#8ede459984d5de13c6a181c72cf4551e">FlowShopInit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N);
<a name="l00031"></a>00031
<a name="l00032"></a>00032
<a name="l00037"></a>00037 <span class="keywordtype">void</span> <a class="code" href="classFlowShopInit.html#3df0d9e3834cdfa494683df7e8646025">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00038"></a>00038
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="keyword">private</span>:
<a name="l00041"></a>00041
<a name="l00043"></a><a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">00043</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a>;
<a name="l00044"></a>00044
<a name="l00045"></a>00045 };
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPINIT_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShopInit.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;FlowShopInit.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPINIT_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPINIT_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;eoInit.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00043"></a>00043
<a name="l00047"></a><a class="code" href="classFlowShopInit.html">00047</a> <span class="keyword">class </span><a class="code" href="classFlowShopInit.html">FlowShopInit</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_init.html">eoInit</a>&lt;FlowShop&gt;
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a>00050
<a name="l00055"></a>00055 <a class="code" href="classFlowShopInit.html#8ede459984d5de13c6a181c72cf4551e">FlowShopInit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _N);
<a name="l00056"></a>00056
<a name="l00057"></a>00057
<a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="classFlowShopInit.html#3df0d9e3834cdfa494683df7e8646025">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00063"></a>00063
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="keyword">private</span>:
<a name="l00066"></a>00066
<a name="l00068"></a><a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">00068</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopInit.html#3bf7c402441e5bba3397377630e6ff4c">N</a>;
<a name="l00069"></a>00069
<a name="l00070"></a>00070 };
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPINIT_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,39 +21,64 @@
</form>
</li>
</ul></div>
<h1>FlowShopObjectiveVectorTraits.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopObjectiveVectorTraits.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;FlowShopObjectiveVectorTraits.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html#e1a0f5be1782b9f9ce08128a404a1fa8">00016</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#e1a0f5be1782b9f9ce08128a404a1fa8">FlowShopObjectiveVectorTraits::minimizing</a> (<span class="keywordtype">int</span> _i)
<a name="l00017"></a>00017 {
<a name="l00018"></a>00018 <span class="comment">// minimizing both</span>
<a name="l00019"></a>00019 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00020"></a>00020 }
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html#229fbb4cc19d289637891c1b49f3eaba">00022</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#229fbb4cc19d289637891c1b49f3eaba">FlowShopObjectiveVectorTraits::maximizing</a> (<span class="keywordtype">int</span> _i)
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="comment">// minimizing both</span>
<a name="l00025"></a>00025 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00026"></a>00026 }
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html#76ebe7639b502980bc683ab404b69c10">00028</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#76ebe7639b502980bc683ab404b69c10">FlowShopObjectiveVectorTraits::nObjectives</a> ()
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 <span class="comment">// 2 objectives</span>
<a name="l00031"></a>00031 <span class="keywordflow">return</span> 2;
<a name="l00032"></a>00032 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShopObjectiveVectorTraits.cpp</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;FlowShopObjectiveVectorTraits.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;FlowShopObjectiveVectorTraits.h&gt;</span>
<a name="l00039"></a>00039
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html#e1a0f5be1782b9f9ce08128a404a1fa8">00041</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#e1a0f5be1782b9f9ce08128a404a1fa8">FlowShopObjectiveVectorTraits::minimizing</a> (<span class="keywordtype">int</span> _i)
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043 <span class="comment">// minimizing both</span>
<a name="l00044"></a>00044 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00045"></a>00045 }
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html#229fbb4cc19d289637891c1b49f3eaba">00047</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#229fbb4cc19d289637891c1b49f3eaba">FlowShopObjectiveVectorTraits::maximizing</a> (<span class="keywordtype">int</span> _i)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="comment">// minimizing both</span>
<a name="l00050"></a>00050 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052
<a name="l00053"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html#76ebe7639b502980bc683ab404b69c10">00053</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#76ebe7639b502980bc683ab404b69c10">FlowShopObjectiveVectorTraits::nObjectives</a> ()
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055 <span class="comment">// 2 objectives</span>
<a name="l00056"></a>00056 <span class="keywordflow">return</span> 2;
<a name="l00057"></a>00057 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,39 +21,64 @@
</form>
</li>
</ul></div>
<h1>FlowShopObjectiveVectorTraits.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopObjectiveVectorTraits.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPOBJECTIVEVECTORTRAITS_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOBJECTIVEVECTORTRAITS_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;core/moeoObjectiveVectorTraits.h&gt;</span>
<a name="l00017"></a>00017
<a name="l00021"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html">00021</a> <span class="keyword">class </span><a class="code" href="classFlowShopObjectiveVectorTraits.html">FlowShopObjectiveVectorTraits</a> : <span class="keyword">public</span> <a class="code" href="classmoeoObjectiveVectorTraits.html">moeoObjectiveVectorTraits</a>
<a name="l00022"></a>00022 {
<a name="l00023"></a>00023 <span class="keyword">public</span>:
<a name="l00024"></a>00024
<a name="l00029"></a>00029 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#e1a0f5be1782b9f9ce08128a404a1fa8">minimizing</a> (<span class="keywordtype">int</span> _i);
<a name="l00030"></a>00030
<a name="l00031"></a>00031
<a name="l00036"></a>00036 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#229fbb4cc19d289637891c1b49f3eaba">maximizing</a> (<span class="keywordtype">int</span> _i);
<h1>FlowShopObjectiveVectorTraits.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;FlowShopObjectiveVectorTraits.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038
<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#76ebe7639b502980bc683ab404b69c10">nObjectives</a> ();
<a name="l00043"></a>00043
<a name="l00044"></a>00044 };
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOBJECTIVEVECTORTRAITS_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPOBJECTIVEVECTORTRAITS_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOBJECTIVEVECTORTRAITS_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;core/moeoObjectiveVectorTraits.h&gt;</span>
<a name="l00042"></a>00042
<a name="l00046"></a><a class="code" href="classFlowShopObjectiveVectorTraits.html">00046</a> <span class="keyword">class </span><a class="code" href="classFlowShopObjectiveVectorTraits.html">FlowShopObjectiveVectorTraits</a> : <span class="keyword">public</span> <a class="code" href="classmoeoObjectiveVectorTraits.html">moeoObjectiveVectorTraits</a>
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 <span class="keyword">public</span>:
<a name="l00049"></a>00049
<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#e1a0f5be1782b9f9ce08128a404a1fa8">minimizing</a> (<span class="keywordtype">int</span> _i);
<a name="l00055"></a>00055
<a name="l00056"></a>00056
<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#229fbb4cc19d289637891c1b49f3eaba">maximizing</a> (<span class="keywordtype">int</span> _i);
<a name="l00062"></a>00062
<a name="l00063"></a>00063
<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classFlowShopObjectiveVectorTraits.html#76ebe7639b502980bc683ab404b69c10">nObjectives</a> ();
<a name="l00068"></a>00068
<a name="l00069"></a>00069 };
<a name="l00070"></a>00070
<a name="l00071"></a>00071 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOBJECTIVEVECTORTRAITS_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,28 +21,53 @@
</form>
</li>
</ul></div>
<h1>FlowShopObjectiveVector.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopObjectiveVector.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPOBJECTIVEVECTOR_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOBJECTIVEVECTOR_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;core/moeoRealObjectiveVector.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;FlowShopObjectiveVectorTraits.h&gt;</span>
<a name="l00018"></a>00018
<a name="l00022"></a>00022 <span class="keyword">typedef</span> moeoRealObjectiveVector &lt; FlowShopObjectiveVectorTraits &gt; <a class="code" href="classmoeoRealObjectiveVector.html">FlowShopObjectiveVector</a>;
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOBJECTIVEVECTOR_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShopObjectiveVector.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;FlowShopObjectiveVector.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPOBJECTIVEVECTOR_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOBJECTIVEVECTOR_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;core/moeoRealObjectiveVector.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;FlowShopObjectiveVectorTraits.h&gt;</span>
<a name="l00043"></a>00043
<a name="l00047"></a>00047 <span class="keyword">typedef</span> moeoRealObjectiveVector &lt; FlowShopObjectiveVectorTraits &gt; <a class="code" href="classmoeoRealObjectiveVector.html">FlowShopObjectiveVector</a>;
<a name="l00048"></a>00048
<a name="l00049"></a>00049 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOBJECTIVEVECTOR_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,91 +21,116 @@
</form>
</li>
</ul></div>
<h1>FlowShopOpCrossoverQuad.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopOpCrossoverQuad.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;FlowShopOpCrossoverQuad.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classFlowShopOpCrossoverQuad.html#60ac69b87970b7000980f65aa6ead44a">00016</a> std::string <a class="code" href="classFlowShopOpCrossoverQuad.html#60ac69b87970b7000980f65aa6ead44a">FlowShopOpCrossoverQuad::className</a>()<span class="keyword"> const</span>
<a name="l00017"></a>00017 <span class="keyword"></span>{
<a name="l00018"></a>00018 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShopOpCrossoverQuad"</span>;
<a name="l00019"></a>00019 }
<a name="l00020"></a>00020
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="classFlowShopOpCrossoverQuad.html#92f70807bea24d3c233af580e2c55e3a">00022</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpCrossoverQuad.html#92f70807bea24d3c233af580e2c55e3a">FlowShopOpCrossoverQuad::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop1, <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop2)
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keywordtype">bool</span> oneAtLeastIsModified;
<a name="l00025"></a>00025 <span class="comment">// computation of the 2 random points</span>
<a name="l00026"></a>00026 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> point1, point2;
<a name="l00027"></a>00027 <span class="keywordflow">do</span>
<a name="l00028"></a>00028 {
<a name="l00029"></a>00029 point1 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(std::min(_flowshop1.size(), _flowshop2.size()));
<a name="l00030"></a>00030 point2 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(std::min(_flowshop1.size(), _flowshop2.size()));
<a name="l00031"></a>00031 } <span class="keywordflow">while</span> (fabs((<span class="keywordtype">double</span>) point1-point2) &lt;= 2);
<a name="l00032"></a>00032 <span class="comment">// computation of the offspring</span>
<a name="l00033"></a>00033 <a class="code" href="classFlowShop.html">FlowShop</a> offspring1 = <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">generateOffspring</a>(_flowshop1, _flowshop2, point1, point2);
<a name="l00034"></a>00034 <a class="code" href="classFlowShop.html">FlowShop</a> offspring2 = <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">generateOffspring</a>(_flowshop2, _flowshop1, point1, point2);
<a name="l00035"></a>00035 <span class="comment">// does at least one genotype has been modified ?</span>
<a name="l00036"></a>00036 <span class="keywordflow">if</span> ((_flowshop1 != offspring1) || (_flowshop2 != offspring2))
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 <span class="comment">// update</span>
<a name="l00039"></a>00039 _flowshop1.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(offspring1);
<a name="l00040"></a>00040 _flowshop2.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(offspring2);
<a name="l00041"></a>00041 <span class="comment">// at least one genotype has been modified</span>
<a name="l00042"></a>00042 oneAtLeastIsModified = <span class="keyword">true</span>;
<a name="l00043"></a>00043 }
<a name="l00044"></a>00044 <span class="keywordflow">else</span>
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046 <span class="comment">// no genotype has been modified</span>
<a name="l00047"></a>00047 oneAtLeastIsModified = <span class="keyword">false</span>;
<a name="l00048"></a>00048 }
<a name="l00049"></a>00049 <span class="comment">// return 'true' if at least one genotype has been modified</span>
<a name="l00050"></a>00050 <span class="keywordflow">return</span> oneAtLeastIsModified;
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052
<a name="l00053"></a>00053
<a name="l00054"></a><a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">00054</a> <a class="code" href="classFlowShop.html">FlowShop</a> <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">FlowShopOpCrossoverQuad::generateOffspring</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent1, <span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent2, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point1, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point2)
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056 <a class="code" href="classFlowShop.html">FlowShop</a> result = _parent1;
<a name="l00057"></a>00057 std::vector&lt;bool&gt; taken_values(result.size(), <span class="keyword">false</span>);
<a name="l00058"></a>00058 <span class="keywordflow">if</span> (_point1 &gt; _point2)
<a name="l00059"></a>00059 std::swap(_point1, _point2);
<a name="l00060"></a>00060 <span class="comment">/* first parent */</span>
<a name="l00061"></a>00061 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0 ; i&lt;=_point1 ; i++)
<h1>FlowShopOpCrossoverQuad.cpp</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;FlowShopOpCrossoverQuad.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;FlowShopOpCrossoverQuad.h&gt;</span>
<a name="l00039"></a>00039
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classFlowShopOpCrossoverQuad.html#60ac69b87970b7000980f65aa6ead44a">00041</a> std::string <a class="code" href="classFlowShopOpCrossoverQuad.html#60ac69b87970b7000980f65aa6ead44a">FlowShopOpCrossoverQuad::className</a>()<span class="keyword"> const</span>
<a name="l00042"></a>00042 <span class="keyword"></span>{
<a name="l00043"></a>00043 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShopOpCrossoverQuad"</span>;
<a name="l00044"></a>00044 }
<a name="l00045"></a>00045
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classFlowShopOpCrossoverQuad.html#92f70807bea24d3c233af580e2c55e3a">00047</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpCrossoverQuad.html#92f70807bea24d3c233af580e2c55e3a">FlowShopOpCrossoverQuad::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop1, <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop2)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keywordtype">bool</span> oneAtLeastIsModified;
<a name="l00050"></a>00050 <span class="comment">// computation of the 2 random points</span>
<a name="l00051"></a>00051 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> point1, point2;
<a name="l00052"></a>00052 <span class="keywordflow">do</span>
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054 point1 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(std::min(_flowshop1.size(), _flowshop2.size()));
<a name="l00055"></a>00055 point2 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(std::min(_flowshop1.size(), _flowshop2.size()));
<a name="l00056"></a>00056 } <span class="keywordflow">while</span> (fabs((<span class="keywordtype">double</span>) point1-point2) &lt;= 2);
<a name="l00057"></a>00057 <span class="comment">// computation of the offspring</span>
<a name="l00058"></a>00058 <a class="code" href="classFlowShop.html">FlowShop</a> offspring1 = <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">generateOffspring</a>(_flowshop1, _flowshop2, point1, point2);
<a name="l00059"></a>00059 <a class="code" href="classFlowShop.html">FlowShop</a> offspring2 = <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">generateOffspring</a>(_flowshop2, _flowshop1, point1, point2);
<a name="l00060"></a>00060 <span class="comment">// does at least one genotype has been modified ?</span>
<a name="l00061"></a>00061 <span class="keywordflow">if</span> ((_flowshop1 != offspring1) || (_flowshop2 != offspring2))
<a name="l00062"></a>00062 {
<a name="l00063"></a>00063 <span class="comment">// result[i] == _parent1[i]</span>
<a name="l00064"></a>00064 taken_values[_parent1[i]] = <span class="keyword">true</span>;
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=_point2 ; i&lt;result.size() ; i++)
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068 <span class="comment">// result[i] == _parent1[i]</span>
<a name="l00069"></a>00069 taken_values[_parent1[i]] = <span class="keyword">true</span>;
<a name="l00070"></a>00070 }
<a name="l00071"></a>00071 <span class="comment">/* second parent */</span>
<a name="l00072"></a>00072 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = _point1+1;
<a name="l00073"></a>00073 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0;
<a name="l00074"></a>00074 <span class="keywordflow">while</span> (i&lt;_point2 &amp;&amp; j&lt;_parent2.size())
<a name="l00075"></a>00075 {
<a name="l00076"></a>00076 <span class="keywordflow">if</span> (! taken_values[_parent2[j]])
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078 result[i] = _parent2[j];
<a name="l00079"></a>00079 i++;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 j++;
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083 <span class="keywordflow">return</span> result;
<a name="l00084"></a>00084 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00063"></a>00063 <span class="comment">// update</span>
<a name="l00064"></a>00064 _flowshop1.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(offspring1);
<a name="l00065"></a>00065 _flowshop2.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(offspring2);
<a name="l00066"></a>00066 <span class="comment">// at least one genotype has been modified</span>
<a name="l00067"></a>00067 oneAtLeastIsModified = <span class="keyword">true</span>;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 <span class="keywordflow">else</span>
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071 <span class="comment">// no genotype has been modified</span>
<a name="l00072"></a>00072 oneAtLeastIsModified = <span class="keyword">false</span>;
<a name="l00073"></a>00073 }
<a name="l00074"></a>00074 <span class="comment">// return 'true' if at least one genotype has been modified</span>
<a name="l00075"></a>00075 <span class="keywordflow">return</span> oneAtLeastIsModified;
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077
<a name="l00078"></a>00078
<a name="l00079"></a><a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">00079</a> <a class="code" href="classFlowShop.html">FlowShop</a> <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">FlowShopOpCrossoverQuad::generateOffspring</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent1, <span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent2, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point1, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point2)
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 <a class="code" href="classFlowShop.html">FlowShop</a> result = _parent1;
<a name="l00082"></a>00082 std::vector&lt;bool&gt; taken_values(result.size(), <span class="keyword">false</span>);
<a name="l00083"></a>00083 <span class="keywordflow">if</span> (_point1 &gt; _point2)
<a name="l00084"></a>00084 std::swap(_point1, _point2);
<a name="l00085"></a>00085 <span class="comment">/* first parent */</span>
<a name="l00086"></a>00086 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0 ; i&lt;=_point1 ; i++)
<a name="l00087"></a>00087 {
<a name="l00088"></a>00088 <span class="comment">// result[i] == _parent1[i]</span>
<a name="l00089"></a>00089 taken_values[_parent1[i]] = <span class="keyword">true</span>;
<a name="l00090"></a>00090 }
<a name="l00091"></a>00091 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=_point2 ; i&lt;result.size() ; i++)
<a name="l00092"></a>00092 {
<a name="l00093"></a>00093 <span class="comment">// result[i] == _parent1[i]</span>
<a name="l00094"></a>00094 taken_values[_parent1[i]] = <span class="keyword">true</span>;
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 <span class="comment">/* second parent */</span>
<a name="l00097"></a>00097 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = _point1+1;
<a name="l00098"></a>00098 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0;
<a name="l00099"></a>00099 <span class="keywordflow">while</span> (i&lt;_point2 &amp;&amp; j&lt;_parent2.size())
<a name="l00100"></a>00100 {
<a name="l00101"></a>00101 <span class="keywordflow">if</span> (! taken_values[_parent2[j]])
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103 result[i] = _parent2[j];
<a name="l00104"></a>00104 i++;
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106 j++;
<a name="l00107"></a>00107 }
<a name="l00108"></a>00108 <span class="keywordflow">return</span> result;
<a name="l00109"></a>00109 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,42 +21,67 @@
</form>
</li>
</ul></div>
<h1>FlowShopOpCrossoverQuad.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopOpCrossoverQuad.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPOPCROSSOVERQUAD_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOPCROSSOVERQUAD_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;eoOp.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00018"></a>00018
<a name="l00022"></a><a class="code" href="classFlowShopOpCrossoverQuad.html">00022</a> <span class="keyword">class </span><a class="code" href="classFlowShopOpCrossoverQuad.html">FlowShopOpCrossoverQuad</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_quad_op.html">eoQuadOp</a> &lt; FlowShop &gt;
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keyword">public</span>:
<a name="l00025"></a>00025
<a name="l00029"></a>00029 std::string <a class="code" href="classFlowShopOpCrossoverQuad.html#60ac69b87970b7000980f65aa6ead44a">className</a>() <span class="keyword">const</span>;
<a name="l00030"></a>00030
<a name="l00031"></a>00031
<a name="l00037"></a>00037 <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpCrossoverQuad.html#92f70807bea24d3c233af580e2c55e3a">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop1, <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop2);
<a name="l00038"></a>00038
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="keyword">private</span>:
<a name="l00041"></a>00041
<a name="l00049"></a>00049 <a class="code" href="classFlowShop.html">FlowShop</a> <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">generateOffspring</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent1, <span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent2, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point1, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point2);
<h1>FlowShopOpCrossoverQuad.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;FlowShopOpCrossoverQuad.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPOPCROSSOVERQUAD_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOPCROSSOVERQUAD_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;eoOp.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00043"></a>00043
<a name="l00047"></a><a class="code" href="classFlowShopOpCrossoverQuad.html">00047</a> <span class="keyword">class </span><a class="code" href="classFlowShopOpCrossoverQuad.html">FlowShopOpCrossoverQuad</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_quad_op.html">eoQuadOp</a> &lt; FlowShop &gt;
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a>00050
<a name="l00051"></a>00051 };
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOPCROSSOVERQUAD_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00054"></a>00054 std::string <a class="code" href="classFlowShopOpCrossoverQuad.html#60ac69b87970b7000980f65aa6ead44a">className</a>() <span class="keyword">const</span>;
<a name="l00055"></a>00055
<a name="l00056"></a>00056
<a name="l00062"></a>00062 <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpCrossoverQuad.html#92f70807bea24d3c233af580e2c55e3a">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop1, <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop2);
<a name="l00063"></a>00063
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="keyword">private</span>:
<a name="l00066"></a>00066
<a name="l00074"></a>00074 <a class="code" href="classFlowShop.html">FlowShop</a> <a class="code" href="classFlowShopOpCrossoverQuad.html#cbc2f344a0a29861900f4846597564c3">generateOffspring</a>(<span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent1, <span class="keyword">const</span> <a class="code" href="classFlowShop.html">FlowShop</a> &amp; _parent2, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point1, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _point2);
<a name="l00075"></a>00075
<a name="l00076"></a>00076 };
<a name="l00077"></a>00077
<a name="l00078"></a>00078 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOPCROSSOVERQUAD_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,57 +21,82 @@
</form>
</li>
</ul></div>
<h1>FlowShopOpMutationExchange.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopOpCrossoverQuad.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;FlowShopOpMutationExchange.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classFlowShopOpMutationExchange.html#36a926c9fe21346db26fadf1d50c1c7a">00016</a> std::string <a class="code" href="classFlowShopOpMutationExchange.html#36a926c9fe21346db26fadf1d50c1c7a">FlowShopOpMutationExchange::className</a>()<span class="keyword"> const</span>
<a name="l00017"></a>00017 <span class="keyword"></span>{
<a name="l00018"></a>00018 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShopOpMutationExchange"</span>;
<a name="l00019"></a>00019 }
<a name="l00020"></a>00020
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="classFlowShopOpMutationExchange.html#bdb2e1d937d788c50f04226265c848bd">00022</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationExchange.html#bdb2e1d937d788c50f04226265c848bd">FlowShopOpMutationExchange::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keywordtype">bool</span> isModified;
<a name="l00025"></a>00025 <a class="code" href="classFlowShop.html">FlowShop</a> result = _flowshop;
<a name="l00026"></a>00026 <span class="comment">// computation of the 2 random points</span>
<a name="l00027"></a>00027 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> point1, point2;
<a name="l00028"></a>00028 <span class="keywordflow">do</span>
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 point1 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00031"></a>00031 point2 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00032"></a>00032 } <span class="keywordflow">while</span> (point1 == point2);
<a name="l00033"></a>00033 <span class="comment">// swap</span>
<a name="l00034"></a>00034 std::swap (result[point1], result[point2]);
<a name="l00035"></a>00035 <span class="comment">// update (if necessary)</span>
<a name="l00036"></a>00036 <span class="keywordflow">if</span> (result != _flowshop)
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 <span class="comment">// update</span>
<a name="l00039"></a>00039 _flowshop.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(result);
<a name="l00040"></a>00040 <span class="comment">// the genotype has been modified</span>
<a name="l00041"></a>00041 isModified = <span class="keyword">true</span>;
<a name="l00042"></a>00042 }
<a name="l00043"></a>00043 <span class="keywordflow">else</span>
<a name="l00044"></a>00044 {
<a name="l00045"></a>00045 <span class="comment">// the genotype has not been modified</span>
<a name="l00046"></a>00046 isModified = <span class="keyword">false</span>;
<a name="l00047"></a>00047 }
<a name="l00048"></a>00048 <span class="comment">// return 'true' if the genotype has been modified</span>
<a name="l00049"></a>00049 <span class="keywordflow">return</span> isModified;
<a name="l00050"></a>00050 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShopOpMutationExchange.cpp</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;FlowShopOpMutationExchange.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;FlowShopOpMutationExchange.h&gt;</span>
<a name="l00039"></a>00039
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classFlowShopOpMutationExchange.html#36a926c9fe21346db26fadf1d50c1c7a">00041</a> std::string <a class="code" href="classFlowShopOpMutationExchange.html#36a926c9fe21346db26fadf1d50c1c7a">FlowShopOpMutationExchange::className</a>()<span class="keyword"> const</span>
<a name="l00042"></a>00042 <span class="keyword"></span>{
<a name="l00043"></a>00043 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShopOpMutationExchange"</span>;
<a name="l00044"></a>00044 }
<a name="l00045"></a>00045
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classFlowShopOpMutationExchange.html#bdb2e1d937d788c50f04226265c848bd">00047</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationExchange.html#bdb2e1d937d788c50f04226265c848bd">FlowShopOpMutationExchange::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keywordtype">bool</span> isModified;
<a name="l00050"></a>00050 <a class="code" href="classFlowShop.html">FlowShop</a> result = _flowshop;
<a name="l00051"></a>00051 <span class="comment">// computation of the 2 random points</span>
<a name="l00052"></a>00052 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> point1, point2;
<a name="l00053"></a>00053 <span class="keywordflow">do</span>
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055 point1 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00056"></a>00056 point2 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00057"></a>00057 } <span class="keywordflow">while</span> (point1 == point2);
<a name="l00058"></a>00058 <span class="comment">// swap</span>
<a name="l00059"></a>00059 std::swap (result[point1], result[point2]);
<a name="l00060"></a>00060 <span class="comment">// update (if necessary)</span>
<a name="l00061"></a>00061 <span class="keywordflow">if</span> (result != _flowshop)
<a name="l00062"></a>00062 {
<a name="l00063"></a>00063 <span class="comment">// update</span>
<a name="l00064"></a>00064 _flowshop.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(result);
<a name="l00065"></a>00065 <span class="comment">// the genotype has been modified</span>
<a name="l00066"></a>00066 isModified = <span class="keyword">true</span>;
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068 <span class="keywordflow">else</span>
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070 <span class="comment">// the genotype has not been modified</span>
<a name="l00071"></a>00071 isModified = <span class="keyword">false</span>;
<a name="l00072"></a>00072 }
<a name="l00073"></a>00073 <span class="comment">// return 'true' if the genotype has been modified</span>
<a name="l00074"></a>00074 <span class="keywordflow">return</span> isModified;
<a name="l00075"></a>00075 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,37 +21,62 @@
</form>
</li>
</ul></div>
<h1>FlowShopOpMutationExchange.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopOpCrossoverQuad.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPOPMUTATIONEXCHANGE_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOPMUTATIONEXCHANGE_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;eoOp.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00018"></a>00018
<a name="l00022"></a><a class="code" href="classFlowShopOpMutationExchange.html">00022</a> <span class="keyword">class </span><a class="code" href="classFlowShopOpMutationExchange.html">FlowShopOpMutationExchange</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_mon_op.html">eoMonOp</a>&lt;FlowShop&gt;
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keyword">public</span>:
<a name="l00025"></a>00025
<a name="l00029"></a>00029 std::string <a class="code" href="classFlowShopOpMutationExchange.html#36a926c9fe21346db26fadf1d50c1c7a">className</a>() <span class="keyword">const</span>;
<a name="l00030"></a>00030
<a name="l00031"></a>00031
<a name="l00036"></a>00036 <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationExchange.html#bdb2e1d937d788c50f04226265c848bd">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<h1>FlowShopOpMutationExchange.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;FlowShopOpMutationExchange.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOPMUTATIONEXCHANGE_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPOPMUTATIONEXCHANGE_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOPMUTATIONEXCHANGE_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;eoOp.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00043"></a>00043
<a name="l00047"></a><a class="code" href="classFlowShopOpMutationExchange.html">00047</a> <span class="keyword">class </span><a class="code" href="classFlowShopOpMutationExchange.html">FlowShopOpMutationExchange</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_mon_op.html">eoMonOp</a>&lt;FlowShop&gt;
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a>00050
<a name="l00054"></a>00054 std::string <a class="code" href="classFlowShopOpMutationExchange.html#36a926c9fe21346db26fadf1d50c1c7a">className</a>() <span class="keyword">const</span>;
<a name="l00055"></a>00055
<a name="l00056"></a>00056
<a name="l00061"></a>00061 <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationExchange.html#bdb2e1d937d788c50f04226265c848bd">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00062"></a>00062
<a name="l00063"></a>00063 };
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOPMUTATIONEXCHANGE_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,67 +21,92 @@
</form>
</li>
</ul></div>
<h1>FlowShopOpMutationShift.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopOpMutationShift.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;FlowShopOpMutationShift.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classFlowShopOpMutationShift.html#dd1d710568978d1d4bb8c6f3925da4c6">00016</a> std::string <a class="code" href="classFlowShopOpMutationShift.html#dd1d710568978d1d4bb8c6f3925da4c6">FlowShopOpMutationShift::className</a>()<span class="keyword"> const</span>
<a name="l00017"></a>00017 <span class="keyword"></span>{
<a name="l00018"></a>00018 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShopOpMutationShift"</span>;
<a name="l00019"></a>00019 }
<a name="l00020"></a>00020
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="classFlowShopOpMutationShift.html#c000b017e75ddee3b6fe9db8ea5ddd5b">00022</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationShift.html#c000b017e75ddee3b6fe9db8ea5ddd5b">FlowShopOpMutationShift::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keywordtype">bool</span> isModified;
<a name="l00025"></a>00025 <span class="keywordtype">int</span> direction;
<a name="l00026"></a>00026 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> tmp;
<a name="l00027"></a>00027 <a class="code" href="classFlowShop.html">FlowShop</a> result = _flowshop;
<a name="l00028"></a>00028 <span class="comment">// computation of the 2 random points</span>
<a name="l00029"></a>00029 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> point1, point2;
<a name="l00030"></a>00030 <span class="keywordflow">do</span>
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 point1 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00033"></a>00033 point2 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00034"></a>00034 } <span class="keywordflow">while</span> (point1 == point2);
<a name="l00035"></a>00035 <span class="comment">// direction</span>
<a name="l00036"></a>00036 <span class="keywordflow">if</span> (point1 &lt; point2)
<a name="l00037"></a>00037 direction = 1;
<a name="l00038"></a>00038 <span class="keywordflow">else</span>
<a name="l00039"></a>00039 direction = -1;
<a name="l00040"></a>00040 <span class="comment">// mutation</span>
<a name="l00041"></a>00041 tmp = result[point1];
<a name="l00042"></a>00042 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=point1 ; i!=point2 ; i+=direction)
<a name="l00043"></a>00043 result[i] = result[i+direction];
<a name="l00044"></a>00044 result[point2] = tmp;
<a name="l00045"></a>00045 <span class="comment">// update (if necessary)</span>
<a name="l00046"></a>00046 <span class="keywordflow">if</span> (result != _flowshop)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 <span class="comment">// update</span>
<a name="l00049"></a>00049 _flowshop.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(result);
<a name="l00050"></a>00050 <span class="comment">// the genotype has been modified</span>
<a name="l00051"></a>00051 isModified = <span class="keyword">true</span>;
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053 <span class="keywordflow">else</span>
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055 <span class="comment">// the genotype has not been modified</span>
<a name="l00056"></a>00056 isModified = <span class="keyword">false</span>;
<a name="l00057"></a>00057 }
<a name="l00058"></a>00058 <span class="comment">// return 'true' if the genotype has been modified</span>
<a name="l00059"></a>00059 <span class="keywordflow">return</span> isModified;
<a name="l00060"></a>00060 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShopOpMutationShift.cpp</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;FlowShopOpMutationShift.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;FlowShopOpMutationShift.h&gt;</span>
<a name="l00039"></a>00039
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classFlowShopOpMutationShift.html#dd1d710568978d1d4bb8c6f3925da4c6">00041</a> std::string <a class="code" href="classFlowShopOpMutationShift.html#dd1d710568978d1d4bb8c6f3925da4c6">FlowShopOpMutationShift::className</a>()<span class="keyword"> const</span>
<a name="l00042"></a>00042 <span class="keyword"></span>{
<a name="l00043"></a>00043 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShopOpMutationShift"</span>;
<a name="l00044"></a>00044 }
<a name="l00045"></a>00045
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classFlowShopOpMutationShift.html#c000b017e75ddee3b6fe9db8ea5ddd5b">00047</a> <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationShift.html#c000b017e75ddee3b6fe9db8ea5ddd5b">FlowShopOpMutationShift::operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keywordtype">bool</span> isModified;
<a name="l00050"></a>00050 <span class="keywordtype">int</span> direction;
<a name="l00051"></a>00051 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> tmp;
<a name="l00052"></a>00052 <a class="code" href="classFlowShop.html">FlowShop</a> result = _flowshop;
<a name="l00053"></a>00053 <span class="comment">// computation of the 2 random points</span>
<a name="l00054"></a>00054 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> point1, point2;
<a name="l00055"></a>00055 <span class="keywordflow">do</span>
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 point1 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00058"></a>00058 point2 = rng.<a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_rng.html#f0829d258c74cdc3a8f6cd72c0287cb4">random</a>(result.size());
<a name="l00059"></a>00059 } <span class="keywordflow">while</span> (point1 == point2);
<a name="l00060"></a>00060 <span class="comment">// direction</span>
<a name="l00061"></a>00061 <span class="keywordflow">if</span> (point1 &lt; point2)
<a name="l00062"></a>00062 direction = 1;
<a name="l00063"></a>00063 <span class="keywordflow">else</span>
<a name="l00064"></a>00064 direction = -1;
<a name="l00065"></a>00065 <span class="comment">// mutation</span>
<a name="l00066"></a>00066 tmp = result[point1];
<a name="l00067"></a>00067 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=point1 ; i!=point2 ; i+=direction)
<a name="l00068"></a>00068 result[i] = result[i+direction];
<a name="l00069"></a>00069 result[point2] = tmp;
<a name="l00070"></a>00070 <span class="comment">// update (if necessary)</span>
<a name="l00071"></a>00071 <span class="keywordflow">if</span> (result != _flowshop)
<a name="l00072"></a>00072 {
<a name="l00073"></a>00073 <span class="comment">// update</span>
<a name="l00074"></a>00074 _flowshop.<a class="code" href="classmoeoVector.html#a7fadd876fe492717815510f68a921c5">value</a>(result);
<a name="l00075"></a>00075 <span class="comment">// the genotype has been modified</span>
<a name="l00076"></a>00076 isModified = <span class="keyword">true</span>;
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078 <span class="keywordflow">else</span>
<a name="l00079"></a>00079 {
<a name="l00080"></a>00080 <span class="comment">// the genotype has not been modified</span>
<a name="l00081"></a>00081 isModified = <span class="keyword">false</span>;
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083 <span class="comment">// return 'true' if the genotype has been modified</span>
<a name="l00084"></a>00084 <span class="keywordflow">return</span> isModified;
<a name="l00085"></a>00085 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,37 +21,62 @@
</form>
</li>
</ul></div>
<h1>FlowShopOpMutationShift.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShopOpMutationShift.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOPOPMUTATIONSHIFT_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOPMUTATIONSHIFT_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;eoOp.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00018"></a>00018
<a name="l00022"></a><a class="code" href="classFlowShopOpMutationShift.html">00022</a> <span class="keyword">class </span><a class="code" href="classFlowShopOpMutationShift.html">FlowShopOpMutationShift</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_mon_op.html">eoMonOp</a> &lt; FlowShop &gt;
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keyword">public</span>:
<a name="l00025"></a>00025
<a name="l00029"></a>00029 std::string <a class="code" href="classFlowShopOpMutationShift.html#dd1d710568978d1d4bb8c6f3925da4c6">className</a>() <span class="keyword">const</span>;
<a name="l00030"></a>00030
<a name="l00031"></a>00031
<a name="l00036"></a>00036 <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationShift.html#c000b017e75ddee3b6fe9db8ea5ddd5b">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<h1>FlowShopOpMutationShift.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;FlowShopOpMutationShift.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOPMUTATIONSHIFT_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOPOPMUTATIONSHIFT_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOPOPMUTATIONSHIFT_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;eoOp.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00043"></a>00043
<a name="l00047"></a><a class="code" href="classFlowShopOpMutationShift.html">00047</a> <span class="keyword">class </span><a class="code" href="classFlowShopOpMutationShift.html">FlowShopOpMutationShift</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_mon_op.html">eoMonOp</a> &lt; FlowShop &gt;
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a>00050
<a name="l00054"></a>00054 std::string <a class="code" href="classFlowShopOpMutationShift.html#dd1d710568978d1d4bb8c6f3925da4c6">className</a>() <span class="keyword">const</span>;
<a name="l00055"></a>00055
<a name="l00056"></a>00056
<a name="l00061"></a>00061 <span class="keywordtype">bool</span> <a class="code" href="classFlowShopOpMutationShift.html#c000b017e75ddee3b6fe9db8ea5ddd5b">operator()</a>(<a class="code" href="classFlowShop.html">FlowShop</a> &amp; _flowshop);
<a name="l00062"></a>00062
<a name="l00063"></a>00063 };
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOPOPMUTATIONSHIFT_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,25 +21,50 @@
</form>
</li>
</ul></div>
<h1>FlowShop.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShop.cpp</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a><a class="code" href="classFlowShop.html#eaab263664f0078082e723a905d430f3">00015</a> std::string <a class="code" href="classFlowShop.html#eaab263664f0078082e723a905d430f3">FlowShop::className</a>()<span class="keyword"> const</span>
<a name="l00016"></a>00016 <span class="keyword"></span>{
<a name="l00017"></a>00017 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShop"</span>;
<a name="l00018"></a>00018 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShop.cpp</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;FlowShop.cpp&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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;FlowShop.h&gt;</span>
<a name="l00039"></a>00039
<a name="l00040"></a><a class="code" href="classFlowShop.html#eaab263664f0078082e723a905d430f3">00040</a> std::string <a class="code" href="classFlowShop.html#eaab263664f0078082e723a905d430f3">FlowShop::className</a>()<span class="keyword"> const</span>
<a name="l00041"></a>00041 <span class="keyword"></span>{
<a name="l00042"></a>00042 <span class="keywordflow">return</span> <span class="stringliteral">"FlowShop"</span>;
<a name="l00043"></a>00043 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,34 +21,59 @@
</form>
</li>
</ul></div>
<h1>FlowShop.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// FlowShop.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef FLOWSHOP_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOP_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;core/moeoVector.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;FlowShopObjectiveVector.h&gt;</span>
<a name="l00018"></a>00018
<a name="l00022"></a><a class="code" href="classFlowShop.html">00022</a> <span class="keyword">class </span><a class="code" href="classFlowShop.html">FlowShop</a>: <span class="keyword">public</span> <a class="code" href="classmoeoVector.html">moeoVector</a> &lt; FlowShopObjectiveVector , double , double , unsigned int &gt;
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keyword">public</span>:
<a name="l00025"></a>00025
<a name="l00029"></a>00029 std::string <a class="code" href="classFlowShop.html#eaab263664f0078082e723a905d430f3">className</a>() <span class="keyword">const</span>;
<a name="l00030"></a>00030
<a name="l00031"></a>00031 };
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOP_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<h1>FlowShop.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;FlowShop.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef FLOWSHOP_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define FLOWSHOP_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;core/moeoVector.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;FlowShopObjectiveVector.h&gt;</span>
<a name="l00043"></a>00043
<a name="l00047"></a><a class="code" href="classFlowShop.html">00047</a> <span class="keyword">class </span><a class="code" href="classFlowShop.html">FlowShop</a>: <span class="keyword">public</span> <a class="code" href="classmoeoVector.html">moeoVector</a> &lt; FlowShopObjectiveVector , double , double , unsigned int &gt;
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a>00050
<a name="l00054"></a>00054 std::string <a class="code" href="classFlowShop.html#eaab263664f0078082e723a905d430f3">className</a>() <span class="keyword">const</span>;
<a name="l00055"></a>00055
<a name="l00056"></a>00056 };
<a name="l00057"></a>00057
<a name="l00058"></a>00058 <span class="preprocessor">#endif </span><span class="comment">/*FLOWSHOP_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -21,209 +21,234 @@
</form>
</li>
</ul></div>
<h1>MOEO.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00004"></a>00004 <span class="comment">// MOEO.h</span>
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
<a name="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef MOEO_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define MOEO_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;stdexcept&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;EO.h&gt;</span>
<a name="l00020"></a>00020
<a name="l00033"></a>00033 <span class="keyword">template</span> &lt; <span class="keyword">class</span> MOEOObjectiveVector, <span class="keyword">class</span> MOEOFitness, <span class="keyword">class</span> MOEODiversity &gt;
<a name="l00034"></a><a class="code" href="classMOEO.html">00034</a> <span class="keyword">class </span><a class="code" href="classMOEO.html">MOEO</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/class_e_o.html">EO</a> &lt; MOEOObjectiveVector &gt;
<a name="l00035"></a>00035 {
<a name="l00036"></a>00036 <span class="keyword">public</span>:
<h1>MOEO.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;MOEO.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">* Arnaud Liefooghe</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="comment">//-----------------------------------------------------------------------------</span>
<a name="l00037"></a>00037
<a name="l00039"></a><a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">00039</a> <span class="keyword">typedef</span> MOEOObjectiveVector <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a>;
<a name="l00040"></a>00040
<a name="l00042"></a><a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">00042</a> <span class="keyword">typedef</span> MOEOFitness <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a>;
<a name="l00043"></a>00043
<a name="l00045"></a><a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">00045</a> <span class="keyword">typedef</span> MOEODiversity <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a>;
<a name="l00046"></a>00046
<a name="l00047"></a>00047
<a name="l00051"></a><a class="code" href="classMOEO.html#cff537a68ecc80c753318d3e12f842f5">00051</a> <a class="code" href="classMOEO.html#cff537a68ecc80c753318d3e12f842f5">MOEO</a>()
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053 <span class="comment">// default values for every parameters</span>
<a name="l00054"></a>00054 <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a> = <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a>();
<a name="l00055"></a>00055 <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a> = <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a>();
<a name="l00056"></a>00056 <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a> = <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a>();
<a name="l00057"></a>00057 <span class="comment">// invalidate all</span>
<a name="l00058"></a>00058 <a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">invalidate</a>();
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060
<a name="l00061"></a>00061
<a name="l00065"></a><a class="code" href="classMOEO.html#0215e9acab4ab57088175f9856e6c48c">00065</a> <span class="keyword">virtual</span> <a class="code" href="classMOEO.html#0215e9acab4ab57088175f9856e6c48c">~MOEO</a>() {};
<a name="l00066"></a>00066
<a name="l00067"></a>00067
<a name="l00071"></a><a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">00071</a> <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a> <a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>()<span class="keyword"> const</span>
<a name="l00072"></a>00072 <span class="keyword"> </span>{
<a name="l00073"></a>00073 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>() )
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"invalid objective vector in MOEO"</span>);
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a>;
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079
<a name="l00080"></a>00080
<a name="l00085"></a><a class="code" href="classMOEO.html#d4a765a76f9acc1bca36297ab55d7282">00085</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a> &amp; _objectiveVectorValue)
<a name="l00086"></a>00086 {
<a name="l00087"></a>00087 <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a> = _objectiveVectorValue;
<a name="l00088"></a>00088 <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a> = <span class="keyword">false</span>;
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef MOEO_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define MOEO_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;stdexcept&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &lt;EO.h&gt;</span>
<a name="l00045"></a>00045
<a name="l00058"></a>00058 <span class="keyword">template</span> &lt; <span class="keyword">class</span> MOEOObjectiveVector, <span class="keyword">class</span> MOEOFitness, <span class="keyword">class</span> MOEODiversity &gt;
<a name="l00059"></a><a class="code" href="classMOEO.html">00059</a> <span class="keyword">class </span><a class="code" href="classMOEO.html">MOEO</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/class_e_o.html">EO</a> &lt; MOEOObjectiveVector &gt;
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061 <span class="keyword">public</span>:
<a name="l00062"></a>00062
<a name="l00064"></a><a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">00064</a> <span class="keyword">typedef</span> MOEOObjectiveVector <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a>;
<a name="l00065"></a>00065
<a name="l00067"></a><a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">00067</a> <span class="keyword">typedef</span> MOEOFitness <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a>;
<a name="l00068"></a>00068
<a name="l00070"></a><a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">00070</a> <span class="keyword">typedef</span> MOEODiversity <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a>;
<a name="l00071"></a>00071
<a name="l00072"></a>00072
<a name="l00076"></a><a class="code" href="classMOEO.html#cff537a68ecc80c753318d3e12f842f5">00076</a> <a class="code" href="classMOEO.html#cff537a68ecc80c753318d3e12f842f5">MOEO</a>()
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078 <span class="comment">// default values for every parameters</span>
<a name="l00079"></a>00079 <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a> = <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a>();
<a name="l00080"></a>00080 <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a> = <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a>();
<a name="l00081"></a>00081 <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a> = <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a>();
<a name="l00082"></a>00082 <span class="comment">// invalidate all</span>
<a name="l00083"></a>00083 <a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">invalidate</a>();
<a name="l00084"></a>00084 }
<a name="l00085"></a>00085
<a name="l00086"></a>00086
<a name="l00090"></a><a class="code" href="classMOEO.html#0215e9acab4ab57088175f9856e6c48c">00090</a> <span class="keyword">virtual</span> <a class="code" href="classMOEO.html#0215e9acab4ab57088175f9856e6c48c">~MOEO</a>() {};
<a name="l00091"></a>00091
<a name="l00095"></a><a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">00095</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">invalidateObjectiveVector</a>()
<a name="l00096"></a>00096 {
<a name="l00097"></a>00097 <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a> = <span class="keyword">true</span>;
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099
<a name="l00100"></a>00100
<a name="l00104"></a><a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">00104</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>()<span class="keyword"> const</span>
<a name="l00105"></a>00105 <span class="keyword"> </span>{
<a name="l00106"></a>00106 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a>;
<a name="l00107"></a>00107 }
<a name="l00108"></a>00108
<a name="l00109"></a>00109
<a name="l00113"></a><a class="code" href="classMOEO.html#c02c16902f914a6fde83a33d2c8b1534">00113</a> <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a> <a class="code" href="classMOEO.html#c02c16902f914a6fde83a33d2c8b1534">fitness</a>()<span class="keyword"> const</span>
<a name="l00114"></a>00114 <span class="keyword"> </span>{
<a name="l00115"></a>00115 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#9423f9daebb1f7be6d52c80692e4af48">invalidFitness</a>() )
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"invalid fitness in MOEO"</span>);
<a name="l00118"></a>00118 }
<a name="l00119"></a>00119 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a>;
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121
<a name="l00122"></a>00122
<a name="l00127"></a><a class="code" href="classMOEO.html#4dc05ded73bb60d1a51e282006c8942d">00127</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#c02c16902f914a6fde83a33d2c8b1534">fitness</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a> &amp; _fitnessValue)
<a name="l00128"></a>00128 {
<a name="l00129"></a>00129 <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a> = _fitnessValue;
<a name="l00130"></a>00130 <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a> = <span class="keyword">false</span>;
<a name="l00131"></a>00131 }
<a name="l00132"></a>00132
<a name="l00092"></a>00092
<a name="l00096"></a><a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">00096</a> <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a> <a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>()<span class="keyword"> const</span>
<a name="l00097"></a>00097 <span class="keyword"> </span>{
<a name="l00098"></a>00098 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>() )
<a name="l00099"></a>00099 {
<a name="l00100"></a>00100 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"invalid objective vector in MOEO"</span>);
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a>;
<a name="l00103"></a>00103 }
<a name="l00104"></a>00104
<a name="l00105"></a>00105
<a name="l00110"></a><a class="code" href="classMOEO.html#d4a765a76f9acc1bca36297ab55d7282">00110</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a> &amp; _objectiveVectorValue)
<a name="l00111"></a>00111 {
<a name="l00112"></a>00112 <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a> = _objectiveVectorValue;
<a name="l00113"></a>00113 <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a> = <span class="keyword">false</span>;
<a name="l00114"></a>00114 }
<a name="l00115"></a>00115
<a name="l00116"></a>00116
<a name="l00120"></a><a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">00120</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">invalidateObjectiveVector</a>()
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a> = <span class="keyword">true</span>;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124
<a name="l00125"></a>00125
<a name="l00129"></a><a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">00129</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>()<span class="keyword"> const</span>
<a name="l00130"></a>00130 <span class="keyword"> </span>{
<a name="l00131"></a>00131 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a>;
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133
<a name="l00137"></a><a class="code" href="classMOEO.html#55876e2e7cd537052fec1c7f46f37ffe">00137</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#55876e2e7cd537052fec1c7f46f37ffe">invalidateFitness</a>()
<a name="l00138"></a>00138 {
<a name="l00139"></a>00139 <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a> = <span class="keyword">true</span>;
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141
<a name="l00142"></a>00142
<a name="l00146"></a><a class="code" href="classMOEO.html#9423f9daebb1f7be6d52c80692e4af48">00146</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#9423f9daebb1f7be6d52c80692e4af48">invalidFitness</a>()<span class="keyword"> const</span>
<a name="l00147"></a>00147 <span class="keyword"> </span>{
<a name="l00148"></a>00148 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a>;
<a name="l00149"></a>00149 }
<a name="l00150"></a>00150
<a name="l00151"></a>00151
<a name="l00155"></a><a class="code" href="classMOEO.html#c610f4636e8c26a351fcfbc25028aa01">00155</a> <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a> <a class="code" href="classMOEO.html#c610f4636e8c26a351fcfbc25028aa01">diversity</a>()<span class="keyword"> const</span>
<a name="l00156"></a>00156 <span class="keyword"> </span>{
<a name="l00157"></a>00157 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#c4941e8e600fd360fdf1b061ee938e34">invalidDiversity</a>() )
<a name="l00158"></a>00158 {
<a name="l00159"></a>00159 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"invalid diversity in MOEO"</span>);
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a>;
<a name="l00162"></a>00162 }
<a name="l00163"></a>00163
<a name="l00164"></a>00164
<a name="l00169"></a><a class="code" href="classMOEO.html#1f0a391984cd14bcf930d1d81dd4848e">00169</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#c610f4636e8c26a351fcfbc25028aa01">diversity</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a> &amp; _diversityValue)
<a name="l00170"></a>00170 {
<a name="l00171"></a>00171 <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a> = _diversityValue;
<a name="l00172"></a>00172 <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a> = <span class="keyword">false</span>;
<a name="l00173"></a>00173 }
<a name="l00174"></a>00174
<a name="l00134"></a>00134
<a name="l00138"></a><a class="code" href="classMOEO.html#c02c16902f914a6fde83a33d2c8b1534">00138</a> <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a> <a class="code" href="classMOEO.html#c02c16902f914a6fde83a33d2c8b1534">fitness</a>()<span class="keyword"> const</span>
<a name="l00139"></a>00139 <span class="keyword"> </span>{
<a name="l00140"></a>00140 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#9423f9daebb1f7be6d52c80692e4af48">invalidFitness</a>() )
<a name="l00141"></a>00141 {
<a name="l00142"></a>00142 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"invalid fitness in MOEO"</span>);
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a>;
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146
<a name="l00147"></a>00147
<a name="l00152"></a><a class="code" href="classMOEO.html#4dc05ded73bb60d1a51e282006c8942d">00152</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#c02c16902f914a6fde83a33d2c8b1534">fitness</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a> &amp; _fitnessValue)
<a name="l00153"></a>00153 {
<a name="l00154"></a>00154 <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a> = _fitnessValue;
<a name="l00155"></a>00155 <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a> = <span class="keyword">false</span>;
<a name="l00156"></a>00156 }
<a name="l00157"></a>00157
<a name="l00158"></a>00158
<a name="l00162"></a><a class="code" href="classMOEO.html#55876e2e7cd537052fec1c7f46f37ffe">00162</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#55876e2e7cd537052fec1c7f46f37ffe">invalidateFitness</a>()
<a name="l00163"></a>00163 {
<a name="l00164"></a>00164 <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a> = <span class="keyword">true</span>;
<a name="l00165"></a>00165 }
<a name="l00166"></a>00166
<a name="l00167"></a>00167
<a name="l00171"></a><a class="code" href="classMOEO.html#9423f9daebb1f7be6d52c80692e4af48">00171</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#9423f9daebb1f7be6d52c80692e4af48">invalidFitness</a>()<span class="keyword"> const</span>
<a name="l00172"></a>00172 <span class="keyword"> </span>{
<a name="l00173"></a>00173 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a>;
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175
<a name="l00179"></a><a class="code" href="classMOEO.html#1283a27baab9728673445832e6d4301a">00179</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#1283a27baab9728673445832e6d4301a">invalidateDiversity</a>()
<a name="l00180"></a>00180 {
<a name="l00181"></a>00181 <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a> = <span class="keyword">true</span>;
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183
<a name="l00184"></a>00184
<a name="l00188"></a><a class="code" href="classMOEO.html#c4941e8e600fd360fdf1b061ee938e34">00188</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#c4941e8e600fd360fdf1b061ee938e34">invalidDiversity</a>()<span class="keyword"> const</span>
<a name="l00189"></a>00189 <span class="keyword"> </span>{
<a name="l00190"></a>00190 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a>;
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192
<a name="l00193"></a>00193
<a name="l00197"></a><a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">00197</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">invalidate</a>()
<a name="l00198"></a>00198 {
<a name="l00199"></a>00199 <a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">invalidateObjectiveVector</a>();
<a name="l00200"></a>00200 <a class="code" href="classMOEO.html#55876e2e7cd537052fec1c7f46f37ffe">invalidateFitness</a>();
<a name="l00201"></a>00201 <a class="code" href="classMOEO.html#1283a27baab9728673445832e6d4301a">invalidateDiversity</a>();
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203
<a name="l00204"></a>00204
<a name="l00208"></a><a class="code" href="classMOEO.html#314df446d1a9211121cedb2629da8906">00208</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#314df446d1a9211121cedb2629da8906">invalid</a>()<span class="keyword"> const</span>
<a name="l00209"></a>00209 <span class="keyword"> </span>{
<a name="l00210"></a>00210 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>();
<a name="l00211"></a>00211 }
<a name="l00212"></a>00212
<a name="l00213"></a>00213
<a name="l00220"></a><a class="code" href="classMOEO.html#119ef916de4955298febaf3e1c8ad705">00220</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#119ef916de4955298febaf3e1c8ad705">operator&lt;</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html">MOEO</a> &amp; _other)<span class="keyword"> const</span>
<a name="l00221"></a>00221 <span class="keyword"> </span>{
<a name="l00222"></a>00222 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>() &lt; _other.<a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>();
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224
<a name="l00225"></a>00225
<a name="l00229"></a><a class="code" href="classMOEO.html#ca43305b2f4d1b1933f7e1c579404379">00229</a> <span class="keyword">virtual</span> std::string <a class="code" href="classMOEO.html#ca43305b2f4d1b1933f7e1c579404379">className</a>()<span class="keyword"> const</span>
<a name="l00230"></a>00230 <span class="keyword"> </span>{
<a name="l00231"></a>00231 <span class="keywordflow">return</span> <span class="stringliteral">"MOEO"</span>;
<a name="l00232"></a>00232 }
<a name="l00233"></a>00233
<a name="l00234"></a>00234
<a name="l00239"></a><a class="code" href="classMOEO.html#a3b6074b3289585bf4dc6998e8397e24">00239</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#a3b6074b3289585bf4dc6998e8397e24">printOn</a>(std::ostream &amp; _os)<span class="keyword"> const</span>
<a name="l00240"></a>00240 <span class="keyword"> </span>{
<a name="l00241"></a>00241 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>() )
<a name="l00242"></a>00242 {
<a name="l00243"></a>00243 _os &lt;&lt; <span class="stringliteral">"INVALID\t"</span>;
<a name="l00244"></a>00244 }
<a name="l00245"></a>00245 <span class="keywordflow">else</span>
<a name="l00246"></a>00246 {
<a name="l00247"></a>00247 _os &lt;&lt; <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a> &lt;&lt; <span class="charliteral">'\t'</span>;
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249 }
<a name="l00176"></a>00176
<a name="l00180"></a><a class="code" href="classMOEO.html#c610f4636e8c26a351fcfbc25028aa01">00180</a> <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a> <a class="code" href="classMOEO.html#c610f4636e8c26a351fcfbc25028aa01">diversity</a>()<span class="keyword"> const</span>
<a name="l00181"></a>00181 <span class="keyword"> </span>{
<a name="l00182"></a>00182 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#c4941e8e600fd360fdf1b061ee938e34">invalidDiversity</a>() )
<a name="l00183"></a>00183 {
<a name="l00184"></a>00184 <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">"invalid diversity in MOEO"</span>);
<a name="l00185"></a>00185 }
<a name="l00186"></a>00186 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a>;
<a name="l00187"></a>00187 }
<a name="l00188"></a>00188
<a name="l00189"></a>00189
<a name="l00194"></a><a class="code" href="classMOEO.html#1f0a391984cd14bcf930d1d81dd4848e">00194</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#c610f4636e8c26a351fcfbc25028aa01">diversity</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a> &amp; _diversityValue)
<a name="l00195"></a>00195 {
<a name="l00196"></a>00196 <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a> = _diversityValue;
<a name="l00197"></a>00197 <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a> = <span class="keyword">false</span>;
<a name="l00198"></a>00198 }
<a name="l00199"></a>00199
<a name="l00200"></a>00200
<a name="l00204"></a><a class="code" href="classMOEO.html#1283a27baab9728673445832e6d4301a">00204</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#1283a27baab9728673445832e6d4301a">invalidateDiversity</a>()
<a name="l00205"></a>00205 {
<a name="l00206"></a>00206 <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a> = <span class="keyword">true</span>;
<a name="l00207"></a>00207 }
<a name="l00208"></a>00208
<a name="l00209"></a>00209
<a name="l00213"></a><a class="code" href="classMOEO.html#c4941e8e600fd360fdf1b061ee938e34">00213</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#c4941e8e600fd360fdf1b061ee938e34">invalidDiversity</a>()<span class="keyword"> const</span>
<a name="l00214"></a>00214 <span class="keyword"> </span>{
<a name="l00215"></a>00215 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a>;
<a name="l00216"></a>00216 }
<a name="l00217"></a>00217
<a name="l00218"></a>00218
<a name="l00222"></a><a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">00222</a> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#1069501a40e07071d78c067c46b696ee">invalidate</a>()
<a name="l00223"></a>00223 {
<a name="l00224"></a>00224 <a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">invalidateObjectiveVector</a>();
<a name="l00225"></a>00225 <a class="code" href="classMOEO.html#55876e2e7cd537052fec1c7f46f37ffe">invalidateFitness</a>();
<a name="l00226"></a>00226 <a class="code" href="classMOEO.html#1283a27baab9728673445832e6d4301a">invalidateDiversity</a>();
<a name="l00227"></a>00227 }
<a name="l00228"></a>00228
<a name="l00229"></a>00229
<a name="l00233"></a><a class="code" href="classMOEO.html#314df446d1a9211121cedb2629da8906">00233</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#314df446d1a9211121cedb2629da8906">invalid</a>()<span class="keyword"> const</span>
<a name="l00234"></a>00234 <span class="keyword"> </span>{
<a name="l00235"></a>00235 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>();
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237
<a name="l00238"></a>00238
<a name="l00245"></a><a class="code" href="classMOEO.html#119ef916de4955298febaf3e1c8ad705">00245</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#119ef916de4955298febaf3e1c8ad705">operator&lt;</a>(<span class="keyword">const</span> <a class="code" href="classMOEO.html">MOEO</a> &amp; _other)<span class="keyword"> const</span>
<a name="l00246"></a>00246 <span class="keyword"> </span>{
<a name="l00247"></a>00247 <span class="keywordflow">return</span> <a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>() &lt; _other.<a class="code" href="classMOEO.html#7509143b0f18644e7d3183a039cece7b">objectiveVector</a>();
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249
<a name="l00250"></a>00250
<a name="l00251"></a>00251
<a name="l00256"></a><a class="code" href="classMOEO.html#1bbd9cb1a7709592bf4bc29dff8c5273">00256</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#1bbd9cb1a7709592bf4bc29dff8c5273">readFrom</a>(std::istream &amp; _is)
<a name="l00257"></a>00257 {
<a name="l00258"></a>00258 std::string objectiveVector_str;
<a name="l00259"></a>00259 <span class="keywordtype">int</span> pos = _is.tellg();
<a name="l00260"></a>00260 _is &gt;&gt; objectiveVector_str;
<a name="l00261"></a>00261 <span class="keywordflow">if</span> (objectiveVector_str == <span class="stringliteral">"INVALID"</span>)
<a name="l00262"></a>00262 {
<a name="l00263"></a>00263 <a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">invalidateObjectiveVector</a>();
<a name="l00264"></a>00264 }
<a name="l00265"></a>00265 <span class="keywordflow">else</span>
<a name="l00266"></a>00266 {
<a name="l00267"></a>00267 <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a> = <span class="keyword">false</span>;
<a name="l00268"></a>00268 _is.seekg(pos); <span class="comment">// rewind</span>
<a name="l00269"></a>00269 _is &gt;&gt; <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a>;
<a name="l00270"></a>00270 }
<a name="l00271"></a>00271 }
<a name="l00272"></a>00272
<a name="l00273"></a>00273
<a name="l00274"></a>00274 <span class="keyword">private</span>:
<a name="l00254"></a><a class="code" href="classMOEO.html#ca43305b2f4d1b1933f7e1c579404379">00254</a> <span class="keyword">virtual</span> std::string <a class="code" href="classMOEO.html#ca43305b2f4d1b1933f7e1c579404379">className</a>()<span class="keyword"> const</span>
<a name="l00255"></a>00255 <span class="keyword"> </span>{
<a name="l00256"></a>00256 <span class="keywordflow">return</span> <span class="stringliteral">"MOEO"</span>;
<a name="l00257"></a>00257 }
<a name="l00258"></a>00258
<a name="l00259"></a>00259
<a name="l00264"></a><a class="code" href="classMOEO.html#a3b6074b3289585bf4dc6998e8397e24">00264</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#a3b6074b3289585bf4dc6998e8397e24">printOn</a>(std::ostream &amp; _os)<span class="keyword"> const</span>
<a name="l00265"></a>00265 <span class="keyword"> </span>{
<a name="l00266"></a>00266 <span class="keywordflow">if</span> ( <a class="code" href="classMOEO.html#c8e93beabdab8c2f79f17c7e39efdd05">invalidObjectiveVector</a>() )
<a name="l00267"></a>00267 {
<a name="l00268"></a>00268 _os &lt;&lt; <span class="stringliteral">"INVALID\t"</span>;
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270 <span class="keywordflow">else</span>
<a name="l00271"></a>00271 {
<a name="l00272"></a>00272 _os &lt;&lt; <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a> &lt;&lt; <span class="charliteral">'\t'</span>;
<a name="l00273"></a>00273 }
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275
<a name="l00277"></a><a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">00277</a> <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a> <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a>;
<a name="l00279"></a><a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">00279</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a>;
<a name="l00281"></a><a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">00281</a> <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a> <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a>;
<a name="l00283"></a><a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">00283</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a>;
<a name="l00285"></a><a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">00285</a> <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a> <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a>;
<a name="l00287"></a><a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">00287</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a>;
<a name="l00288"></a>00288
<a name="l00289"></a>00289 };
<a name="l00290"></a>00290
<a name="l00291"></a>00291 <span class="preprocessor">#endif </span><span class="comment">/*MOEO_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:51 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
<a name="l00276"></a>00276
<a name="l00281"></a><a class="code" href="classMOEO.html#1bbd9cb1a7709592bf4bc29dff8c5273">00281</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classMOEO.html#1bbd9cb1a7709592bf4bc29dff8c5273">readFrom</a>(std::istream &amp; _is)
<a name="l00282"></a>00282 {
<a name="l00283"></a>00283 std::string objectiveVector_str;
<a name="l00284"></a>00284 <span class="keywordtype">int</span> pos = _is.tellg();
<a name="l00285"></a>00285 _is &gt;&gt; objectiveVector_str;
<a name="l00286"></a>00286 <span class="keywordflow">if</span> (objectiveVector_str == <span class="stringliteral">"INVALID"</span>)
<a name="l00287"></a>00287 {
<a name="l00288"></a>00288 <a class="code" href="classMOEO.html#6b75e7e84726cf4e2d50216a35cec70b">invalidateObjectiveVector</a>();
<a name="l00289"></a>00289 }
<a name="l00290"></a>00290 <span class="keywordflow">else</span>
<a name="l00291"></a>00291 {
<a name="l00292"></a>00292 <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a> = <span class="keyword">false</span>;
<a name="l00293"></a>00293 _is.seekg(pos); <span class="comment">// rewind</span>
<a name="l00294"></a>00294 _is &gt;&gt; <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a>;
<a name="l00295"></a>00295 }
<a name="l00296"></a>00296 }
<a name="l00297"></a>00297
<a name="l00298"></a>00298
<a name="l00299"></a>00299 <span class="keyword">private</span>:
<a name="l00300"></a>00300
<a name="l00302"></a><a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">00302</a> <a class="code" href="classMOEO.html#9fafca99234ef3cd9fdbaf05bde5a275">ObjectiveVector</a> <a class="code" href="classMOEO.html#26b6fd1187b825b655d5a34b1d0693c9">objectiveVectorValue</a>;
<a name="l00304"></a><a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">00304</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#d07613f286ef484f164c51c9c1b2dc91">invalidObjectiveVectorValue</a>;
<a name="l00306"></a><a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">00306</a> <a class="code" href="classMOEO.html#03184b6c0b5c905e0ff5a790a3d55803">Fitness</a> <a class="code" href="classMOEO.html#bcc3104ab7311fa5987de80811393c7c">fitnessValue</a>;
<a name="l00308"></a><a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">00308</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#17f57546c6de38604d6749cc6ef9d254">invalidFitnessValue</a>;
<a name="l00310"></a><a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">00310</a> <a class="code" href="classMOEO.html#9682a883fedc6333e95906e02236d492">Diversity</a> <a class="code" href="classMOEO.html#83cc0d3a4020cbd7e1ff895dfedc61eb">diversityValue</a>;
<a name="l00312"></a><a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">00312</a> <span class="keywordtype">bool</span> <a class="code" href="classMOEO.html#c53c08b7c51d4cc06efe58c6127f9b7d">invalidDiversityValue</a>;
<a name="l00313"></a>00313
<a name="l00314"></a>00314 };
<a name="l00315"></a>00315
<a name="l00316"></a>00316 <span class="preprocessor">#endif </span><span class="comment">/*MOEO_H_*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

View file

@ -101,7 +101,7 @@
<a name="l00078"></a>00078 =======================================================================
<a name="l00079"></a>00079
<a name="l00080"></a>00080 Mailing list : paradiseo-help@lists.gforge.inria.fr
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 10:35:52 2007 for ParadisEO-MOEOMovingObjects by&nbsp;
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 16:37:09 2007 for ParadisEO-MOEOMovingObjects 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>

Some files were not shown because too many files have changed in this diff Show more