The BIG change of general operator interface
I also changed
- the eoQuadratic into eoQuad (as dicussed with Maarten)
- the eoBin into eoBit, with more appropriate names for the "binary"
operators (that can be unary!) as no one protested when I posted on
eodev list
This commit is contained in:
parent
1b681e4e0d
commit
415b419671
60 changed files with 2034 additions and 940 deletions
|
|
@ -63,11 +63,8 @@ the number of ones of a bitstring</font></tt>
|
|||
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" NOSAVE >
|
||||
<tr>
|
||||
<td><tt><font color="#999900">//-----------------------------------------------------------------------------</font></tt>
|
||||
<br><tt><font color="#999900">// Include the corresponding file</font></tt>
|
||||
<br><tt><font color="#999900"><b>#include <ga.h></b>
|
||||
// bitstring representation & operators</font></tt>
|
||||
<br><tt><font color="#999900">// define your genotype and fitness types</font></tt>
|
||||
<br><b><tt><font color="#999900">typedef eoBin<double> Indi;</font></tt></b></td>
|
||||
<br><b><tt><font color="#999900">typedef eoBit<double> Indi;</font></tt></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
<a NAME="general"></a>
|
||||
|
|
@ -314,6 +311,7 @@ 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>
|
||||
|
|
@ -346,11 +344,11 @@ replace; </font></tt></b></td>
|
|||
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="100%" BGCOLOR="#FFCCFF" NOSAVE >
|
||||
<tr>
|
||||
<td><tt><font color="#993399"><b> </b>// 1-point crossover for bitstring</font></tt>
|
||||
<br><b><tt><font color="#993399"> eoBinCrossover<Indi> xover1;</font></tt></b>
|
||||
<br><b><tt><font color="#993399"> eo1PtBitXover<Indi> xover1;</font></tt></b>
|
||||
<br><tt><font color="#993399"><b> </b>// uniform crossover for bitstring</font></tt>
|
||||
<br><b><tt><font color="#993399"> eoBinUxOver<Indi> xoverU;</font></tt></b>
|
||||
<br><b><tt><font color="#993399"> eoUBitXover<Indi> xoverU;</font></tt></b>
|
||||
<br><tt><font color="#993399"><b> </b>// 2-pots xover</font></tt>
|
||||
<br><b><tt><font color="#993399"> eoBinNxOver<Indi> xover2(2);</font></tt></b>
|
||||
<br><b><tt><font color="#993399"> eoNPtsBitXover<Indi> xover2(2);</font></tt></b>
|
||||
<br><tt><font color="#993399"><b> </b>// Combine them with relative
|
||||
rates</font></tt>
|
||||
<br><b><tt><font color="#993399"> eoPropCombinedQuadOp<Indi> xover(xover1,
|
||||
|
|
@ -365,7 +363,7 @@ true);</font></tt></b></td>
|
|||
<tr>
|
||||
<td><tt><font color="#993399"><b> </b>// standard bit-flip mutation
|
||||
for bitstring</font></tt>
|
||||
<br><b><tt><font color="#993399"> eoBinMutation<Indi> mutationBitFlip(pMutPerBit);</font></tt></b>
|
||||
<br><b><tt><font color="#993399"> eoBitMutation<Indi> mutationBitFlip(pMutPerBit);</font></tt></b>
|
||||
<br><tt><font color="#993399"><b> </b>// mutate exactly 1 bit per
|
||||
individual</font></tt>
|
||||
<br><b><tt><font color="#993399"> eoDetBitFlip<Indi> mutationOneBit; </font></tt></b>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue