⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eoengine.html

📁 这是linux下的进化计算的源代码。 === === === === === === === === === === === ===== check latest news at http:
💻 HTML
📖 第 1 页 / 共 3 页
字号:
that are used in selection and in replacement procedures, and a globaltournament-based selection of a whole bunch of individuals, the <b><tt><font color="#009900">EPTournament</font></tt></b>. Though the single-selection tournaments canbe repeated to select more than one individual, and the batch tournamentselection can be used to select a single individual, both uses are probablya waste of CPU time.<ul><li><a NAME="detTournament"></a><b><tt><font color="#009900">DeterministicTournament</font></tt></b> of size T returns the best of T uniformly chosenindividuals in the population. Its size T should be an integer >= 2. Itis implemented in the <b><tt><font color="#009900">eoDetTournamentSelect</font></tt></b>class, a sub-class of eoSelectOne, as well as in the <b><tt><font color="#009900">eoDetTournamentTruncate</font></tt></b>class that repeatidly removes from the population the "winner" of the inversetournament.&nbsp; These objects use the C++ function determinitic_tournamentin&nbsp; <a href="../../doc/html/selectors_h-source.html">selectors.h</a>.</li><li><a NAME="stochTournament"></a><b><tt><font color="#009900">Stochastic Tournament</font></tt></b>of rate R first choses two individuals from the population, and selectsthe best one with probability R (the worse one with probability 1-R). Realparameter R should be in [0.5,1]. It is implemented in the <b><tt><font color="#009900">eoStochTournamentSelect</font></tt></b>class, a sub-class of eoSelectOne, as well as in the <b><tt><font color="#009900">eoStochTournamentTruncate</font></tt></b>class that repeatidly removes from the population the "winner" of the inversetournament.&nbsp; These objects use the C++ function determinitic_tournamentin&nbsp; <a href="../../doc/html/selectors_h-source.html">selectors.h</a>.</li><br><b><font color="#FF0000">Note</font></b>: A stochastic tournament withrate 1.0 is strictly identical to a deterministic tournament of size 2.<li><a NAME="EPTournament"></a><b><tt><font color="#009900">EP Tournament</font></tt></b>of size T is a global tournament: it works by assigning a score to allindividuals in the population the following way: starting with a scoreof 0, each individual I is "opposed" T times to a uniformly chosen individual.Everytime I wins, its score in incremented by 1 (and by 0.5 for every draw).The individuals are then selected deterministically based on their scoresfrom that procedure. The <b><tt><font color="#009900">EP Tournament</font></tt></b>is implemented in the&nbsp; <b><tt><font color="#009900">eoEPReduce</font></tt></b>truncation method used in the <b><tt><font color="#009900">eoEPReplacement</font></tt></b>procedure.</li><br><b><font color="#FF0000">Note</font></b>: whereas both the determiniticand the stochastic tournament select one individual, the EP tournamentis designed for batch selection. Of course it could be used to select asingle individual, but at a rather high computational cost.</ul><p><br><hr WIDTH="100%"><br><a NAME="merge"></a><b><font color="#000099"><font size=+2>Mergingpopulations</font></font></b><p>In replacement procedures, one frequently needs to merge two populations(computed form old parents and new-born offspring). Classes derived fromthe abstract class eoMerge are written for that purpose.<br><hr WIDTH="50%"><br><b><font color="#000099">eoMerge</font></b>: <b><font color="#FF0000">interface</font></b><br>The abstract class for merging procedures is the functor class<font color="#009900">eoMerge</font>,and the interface for its <tt><font color="#993300">operator()</font></tt>is<center><p><b><tt><font color="#993300">void operator()(const eoPop&lt;EOT>&amp;_parents, eoPop&lt;EOT>&amp; _offspring)</font></tt></b></center><p>which you could have guessed from the inheritance tree for class <b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/classeo_merge.html">eoMerge</a></font></font></b>,as you see there that <font color="#009900">eoMerge</font> derives from<br><tt><font color="#993300">class eoBF&lt;const eoPop&lt;EOT>&amp;, eoPop&lt;EOT>&amp;,void></font></tt>.<br>This means that it takes <font color="#FF6600">2 populations</font>and modifies the seond one by adding some individuals from the first one(which is supposed to remain <b><tt><font color="#993300">const</font></tt></b>ant).<br><hr WIDTH="50%"><br><b><font color="#000099">eoMerge</font></b>: <b><font color="#FF0000">instances</font></b><br>Available <font color="#FF6600">instances of eoMerge</font> objectsare <b><tt><font color="#009900">eoPlus</font></tt></b>, that simply addsthe parents to the offspring, or <b><tt><font color="#009900">eoElitism</font></tt></b>,that adds only some of the (best) parents to the offspring. A special caseof eoElistism is <b><tt><font color="#009900">eoNoElitism</font></tt></b>,an eoMerge that does nothing.<p><hr WIDTH="100%"><br><a NAME="reduce"></a><b><font color="#000099"><font size=+2>Reducingpopulations</font></font></b><p>The other useful component of replacement procedures, <font color="#009900">eoReduce</font>,<font color="#FF6600">killssome individuals</font> from a given population.<br><hr WIDTH="50%"><br><b><font color="#000099">eoReduce</font></b>: <b><font color="#FF0000">interface</font></b><br>The abstract class for reducing procedures is the functor class<font color="#009900">eoReduce</font>,and the interface for its <tt><font color="#993300">operator()</font></tt>is<center><p><b><tt><font color="#993300">void operator()(eoPop&lt;EOT>&amp; _parents,unsigned int new_size)</font></tt></b></center><p>which you could have guessed from the inheritance tree for class <b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/classeo_reduce.html">eoReduce</a></font></font></b>,as you see there that <font color="#009900">eoReduce</font> derives from<br><tt><font color="#993300">class eoBF&lt;eoPop&lt;EOT>&amp;, unsignedint, void></font></tt>.<br>An <font color="#009900">eoReduce</font> shoud take a<font color="#FF6600">population</font> and shrink it to the required size.<br><hr WIDTH="50%"><br><b><font color="#000099">eoReduce</font></b>: <b><font color="#FF0000">instances</font></b><br>Available <font color="#FF6600">instances of eoReduce</font> are<ul><li><b><tt><font color="#009900">eoTruncate</font></tt></b>, deterministicallykills the worse individuals, keeping only the required number. It startsby sorting teh populations, and hence does <font color="#FF6600">modifyits order</font>.</li><li><b><tt><font color="#009900">eoLinearTruncate</font></tt></b>, deterministicallykills the worse individuals, keeping only the required number. It doesso by repeatedly removing the worsr individual. Hence does <font color="#FF6600">notmodify its order</font>, but takes longer time than <b><tt><font color="#009900">eoTruncate</font></tt></b>in case of many offspring.</li><li><b><tt><font color="#009900">eoEPReduce</font></tt></b>, uses the <a href="#EPtournament">EPstochastic tournament</a> to reduce the population. It requires an additinalargument, the tournament size.</li><li><b><tt><font color="#009900">eoDetTournamentTruncate</font></tt></b> usesinverse deterministic tournament to repeatidly kill one individual untilthe propoer size is reached. As <b><tt><font color="#009900">eoLinearTruncate</font></tt></b>,it might take some time in the case of many offspring. It requires thesize of the tournament (<b><tt><font color="#993300">unsigned int</font></tt></b>)as parameter in the constructor (default is 2).</li><li><b><tt><font color="#009900">eoStochTournamentruncate</font></tt></b>&nbsp;uses inverse stochastic tournament to repeatidly kill individuals fromthe population. It requires the rate of the tournament (<b><tt><font color="#993300">double</font></tt></b>)as parameter in the constructor (default is 0.75).</li></ul><hr WIDTH="100%"><br><a NAME="howmany"></a><b><font color="#000099"><font size=+2>eoHowMany:Choosing a number of individuals</font></font></b><p>Many classes in selection/replacement procedures will handle a numberof individuals that may either be fixed or be related to some argument-populationsize.<br>Of course, it is possible to write different classes that will onlydiffer by the way they compute the number of individuals they have to treat,as it is done for selectors with the two classes <font color="#009900">eoSelectPerc</font>and <font color="#009900">eoSelectNumber</font> (it could also have beenpossible to have some pure abstrat class and implement the computationof the number of individuals to treat in some derived classes).<br>However, the class <b><tt><font color="#993300">eoHowMany</font></tt></b>allows one to handle in a single class three different behaviors when givena poopulatio size as argument:<ul><li>return a given rate of the argument population size</li><li>return an absolute (unsigned) integer, whatever the argument populationsize</li><li>return the argument population size minus a given number</li></ul><hr WIDTH="50%"><br><b><font color="#000099">eoHowMany</font></b>: <b><font color="#FF0000">interface</font></b><br>The class interface for its <tt><font color="#993300">operator()</font></tt>is<center><p><b><tt><font color="#993300">unsigned int operator()(unsigned int _pop_size)</font></tt></b></center><p>which you could have guessed from the inheritance tree for class <b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/classeo_how_many.html">eoHowMany</a></font></font></b>,as you see there that <b><tt><font color="#993300">eoHowMany</font></tt></b>derives from<br><tt><font color="#993300">class eoUF&lt;unsigned int, unsigned int></font></tt>.<p>It has 3 possible constructors, that determine its behavior:<ul><li><b><tt><font color="#993300">eoHowMany(double _rate, bool _interpret_as_rate= true)</font></tt></b> where <b><tt><font color="#993300">_rate</font></tt></b>is by default the fixed rate of behavior 1 above. However, if the booleansecond argument is false, the rate is transformed into a positive integer,and is used for behavior 2 above</li><li><b><tt><font color="#993300">eoHowMany(int _combien)</font></tt></b>: if<b><tt><font color="#993300">_combien</font></tt></b>is positive, it is the absolute number of behavior 2 above, and if <b><tt><font color="#993300">_combien</font></tt></b>is negative, its absolute value is used to decrease the argument populationin behavior 3 above</li><li><b><tt><font color="#993300">eoHowMany(unsigned int _combien)</font></tt></b>:<b><tt><font color="#993300">_combien</font></tt></b>(positive!)&nbsp; is the absolute number of behavior 2 above. <b><font color="#FF6600">Note</font></b>that this constructor is mandatory to avoid ambiguity, as an unsigned intcan be casted to either an int or a double.</li></ul>It is used in <font color="#009900">eoSelectMany</font> (which supersedes<font color="#009900">eoSelectPerc</font>and <font color="#009900">eoSelectNumber</font>, but they are left therefor tutorial reasons!) as well as in many <a href="#reduce">truncation</a>methods, and it is used a lot in the eoGeneralReplacement construct.<p><hr WIDTH="100%"><br><a NAME="SAD"></a><b><font color="#000099"><font size=+2>Survive andDie</font></font></b><br>This class is highly politically incorrect: it implements strong elitismand eugenism :-)<br>It starts by killing the worse individuals from the source argument,then appends the best ones to the destination argument and removes themfrom the source argument. It is used in <b><tt><a href="#SADreplacement">eoSurviveAndDieReplacement</a></tt></b>,where the same dest is used successively for the parents and the offspring.<p><b><font color="#000099">eoSurviveAndDie</font></b>: <b><font color="#FF0000">interface</font></b><br>The class interface for its <tt><font color="#993300">operator()</font></tt>is<center><p><b><tt><font color="#993300">void operator()(eoPop&lt;EOT>&amp; _source,eoPop&lt;EOT>&amp; _dest)</font></tt></b></center><p>which you could have guessed from the inheritance tree for class <b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/classeo_survive_and_die.html">eoSurviveAndDie</a></font></font></b>,as you see there that <b><tt><font color="#993300">eoSurviveAndDie</font></tt></b>derives from <tt><font color="#993300">class eoBF&lt;eoPop&lt;EOT>&amp;,eoPop&lt;EOT>&amp;, void></font></tt>.<p>Its constructor takes 3 argumenrts:<center><p><b><tt><font color="#993300">eoHowMany(double _survive, double _die,bool _interpret_as_rate = true)</font></tt></b></center><p>to indicate how many (or what proportion, according to <b><tt><font color="#993300">_interpret_as_rate</font></tt></b>)of the source should be copied to the dest population, and how many (orwhat proportion, according to <b><tt><font color="#993300">_interpret_as_rate</font></tt></b>)&nbsp;should be erased from the source.<p><hr WIDTH="100%"><b><font color="#CC0000">Local: </font></b><a href="#introduction">Introduction</a>&nbsp;- <a href="#selection">Selection</a> - <a href="#replacement">Replacement</a>- <a href="#general">General Replacement</a> - <a href="#popular">Popularevolution engines</a> - <a href="#tournament">Tournaments</a> - <a href="#merge">Merge</a>- <a href="#reduce">Reduce</a> - <a href="#howmany">HowMany</a> - <a href="#SAD">SurviveAndDie</a><br><hr WIDTH="100%"><br><b><font color="#CC0000">General: </font></b><a href="eoTopDown.html">Algorithm-Based</a>- <a href="eoBottomUp.html">Component-Based</a> - <a href="eoProgramming.html">Programminghints</a> - <b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/index.html">EOdocumentation</a></font></font></b><hr WIDTH="100%"><address><a href="mailto:Marc.Schoenauer@inria.fr">Marc Schoenauer</a></address><br><!-- Created: Mon Oct 30 07:27:13 CET 2000 --><!-- hhmts start -->Lastmodified: Tue. Jan. 9 2001&nbsp;<!-- hhmts end --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -