Merge branch 'master' of ssh://localhost:8479/gitroot/eodev/eodev

This commit is contained in:
Johann Dreo 2012-09-06 12:15:36 +02:00
commit 6a4dfae7ee
3 changed files with 609 additions and 498 deletions

View file

@ -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

View 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
*/
}

View file

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
@ -30,9 +30,9 @@
--> -->
</head> </head>
<body> <body>
<div id="alt"> <div id="alt">
<img style="clear:left;" src="eo_logo.png" alt="Evolving Objects logo" /> <img style="clear:left;" src="eo_logo.png" alt="Evolving Objects logo" />
<div id="menu"> <div id="menu">
<p>C++ evolutionary computation components framework</p> <p>C++ evolutionary computation components framework</p>
@ -89,8 +89,8 @@
</div><!-- class=shortcuts --> </div><!-- class=shortcuts -->
<ul class="badges"> <ul class="badges">
<li> <li>
<!-- ++Begin Dynamic Feed Wizard Generated Code++ --> <!-- ++Begin Dynamic Feed Wizard Generated Code++ -->
<!-- <!--
// Created with a Google AJAX Search and Feed Wizard // Created with a Google AJAX Search and Feed Wizard
// http://code.google.com/apis/ajaxsearch/wizards.html // http://code.google.com/apis/ajaxsearch/wizards.html
@ -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);
@ -139,18 +138,18 @@
google.load('feeds', '1'); google.load('feeds', '1');
google.setOnLoadCallback(LoadDynamicFeedControl); google.setOnLoadCallback(LoadDynamicFeedControl);
</script> </script>
<!-- ++End Dynamic Feed Control Wizard Generated Code++ --> <!-- ++End Dynamic Feed Control Wizard Generated Code++ -->
</li> </li>
<li> <a href="http://sourceforge.net/projects/eodev"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=9775&amp;type=8" width="80" height="15" alt="Get Evolving Objects at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></li> <li> <a href="http://sourceforge.net/projects/eodev"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=9775&amp;type=8" width="80" height="15" alt="Get Evolving Objects at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></li>
</ul> </ul>
</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>
<p>EO is <em>a template-based, ANSI-C++ evolutionary computation library</em> which helps you to write your own stochastic optimization algorithms insanely fast.</p> <p>EO is <em>a template-based, ANSI-C++ evolutionary computation library</em> which helps you to write your own stochastic optimization algorithms insanely fast.</p>
@ -174,29 +173,31 @@
<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">
<input type="hidden" name="from_offsite" value="True" /> <input type="hidden" name="from_offsite" value="True" />
<input type="hidden" value="6519" name="project"/> <input type="hidden" value="6519" name="project"/>
<input type="submit" value="I want to help" rel="tipsy-south" id="openhatch-wannahelp-button" original-title="Click to add yourself to the list of people who want to contribute. People of all levels are welcome!"/> <input type="submit" value="I want to help" rel="tipsy-south" id="openhatch-wannahelp-button" original-title="Click to add yourself to the list of people who want to contribute. People of all levels are welcome!"/>
</form> </form>
<style> <style>
@import url('http://openhatch.org/static/css/tipsy.css'); @import url('http://openhatch.org/static/css/tipsy.css');
</style> </style>
<style type="text/css"> <style type="text/css">
#openhatch-wannahelp-button:hover, #openhatch-wannahelp-button:focus { background-image:url('http://openhatch.org/static/images/wannahelp-button-bg-hover.png'); color:#222; text-decoration:none; } #openhatch-wannahelp-button:hover, #openhatch-wannahelp-button:focus { background-image:url('http://openhatch.org/static/images/wannahelp-button-bg-hover.png'); color:#222; text-decoration:none; }
#openhatch-wannahelp-button { background: #C8E29D url('http://openhatch.org/static/images/wannahelp-button-bg.png') repeat-x scroll center top; border:3px solid #fff; cursor:pointer; cursor: hand; font-family: Helvetica, sans-serif; font-size:13pt; font-weight:normal; text-align:center; text-shadow:0 1px 0 #fff; white-space:normal; } #openhatch-wannahelp-button { background: #C8E29D url('http://openhatch.org/static/images/wannahelp-button-bg.png') repeat-x scroll center top; border:3px solid #fff; cursor:pointer; cursor: hand; font-family: Helvetica, sans-serif; font-size:13pt; font-weight:normal; text-align:center; text-shadow:0 1px 0 #fff; white-space:normal; }
#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>
<h1><a name="Features"></a>Features <a href="#Plan"></a></h1> <h1><a name="Features"></a>Features <a href="#Plan"></a></h1>
@ -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>
@ -542,11 +554,11 @@
<li>Charles Darwin: <a href="http://en.wikipedia.org/wiki/The_Origin_of_Species" >The Origin of Species</a>.</li> <li>Charles Darwin: <a href="http://en.wikipedia.org/wiki/The_Origin_of_Species" >The Origin of Species</a>.</li>
</ul> </ul>
</div> <!-- id=main --> </div> <!-- id=main -->
<!-- Piwik --> <!-- Piwik -->
<script type="text/javascript"> <script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://sourceforge.net/apps/piwik/eodev/" : "http://sourceforge.net/apps/piwik/eodev/"); var pkBaseURL = (("https:" == document.location.protocol) ? "https://sourceforge.net/apps/piwik/eodev/" : "http://sourceforge.net/apps/piwik/eodev/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript"> </script><script type="text/javascript">
@ -555,8 +567,8 @@
piwikTracker.trackPageView(); piwikTracker.trackPageView();
piwikTracker.enableLinkTracking(); piwikTracker.enableLinkTracking();
} catch( err ) {} } catch( err ) {}
</script><noscript><p><img src="http://sourceforge.net/apps/piwik/eodev/piwik.php?idsite=1" style="border:0" alt=""/></p></noscript> </script><noscript><p><img src="http://sourceforge.net/apps/piwik/eodev/piwik.php?idsite=1" style="border:0" alt=""/></p></noscript>
<!-- End Piwik Tag --> <!-- End Piwik Tag -->
</body> </body>