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

📄 make_genotype_onemax.html

📁 这是linux下的进化计算的源代码。 === === === === === === === === === === === ===== check latest news at http:
💻 HTML
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head>   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">   <meta name="GENERATOR" content="cpp2html Marc Schoenauer">   <title>Templates/make_genotype_OneMax.h</title></head><body text="#000000" bgcolor="#C3C2B4" link="#0000EE" vlink="#551A8B" alink="#FF0000"><a href="eoLesson5.html">Back to Lesson 5</a> - <a href="eoTutorial.html">Tutorialmain page </a>- <a href="eoTopDown.html">Top-Down page</a> - <a href="eoBottomUp.html">Bottom-uppage</a> - <a href="eoProgramming.html">Programming hints</a> - <font face="Arial,Helvetica"><a href="doc/html/index.html">EOdocumentation</a></font><br><hr WIDTH="100%"><!-- -------------- End of header ------------------ --><!-- ----------------------------------------------- --><center><h1><font color="#FF0000">Templates/make_genotype_OneMax.h</font></h1></center>The places where you have to put some code are on <b><font color="#FF6666">pinkbackground</font></b>..Only the the <a href="eoTutorial.html#colors">character colors have the usual meaning</a>.<br>&nbsp;<A NAME="start"></a><table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE ><tr NOSAVE><td NOSAVE><tt><font color="#993300"><b></b>// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-<br><b></b>//-----------------------------------------------------------------------------<br><b></b>// make_genotype.h<br><b></b>// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2001<br><b></b>/* <br>  &nbsp; &nbsp; &nbsp;This library is free software; you can redistribute it and/or<br>  &nbsp; &nbsp; &nbsp;modify it under the terms of the GNU Lesser General Public<br>  &nbsp; &nbsp; &nbsp;License as published by the Free Software Foundation; either<br>  &nbsp; &nbsp; &nbsp;version 2 of the License, or (at your option) any later version.<br>  &nbsp; &nbsp; &nbsp;This library is distributed in the hope that it will be useful,<br>  &nbsp; &nbsp; &nbsp;but WITHOUT ANY WARRANTY; without even the implied warranty of<br>  &nbsp; &nbsp; &nbsp;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  &nbsp;See the GNU<br>  &nbsp; &nbsp; &nbsp;Lesser General Public License for more details.<br>  &nbsp; &nbsp; &nbsp;You should have received a copy of the GNU Lesser General Public<br>  &nbsp; &nbsp; &nbsp;License along with this library; if not, write to the Free Software<br>  &nbsp; &nbsp; &nbsp;Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  &nbsp;02111-1307  &nbsp;USA<br>  &nbsp; &nbsp; &nbsp;Contact: todos@geneura.ugr.es, http://geneura.ugr.es<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Marc.Schoenauer@inria.fr<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mkeijzer@dhi.dk<br> */<br><b></b>//-----------------------------------------------------------------------------<br><b>#ifndef _make_genotype_h</b><br><b>#define _make_genotype_h</b><br><b>#include &lt;eoOneMax.h></b><br><b>#include &lt;eoOneMaxInit.h></b><br><b>  &nbsp;</b>// also need the parser and param includes<br><b>#include &lt;utils/eoParser.h></b><br><b>#include &lt;utils/eoState.h></b><br><b></b>/*<br> * This fuction does the create an eoInit&lt;eoOneMax><br> *<br> * It could be here tempatized only on the fitness, as it can be used <br> * to evolve structures with any fitness.<br> * However, for consistency reasons, it was finally chosen, as in <br> * the rest of EO, to templatize by the full EOT, as this eventually <br> * allows to choose the type of genotype at run time (see in es dir)<br> *<br> * It returns an eoInit&lt;EOT> that can later be used to initialize <br> * the population (see make_pop.h).<br> *<br> * It uses a parser (to get user parameters) and a state (to store the memory)<br> * the last argument is to disambiguate the call upon different instanciations.<br> *<br> * WARNING: that last argument will generally be the result of calling <br> *  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the default ctor of EOT, resulting in most cases in an EOT <br> *  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;that is ***not properly initialized***<br>*/<br></font></tt></td></tr></table><a NAME="representation"></a><table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE ><tr><td><tt><font color="#999900"><b>template &lt;class EOT></b><br><b>eoInit&lt;EOT> & do_make_genotype(eoParser& _parser, eoState& _state, EOT)</b><br><b>{</b><br></font></tt></td></tr></table><table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="FFCCCC" NOSAVE ><tr><td><tt><font color="#999900"><b>  &nbsp;</b>// read any useful parameter here from the parser <br><b>  &nbsp;</b>// the param itself will belong to the parser (as far as memory is concerned)<br><b>  &nbsp;</b>//  &nbsp; &nbsp; &nbsp;paramType & param = _parser.createParam(deafultValue, "Keyword", "Comment to appear in help and status", 'c',"Section of status file").value();<br></font></tt></td></tr></table><table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE ><tr><td><tt><font color="#999900"><b>  &nbsp;</b>// Then built the initializer - a pointer, stored in the eoState<br><b>  &nbsp;eoInit&lt;EOT>* init = new eoOneMaxInit&lt;EOT> </b>/* ( param ) */ ;<b> ;</b><br></font></tt></td></tr></table><table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="FFCCCC" NOSAVE ><tr><td><tt><font color="#999900"><b>  &nbsp;</b>// Eventually by passing the parameters you need<br><b>  &nbsp;//  &nbsp;eoInit&lt;EOT>* init = new eoOneMaxInit&lt;EOT> </b>/* ( param ) */ ;<b> ;</b><br></font></tt></td></tr></table><table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE ><tr><td><tt><font color="#999900"><b>  &nbsp;</b>// store in state<br><b>  &nbsp;_state.storeFunctor(init);</b><br><b>  &nbsp;</b>// and return a reference<br><b>  &nbsp;return *init;</b><br><b>}</b><br><b>#endif</b><br></font></font></font></td></tr></table><hr WIDTH="100%"><a href="eoLesson5.html">Back to Lesson 5</a> - <a href="eoTutorial.html">Tutorialmain page </a>- <a href="eoTopDown.html">Top-Down page</a> - <a href="eoBottomUp.html">Bottom-uppage</a> - <a href="eoProgramming.html">Programming hints</a> - <font face="Arial,Helvetica"><a href="doc/html/index.html">EOdocumentation</a></font><hr><address><a href="mailto:marc.schoenauer@inria.fr">Marc Schoenauer</a></address><br><!-- Created: Nov 2000 --><!-- hhmts start -->Lastmodified: Fri May  3 07:10:52 2002<!-- hhmts end --></body></html>

⌨️ 快捷键说明

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