Paradiseo-eo sources added
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@40 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
bc1f453978
commit
c3aec878e5
3609 changed files with 342772 additions and 0 deletions
112
trunk/paradiseo-eo/doc/html/t-eoinclusion_8cpp-source.html
Normal file
112
trunk/paradiseo-eo/doc/html/t-eoinclusion_8cpp-source.html
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
||||
<title>EO: t-eoinclusion.cpp Source File</title>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
||||
</head><body>
|
||||
<!-- Generated by Doxygen 1.3.9.1 -->
|
||||
<div class="qindex"> <form class="search" action="search.php" method="get">
|
||||
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
|
||||
<div class="nav">
|
||||
<a class="el" href="dir_000002.html">test</a></div>
|
||||
<h1>t-eoinclusion.cpp</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">//-----------------------------------------------------------------------------</span>
|
||||
00002 <span class="comment">// t-eoinclusion.cpp</span>
|
||||
00003 <span class="comment">//-----------------------------------------------------------------------------</span>
|
||||
00004
|
||||
00005 <span class="preprocessor">#include <ga/eoBin.h></span>
|
||||
00006 <span class="preprocessor">#include <eoPop.h></span>
|
||||
00007 <span class="preprocessor">#include <eoInclusion.h></span>
|
||||
00008
|
||||
00009 <span class="comment">//-----------------------------------------------------------------------------</span>
|
||||
00010
|
||||
00011 <span class="keyword">typedef</span> eoBin<float> Chrom;
|
||||
00012
|
||||
00013 <span class="preprocessor">#include "binary_value.h"</span>
|
||||
00014
|
||||
00015 <span class="comment">//-----------------------------------------------------------------------------</span>
|
||||
00016
|
||||
00017 main()
|
||||
00018 {
|
||||
00019 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> CHROM_SIZE = 4;
|
||||
00020
|
||||
00021 eoBinRandom<Chrom> random;
|
||||
00022 BinaryValue eval;
|
||||
00023
|
||||
00024 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> POP_SIZE = 4; POP_SIZE <=6; POP_SIZE++)
|
||||
00025 {
|
||||
00026 <a class="code" href="classeo_pop.html">eoPop<Chrom></a> pop;
|
||||
00027 <span class="keywordtype">unsigned</span> i;
|
||||
00028 <span class="keywordflow">for</span> ( i = 0; i < POP_SIZE; i++)
|
||||
00029 {
|
||||
00030 Chrom chrom(CHROM_SIZE);
|
||||
00031 random(chrom);
|
||||
00032 eval(chrom);
|
||||
00033 pop.push_back(chrom);
|
||||
00034 }
|
||||
00035
|
||||
00036 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> POP2_SIZE = 4; POP2_SIZE <=6; POP2_SIZE++)
|
||||
00037 {
|
||||
00038 <a class="code" href="classeo_pop.html">eoPop<Chrom></a> pop2, pop3, pop4, pop5;
|
||||
00039
|
||||
00040 <span class="keywordflow">for</span> (i = 0; i < POP2_SIZE; i++)
|
||||
00041 {
|
||||
00042 Chrom chrom(CHROM_SIZE);
|
||||
00043 random(chrom);
|
||||
00044 eval(chrom);
|
||||
00045 pop2.push_back(chrom);
|
||||
00046 }
|
||||
00047
|
||||
00048 std::cout << <span class="stringliteral">"--------------------------------------------------"</span> << std::endl
|
||||
00049 << <span class="stringliteral">"breeders \tpop"</span> << std::endl
|
||||
00050 << <span class="stringliteral">"--------------------------------------------------"</span> << std::endl;
|
||||
00051 <span class="keywordflow">for</span> (i = 0; i < max(pop.size(), pop2.size()); i++)
|
||||
00052 {
|
||||
00053 <span class="keywordflow">if</span> (pop.size() > i)
|
||||
00054 std::cout << pop[i] << <span class="stringliteral">" "</span> << pop[i].fitness() << <span class="stringliteral">" \t"</span>;
|
||||
00055 <span class="keywordflow">else</span>
|
||||
00056 std::cout << <span class="stringliteral">"\t\t"</span>;
|
||||
00057 <span class="keywordflow">if</span> (pop2.size() > i)
|
||||
00058 std::cout << pop2[i] << <span class="stringliteral">" "</span> << pop2[i].fitness();
|
||||
00059 std::cout << std::endl;
|
||||
00060 }
|
||||
00061
|
||||
00062 eoInclusion<Chrom> inclusion(0.75);
|
||||
00063 pop3 = pop2;
|
||||
00064 inclusion(pop, pop3);
|
||||
00065
|
||||
00066 eoInclusion<Chrom> inclusion2;
|
||||
00067 pop4 = pop2;
|
||||
00068 inclusion2(pop, pop4);
|
||||
00069
|
||||
00070 eoInclusion<Chrom> inclusion3(1.5);
|
||||
00071 pop5 = pop2;
|
||||
00072 inclusion3(pop, pop5);
|
||||
00073
|
||||
00074 std::cout << std::endl
|
||||
00075 << <span class="stringliteral">"0.75 \t\t1.0 \t\t1.5"</span> << std::endl
|
||||
00076 << <span class="stringliteral">"---- \t\t--- \t\t---"</span> << std::endl;
|
||||
00077 <span class="keywordflow">for</span> (i = 0; i < pop5.size(); i++)
|
||||
00078 {
|
||||
00079 <span class="keywordflow">if</span> (pop3.size() > i)
|
||||
00080 std::cout << pop3[i] << <span class="stringliteral">" "</span> << pop3[i].fitness() << <span class="stringliteral">" \t"</span>;
|
||||
00081 <span class="keywordflow">else</span>
|
||||
00082 std::cout << <span class="stringliteral">" \t\t"</span>;
|
||||
00083 <span class="keywordflow">if</span> (pop4.size() > i)
|
||||
00084 std::cout << pop4[i] << <span class="stringliteral">" "</span> << pop4[i].fitness() << <span class="stringliteral">" \t"</span>;
|
||||
00085 <span class="keywordflow">else</span>
|
||||
00086 std::cout << <span class="stringliteral">" \t\t"</span>;
|
||||
00087 <span class="keywordflow">if</span> (pop5.size() > i)
|
||||
00088 std::cout << pop5[i] << <span class="stringliteral">" "</span> << pop5[i].fitness();
|
||||
00089 std::cout << std::endl;
|
||||
00090 }
|
||||
00091 }
|
||||
00092 }
|
||||
00093
|
||||
00094 <span class="keywordflow">return</span> 0;
|
||||
00095 }
|
||||
00096
|
||||
00097 <span class="comment">//-----------------------------------------------------------------------------</span>
|
||||
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Oct 19 05:06:43 2006 for EO by
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue