Fixing a small glitch that was giving wrong clues to newcomers ...
Thanks to Christophe-Marie Duquesne for the post
This commit is contained in:
parent
8c40a38cdc
commit
893204f8f1
1 changed files with 5 additions and 5 deletions
|
|
@ -36,13 +36,13 @@ the fitness: an EO object is some object which has a fitness of some type
|
|||
F that can be anything. The definition for that is (see <font face="Arial,Helvetica"><a href="../../doc/html/_e_o_8h-source.html">EO.h</a></font>)
|
||||
<p><b><tt><font color="#999900">template<class F> class EO</font></tt></b>
|
||||
<p>The idea is that, later in your code, you can define a class as follows
|
||||
(see for instance <a href="../../doc/html/eo_bit_8h-source.html">eoBit.h</a>).
|
||||
<p><b><tt><font color="#999900">template<class F> class eoBit : public
|
||||
(see for instance <a href="../../doc/html/eoOneMax.html">eoOneMax.h</a> - or check <a href="eoLesson5.html">Lesson 5</a> for more details).
|
||||
<p><b><tt><font color="#999900">template<class F> class eoOneMax : public
|
||||
EO<F></font></tt></b>
|
||||
<br><b><tt><font color="#999900">{ ... code for eoBit };</font></tt></b>
|
||||
<br><b><tt><font color="#999900">{ ... code for eoOneMax };</font></tt></b>
|
||||
<p>and then use it in your application as
|
||||
<p><b><tt><font color="#999900">eoBit<double> myeoBit;</font></tt></b>
|
||||
<p>declares an object of type eoBin which has as fitness a double.
|
||||
<p><b><tt><font color="#999900">eoOneMax<double> myeoBit;</font></tt></b>
|
||||
<p>declares an object of type eoOneMax which has as fitness a double.
|
||||
<p>Whereas the <b><font color="#FF6600">advantages</font></b>
|
||||
are obvious (writing generic reusable code instead
|
||||
of having to rewrite the same pieces of code for different types), there
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue