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:
evomarc 2001-02-09 05:09:26 +00:00
commit 415b419671
60 changed files with 2034 additions and 940 deletions

View file

@ -13,13 +13,12 @@
// the general include for eo
#include <eo>
#include <ga.h>
// REPRESENTATION
//-----------------------------------------------------------------------------
// Include the corresponding file
#include <ga.h> // bitstring representation & operators
// define your individuals
typedef eoBin<double> Indi; // A bitstring with fitness double
typedef eoBit<double> Indi; // A bitstring with fitness double
// EVALFUNC
//-----------------------------------------------------------------------------
@ -112,11 +111,11 @@ void main_function(int argc, char **argv)
//////////////////////////////////////
// CROSSOVER
// 1-point crossover for bitstring
eoBinCrossover<Indi> xover1;
eo1PtBitXover<Indi> xover1;
// uniform crossover for bitstring
eoBinUxOver<Indi> xoverU;
eoUBitXover<Indi> xoverU;
// 2-pots xover
eoBinNxOver<Indi> xover2(2);
eoNPtsBitXover<Indi> xover2(2);
// Combine them with relative rates
eoPropCombinedQuadOp<Indi> xover(xover1, onePointRate);
xover.add(xoverU, URate);
@ -124,7 +123,7 @@ void main_function(int argc, char **argv)
// MUTATION
// standard bit-flip mutation for bitstring
eoBinMutation<Indi> mutationBitFlip(P_MUT_PER_BIT);
eoBitMutation<Indi> mutationBitFlip(P_MUT_PER_BIT);
// mutate exactly 1 bit per individual
eoDetBitFlip<Indi> mutationOneBit;
// Combine them with relative rates