Merge branch 'master' of ssh://localhost:8479/gitroot/eodev/eodev
This commit is contained in:
commit
6a4dfae7ee
3 changed files with 609 additions and 498 deletions
|
|
@ -34,6 +34,7 @@ ENDIF()
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
SET (TEST_LIST
|
SET (TEST_LIST
|
||||||
|
t-eoInitVariableLength
|
||||||
t-eofitness
|
t-eofitness
|
||||||
t-eoRandom
|
t-eoRandom
|
||||||
t-eobin
|
t-eobin
|
||||||
|
|
|
||||||
98
eo/test/t-eoInitVariableLength.cpp
Normal file
98
eo/test/t-eoInitVariableLength.cpp
Normal file
|
|
@ -0,0 +1,98 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
#include <eo>
|
||||||
|
|
||||||
|
// An adhoc atom type of our own
|
||||||
|
class Quad : public std::vector<int>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Just four times zero
|
||||||
|
Quad() : std::vector<int>(4,0) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// EO somewhat forces you to implement a way to read/print your atom type
|
||||||
|
// You can either inherit from eoPrintable and overload readFrom/printOn
|
||||||
|
// or, just like here, directly overload stream operators.
|
||||||
|
|
||||||
|
// read
|
||||||
|
std::istream& operator>>( std::istream& is, Quad& q )
|
||||||
|
{
|
||||||
|
for( unsigned int i=0, n=4; i<n; ++i) {
|
||||||
|
// use default int stream input
|
||||||
|
is >> q[i];
|
||||||
|
}
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
// print
|
||||||
|
std::ostream& operator<<( std::ostream& os, const Quad& q )
|
||||||
|
{
|
||||||
|
os << q[0];
|
||||||
|
for( unsigned int i=1, n=4; i<n; ++i) {
|
||||||
|
os << " " << q[i];
|
||||||
|
}
|
||||||
|
os << " ";
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
// An init for the atoms
|
||||||
|
// Note that this mask the template passed to the eoInit
|
||||||
|
class QuadInit : public eoInit<Quad>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// this is the API: an init modify the solution
|
||||||
|
void operator()( Quad& q ) {
|
||||||
|
for( unsigned int i=0, n=4; i<n; ++i) {
|
||||||
|
// rng is the random number generator of EO
|
||||||
|
q[i] = rng.random(10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// The solution/individual type.
|
||||||
|
// Just a proxy to an eoVector of atoms,
|
||||||
|
// with a fitness as double.
|
||||||
|
class QuadVec : public eoVector<double,Quad>
|
||||||
|
{};
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
unsigned int vec_size_min = 1;
|
||||||
|
unsigned int vec_size_max = 10;
|
||||||
|
unsigned int pop_size = 10;
|
||||||
|
|
||||||
|
// Fix a seed for the random generator,
|
||||||
|
// thus, the results are predictable.
|
||||||
|
// Set it to zero if you want pseudo-random numbers
|
||||||
|
// that changes at each calls.
|
||||||
|
rng.reseed( 1 );
|
||||||
|
|
||||||
|
// The operator that produce a random vector of four values.
|
||||||
|
QuadInit atom_init;
|
||||||
|
|
||||||
|
// The operator that produces a random vector of a (vector of four values).
|
||||||
|
eoInitVariableLength<QuadVec> vec_init( vec_size_min, vec_size_max, atom_init );
|
||||||
|
|
||||||
|
// You can initialize a population of N individuals by passing an initializer to it.
|
||||||
|
eoPop<QuadVec> pop( pop_size, vec_init );
|
||||||
|
|
||||||
|
// eoPop can be printed easily,
|
||||||
|
// thanks to the overloadings above.
|
||||||
|
std::cout << pop << std::endl;
|
||||||
|
|
||||||
|
// With a seed at 1, this should output:
|
||||||
|
/*
|
||||||
|
10
|
||||||
|
INVALID 6 5 9 5 9 0 1 6 0 4 8 9 0 6 9 4 9 5 5 3 6 3 0 2 8
|
||||||
|
INVALID 9 9 2 0 3 2 4 3 3 6 2 8 2 4 5 4 7 5 3 0 5 4 9 8 3 2 7 7 9 4 4 4 6 6 3 9 2
|
||||||
|
INVALID 1 1 4 1 4
|
||||||
|
INVALID 5 3 8 9 8 8 1 4 1 6 6 5 4 3 2 7 5 1 2 6 1
|
||||||
|
INVALID 3 7 8 1 4 0 9 1 0 6 4 2 1
|
||||||
|
INVALID 6 7 4 6 8 1 2 6 0 5 1 2 6 9 2 6 8 6 1 5 5 4 1 0 3
|
||||||
|
INVALID 5 2 7 7 6 1 4 0 7 5 5 9 7 2 4 7 1 6 1 9 0
|
||||||
|
INVALID 3 5 5 3 9 2 9 9 1 1 7 2 1
|
||||||
|
INVALID 6 9 9 9 0 0 7 1 7 9 7 8 5 3 7 5 6 7 3 6 7 6 3 3 5
|
||||||
|
INVALID 1 6 2 4 3
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
@ -130,7 +130,6 @@
|
||||||
horizontal : false,
|
horizontal : false,
|
||||||
title : "Latest news from EO",
|
title : "Latest news from EO",
|
||||||
numResults : 20
|
numResults : 20
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new GFdynamicFeedControl(feeds, 'feed-control', options);
|
new GFdynamicFeedControl(feeds, 'feed-control', options);
|
||||||
|
|
@ -147,8 +146,8 @@
|
||||||
</div> <!-- id=menu -->
|
</div> <!-- id=menu -->
|
||||||
</div> <!-- id=alt -->
|
</div> <!-- id=alt -->
|
||||||
|
|
||||||
<div id="main">
|
|
||||||
|
|
||||||
|
<div id="main">
|
||||||
|
|
||||||
<h1><a name="Plan"></a>Evolving Objects (EO): an Evolutionary Computation Framework</h1>
|
<h1><a name="Plan"></a>Evolving Objects (EO): an Evolutionary Computation Framework</h1>
|
||||||
|
|
||||||
|
|
@ -174,6 +173,7 @@
|
||||||
|
|
||||||
<p>Alternatively, you can join us on the official chatroom. You can try our <a href="http://irc.lc/freenode/paradiseo">webchat interface</a>, or if you already use IRC, you can directly connect to the <a href="irc://irc.freenode.org/#paradiseo">irc.freenode.org/#paradiseo</a> multi-user chatroom with your favorite client.</p>
|
<p>Alternatively, you can join us on the official chatroom. You can try our <a href="http://irc.lc/freenode/paradiseo">webchat interface</a>, or if you already use IRC, you can directly connect to the <a href="irc://irc.freenode.org/#paradiseo">irc.freenode.org/#paradiseo</a> multi-user chatroom with your favorite client.</p>
|
||||||
|
|
||||||
|
<!--
|
||||||
<p>If you want to know how to help us to improve EO, the easiest way is to click on the following button:
|
<p>If you want to know how to help us to improve EO, the easiest way is to click on the following button:
|
||||||
|
|
||||||
<form method="POST" action="http://openhatch.org/+do/project.views.wanna_help_do">
|
<form method="POST" action="http://openhatch.org/+do/project.views.wanna_help_do">
|
||||||
|
|
@ -192,8 +192,9 @@
|
||||||
#openhatch-wannahelp-button { -moz-border-radius: 8px; color: #444; float:left; padding:10px 20px; display:block; padding:2px 8px; }
|
#openhatch-wannahelp-button { -moz-border-radius: 8px; color: #444; float:left; padding:10px 20px; display:block; padding:2px 8px; }
|
||||||
#openhatch-wannahelp-button:focus { outline-color:-moz-use-text-color; outline-style:none; outline-width:medium; }
|
#openhatch-wannahelp-button:focus { outline-color:-moz-use-text-color; outline-style:none; outline-width:medium; }
|
||||||
</style>
|
</style>
|
||||||
|
-->
|
||||||
<!--<script type="text/javascript" src="http://openhatch.org/static/packed/selections_for_widget.js?1271800811"></script>-->
|
<!--<script type="text/javascript" src="http://openhatch.org/static/packed/selections_for_widget.js?1271800811"></script>-->
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -269,6 +270,17 @@
|
||||||
<li>…</li>
|
<li>…</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li>Parallelization tools:
|
||||||
|
<ul>
|
||||||
|
<li>Shared memory loops unrolling (with <a href="http://openmp.org">OpenMP</a>)</li>
|
||||||
|
<li>Message passing parallelization (with <a href="http://www.open-mpi.org/">openMPI</a>):
|
||||||
|
<ul>
|
||||||
|
<li>map/reduce-like design, with operators choice, as in EO</li>
|
||||||
|
<li>useful existing operators (parallel dynamic multi-start, static evaluations, …)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</l>
|
||||||
<li>Portable and human-readable parameter files</li>
|
<li>Portable and human-readable parameter files</li>
|
||||||
<li>Suspend and load population from files</li>
|
<li>Suspend and load population from files</li>
|
||||||
<li>Versatile checkpointing and logging:
|
<li>Versatile checkpointing and logging:
|
||||||
|
|
@ -286,7 +298,9 @@
|
||||||
<li><em>And more!</em></li>
|
<li><em>And more!</em></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<h2><a name="Portability"></a>Portability</h2>
|
<h2><a name="Portability"></a>Portability</h2>
|
||||||
|
|
||||||
<p> EO should work on Windows and any Un*x-like operating system with a
|
<p> EO should work on Windows and any Un*x-like operating system with a
|
||||||
standard-conforming C++ development system. </p>
|
standard-conforming C++ development system. </p>
|
||||||
|
|
||||||
|
|
@ -324,7 +338,6 @@
|
||||||
|
|
||||||
<div style="text-align:center;" id="__ss_4878872"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/nojhan/evolving-objects-yet-another-evolutionary-computation-library" title="Evolving Objects: Yet Another Evolutionary Computation Library?">Evolving Objects: Yet Another Evolutionary Computation Library?</a></strong><object id="__sse4878872" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=lecreusot-100731121355-phpapp01&stripped_title=evolving-objects-yet-another-evolutionary-computation-library" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4878872" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=lecreusot-100731121355-phpapp01&stripped_title=evolving-objects-yet-another-evolutionary-computation-library" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
|
<div style="text-align:center;" id="__ss_4878872"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/nojhan/evolving-objects-yet-another-evolutionary-computation-library" title="Evolving Objects: Yet Another Evolutionary Computation Library?">Evolving Objects: Yet Another Evolutionary Computation Library?</a></strong><object id="__sse4878872" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=lecreusot-100731121355-phpapp01&stripped_title=evolving-objects-yet-another-evolutionary-computation-library" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4878872" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=lecreusot-100731121355-phpapp01&stripped_title=evolving-objects-yet-another-evolutionary-computation-library" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
|
||||||
|
|
||||||
|
|
||||||
<p>You can also read this <a href="http://geneura.ugr.es/~jmerelo/GAPPT/index.html">
|
<p>You can also read this <a href="http://geneura.ugr.es/~jmerelo/GAPPT/index.html">
|
||||||
PowerPoint presentation</a>, that shows the EO philosophy.
|
PowerPoint presentation</a>, that shows the EO philosophy.
|
||||||
It includes a Visual Basic macro for evolving objects in Visual Basic
|
It includes a Visual Basic macro for evolving objects in Visual Basic
|
||||||
|
|
@ -360,6 +373,8 @@
|
||||||
</font>
|
</font>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>If you want to understand the message-passing parallelization module, check the <a href="http://eodev.sourceforge.net/eo/tutorial/Parallelization/eompi.html">introduction to eo::MPI</a> by Benjamin Bouvier.</p>
|
||||||
|
|
||||||
<p>Here is a list of some known publications that used EO:</p>
|
<p>Here is a list of some known publications that used EO:</p>
|
||||||
<ul class="publications">
|
<ul class="publications">
|
||||||
<li>J.J. Gilijamse, J. Küpper, S. Hoekstra, S.Y.T. van de Meerakker, G. Meijer,
|
<li>J.J. Gilijamse, J. Küpper, S. Hoekstra, S.Y.T. van de Meerakker, G. Meijer,
|
||||||
|
|
@ -374,7 +389,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h1><a name="Code"></a>Code <a href="#Plan">⤒</a></h1>
|
<h1><a name="Code"></a>Code <a href="#Plan">⤒</a></h1>
|
||||||
|
|
||||||
<h2><a name="Download"></a>Download</h2>
|
<h2><a name="Download"></a>Download</h2>
|
||||||
|
|
@ -410,7 +424,6 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2><a name="License"></a>License</h2>
|
<h2><a name="License"></a>License</h2>
|
||||||
|
|
||||||
<p>EO is distributed under the
|
<p>EO is distributed under the
|
||||||
|
|
@ -505,9 +518,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2><a name="Authors"></a>Authors</h2>
|
<h2><a name="Authors"></a>Authors</h2>
|
||||||
|
|
||||||
<p>EO was started by the <a href="http://geneura.ugr.es/">Geneura
|
<p>EO was started by the <a href="http://geneura.ugr.es/">Geneura
|
||||||
|
|
@ -530,7 +540,9 @@
|
||||||
infrastructure maintenance. </p>
|
infrastructure maintenance. </p>
|
||||||
|
|
||||||
<p>The project is now maintained by <a href="http://johann.dreo.fr">Johann Dréo</a>,
|
<p>The project is now maintained by <a href="http://johann.dreo.fr">Johann Dréo</a>,
|
||||||
working on it with the help of <a href="http://caner.candan.fr">Caner Candan</a>.</p>
|
working on it with the help of <a href="http://caner.candan.fr">Caner Candan</a>.
|
||||||
|
<a href="https://github.com/BenjBouv">Benjamin Bouvier</a> have designed a
|
||||||
|
whole new MPI parallelization module.</p>
|
||||||
|
|
||||||
|
|
||||||
<h2><a name="Links"></a>Links</h2>
|
<h2><a name="Links"></a>Links</h2>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue