Modified all init sequences in Lesson2 and Lesson3 - and all corresponding
files in html dir - after the return of eoRndGenerators and subsequent modifications of eoInit
This commit is contained in:
parent
a79075f673
commit
72b6692f9b
9 changed files with 24 additions and 23 deletions
|
|
@ -162,9 +162,9 @@ The actual code is in boldface and the comment in normal face.
|
|||
<b> </b>////////////////////////////////<br>
|
||||
<b> </b>// Initilisation of population<br>
|
||||
<b> </b>////////////////////////////////<br>
|
||||
<b> </b>// based on boolean_generator class (see utils/rnd_generator.h)<br>
|
||||
<b> eoInitFixedLength<Indi, boolean_generator> </b><br>
|
||||
<b> random(VEC_SIZE, boolean_generator());</b><br>
|
||||
<b> </b>// based on eoUniformGenerator class (see utils/eoRndGenerators.h)<br>
|
||||
<b> eoUniformGenerator<bool> uGen;</b><br>
|
||||
<b> eoInitFixedLength<Indi> random(VEC_SIZE, uGen);</b><br>
|
||||
<b> </b>// Initialization of the population<br>
|
||||
<b> eoPop<Indi> pop(POP_SIZE, random);</b><br>
|
||||
<b> </b>// and evaluate it in one line<br>
|
||||
|
|
|
|||
|
|
@ -270,11 +270,11 @@ rng.reseed(seed);</font></tt></b>
|
|||
<br><tt><font color="#993399"><b> </b>//
|
||||
a Indi random initializer</font></tt>
|
||||
<br><tt><font color="#993399"><b> </b>//
|
||||
based on boolean_generator class (see utils/rnd_generator.h)</font></tt>
|
||||
<br><b><tt><font color="#993399">
|
||||
eoInitFixedLength<Indi, boolean_generator> </font></tt></b>
|
||||
<br><b><tt><font color="#993399">
|
||||
random(vecSize, boolean_generator());</font></tt></b>
|
||||
based on eoUniformGenerator class (see utils/eoRndGenerators.h)</font></tt>
|
||||
<br><b><tt><font color="#993399"> eoUniformGenerator<bool>
|
||||
uGen;</font></tt></b>
|
||||
<br><b><tt><font color="#993399"> eoInitFixedLength<Indi>
|
||||
random(vecSize, uGen);</font></tt></b>
|
||||
<br><tt><font color="#993399"><b> </b>//
|
||||
Init pop from the randomizer: need to use the append function</font></tt>
|
||||
<br><b><tt><font color="#993399">
|
||||
|
|
@ -284,7 +284,7 @@ and evaluate pop (STL syntax) </font></tt>
|
|||
<br><b><tt><font color="#993399">
|
||||
apply<Indi>(eval, pop);</font></tt></b>
|
||||
<br><tt><font color="#993399"><b> } </b>// end
|
||||
of initializatio of the population</font></tt></td>
|
||||
of initialization of the population</font></tt></td>
|
||||
</tr>
|
||||
</table>
|
||||
<a NAME="output"></a>
|
||||
|
|
@ -311,7 +311,6 @@ of initializatio of the population</font></tt></td>
|
|||
<tr>
|
||||
<td><tt><font color="#009900"><b> </b>// The robust tournament selection</font></tt>
|
||||
<br><tt><font color="#009900"><b> eoDetTournamentSelect<Indi> selectOne(tSize);
|
||||
|
||||
</b>// tSize in [2,POPSIZE]</font></tt>
|
||||
<br><tt><font color="#009900"><b> </b>// is now encapsulated in a
|
||||
eoSelectPerc (entage)</font></tt>
|
||||
|
|
|
|||
Reference in a new issue