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
|
|
@ -20,7 +20,7 @@
|
|||
// 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
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** a simple fitness function that computes the number of ones of a bitstring
|
||||
|
|
@ -120,9 +120,9 @@ void main_function(int argc, char **argv)
|
|||
// The variation operators
|
||||
//////////////////////////////////////
|
||||
// standard bit-flip mutation for bitstring
|
||||
eoBinMutation<Indi> mutation(P_MUT_PER_BIT);
|
||||
eoBitMutation<Indi> mutation(P_MUT_PER_BIT);
|
||||
// 1-point mutation for bitstring
|
||||
eoBinCrossover<Indi> xover;
|
||||
eo1PtBitXover<Indi> xover;
|
||||
|
||||
/////////////////////////////////////////
|
||||
// the algorithm
|
||||
|
|
|
|||
Reference in a new issue