paradiseo/deprecated/eo/tutorial/html/eoOneMaxMutation.html

168 lines
5.7 KiB
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>eoOneMaxMutation.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">Tutorial
main page </a>- <a href="eoTopDown.html">Top-Down page</a> - <a href="eoBottomUp.html">Bottom-up
page</a> - <a href="eoProgramming.html">Programming hints</a> - <font face="Arial,Helvetica"><a href="doc/html/index.html">EO
documentation</a></font>
<br>
<hr WIDTH="100%"><!-- -------------- End of header ------------------ --><!-- ----------------------------------------------- -->
<center>
<h1>
<font color="#FF0000">eoOneMaxMutation.h</font></h1></center>
The places where you have to put some code are on pink background.
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>/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</b><br>
<b>The above line is useful in Emacs-like editors</b><br>
<b> */</b><br>
<b>/*</b><br>
<b>Template for simple mutation operators</b><br>
<b>======================================</b><br>
<b>*/</b><br>
<b>#ifndef eoOneMaxMutation_H</b><br>
<b>#define eoOneMaxMutation_H</b><br>
<b>#include &lt;eoOp.h></b><br>
<b>/** </b><br>
<b> * &nbsp;Always write a comment in this format before class definition</b><br>
<b> * &nbsp;if you want the class to be documented by Doxygen</b><br>
<b> *</b><br>
<b> * THere is NO ASSUMPTION on the class GenoypeT.</b><br>
<b> * In particular, it does not need to derive from EO</b><br>
<b> */</b><br>
</font></tt>
</td>
</tr>
</table>
<a NAME="mutation"></a><table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
<b>template&lt;class GenotypeT> </b><br>
<b>class eoOneMaxMutation: public eoMonOp&lt;GenotypeT></b><br>
<b>{</b><br>
<b>public:</b><br>
<b> &nbsp;/**</b><br>
<b> &nbsp; &nbsp;* Ctor - no requirement</b><br>
<b> &nbsp; &nbsp;*/</b><br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="FFCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
// START eventually add or modify the anyVariable argument<br>
<b> &nbsp;eoOneMaxMutation()</b><br>
<b> &nbsp;</b>// &nbsp;eoOneMaxMutation( varType &nbsp;_anyVariable) : anyVariable(_anyVariable) <br>
// END eventually add or modify the anyVariable argument<br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
<b> &nbsp;{</b><br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="FFCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
<b> &nbsp; &nbsp; &nbsp;</b>// START Code of Ctor of an eoOneMaxEvalFunc object<br>
<b> &nbsp; &nbsp; &nbsp;</b>// END &nbsp; &nbsp;Code of Ctor of an eoOneMaxEvalFunc object<br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
<b> &nbsp;}</b><br>
<b> &nbsp;</b>/// The class name. Used to display statistics<br>
<b> &nbsp;string className() const { return "eoOneMaxMutation"; }</b><br>
<b> &nbsp;/**</b><br>
<b> &nbsp; &nbsp;* modifies the parent</b><br>
<b> &nbsp; &nbsp;* @param _genotype The parent genotype (will be modified)</b><br>
<b> &nbsp; &nbsp;*/</b><br>
<b> &nbsp;bool operator()(GenotypeT & _genotype) </b><br>
<b> &nbsp;{</b><br>
<b> &nbsp; &nbsp; &nbsp;bool isModified;</b><br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="FFCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
<b> &nbsp; &nbsp; &nbsp;</b>// START code for mutation of the _genotype object<br>
<b> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/** Requirement</b><br>
<b>* if (_genotype has been modified)</b><br>
<b>* &nbsp; &nbsp; &nbsp; &nbsp;isModified = true;</b><br>
<b>* else</b><br>
<b>* &nbsp; &nbsp; &nbsp; &nbsp;isModified = false;</b><br>
<b>*/</b><br>
<b> &nbsp; &nbsp; &nbsp;return isModified;</b><br>
<b> &nbsp; &nbsp; &nbsp;</b>// END code for mutation of the _genotype object<br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
<b> &nbsp;}</b><br>
<b>private:</b><br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="FFCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
// START Private data of an eoOneMaxMutation object<br>
<b> &nbsp;</b>// &nbsp;varType anyVariable; &nbsp; &nbsp;// for example ...<br>
// END &nbsp; &nbsp;Private data of an eoOneMaxMutation object<br>
</font></tt>
</td>
</tr>
</table>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" NOSAVE >
<tr>
<td>
<tt><font color="#993399">
<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">Tutorial
main page </a>- <a href="eoTopDown.html">Top-Down page</a> - <a href="eoBottomUp.html">Bottom-up
page</a> - <a href="eoProgramming.html">Programming hints</a> - <font face="Arial,Helvetica"><a href="doc/html/index.html">EO
documentation</a></font>
<hr>
<address>
<a href="mailto:marc.schoenauer@inria.fr">Marc Schoenauer</a></address>
<br><!-- Created: Nov 2000 --><!-- hhmts start -->Last
modified: Wed May 1 07:18:00 2002
<!-- hhmts end -->
</body>
</html>