[Paradiseo-help] Problem using eoPropCombinedQuadOp in ParadisEO-EO

Albin Gilles gillesalbin at gmail.com
Jeu 14 Juil 12:02:34 CEST 2011


Hello,

I'm Albin Gilles from University Of Mons (UMons) and i use ParadisEO-EO 
for my master thesis.

Everything is ok and my genetic algorithm developed with ParadisEO-EO 
works very well but when i try to add a second crossover using the 
recommendation of the tutorial and the make_op template comments, i 
receive this error :

----------------------------------------

In file included from 
/home/albin/Projet/Mémoire/Code/src/ExtremalGraphEA.cpp:76:
/home/albin/Projet/Mémoire/Code/src/make_op_ExtremalGraph.h: In function 
‘eoGenOp<EOT>& do_make_op(eoParameterLoader&, eoState&, eoInit<EOT>&)’:

/home/albin/Projet/Mémoire/Code/src/make_op_ExtremalGraph.h:125: error: 
request for member ‘add’ in ‘propXover’, which is of non-class type 
‘eoPropCombinedQuadOp<eoExtremalGraph<eoScalarFitness<double, 
std::less<double> > > >*’

make[2]: *** [src/CMakeFiles/ExtremalGraphEA.dir/ExtremalGraphEA.o] Erreur 1
make[1]: *** [src/CMakeFiles/ExtremalGraphEA.dir/all] Erreur 2
make: *** [all] Erreur 2

----------------------------------------

So, i understand that popXover is not a eoPropCombinedQuadOp but in the 
source code i wrote this :

----------------------------------------

eoQuadOp<Indi> *cross = new eoExtremalGraphQuadCrossover1Point<Indi> /* 
(varType _anyVariable) */;
_state.storeFunctor(cross);

double cross1Rate = _parser.createParam(0.5, "onePtCrossRate", "Relative 
rate for one point crossover", NULL, "Variation Operators").value();

eoPropCombinedQuadOp<Indi> *propXover = new 
eoPropCombinedQuadOp<Indi>(*cross, cross1Rate);

_state.storeFunctor(propXover);

cross = new eoExtremalGraphQuadCrossover2Point<Indi>

_state.storeFunctor(cross);

double cross2Rate = _parser.createParam(0.5, "twoPtCrossRate", "Relative 
rate for two point crossover", NULL, "Variation Operators").value();

propXover.add(*cross, cross2Rate);

----------------------------------------

And when i look in the comments of this generated file i see :

----------------------------------------

/* Uncomment if necessary - and replicate as many time as you need
cross = new eoExtremalGraphSecondCrossover<Indi>(varType _anyVariable);
_state.storeFunctor(cross);
double cross2Rate = _parser.createParam(1.0, "cross2Rate", "Relative 
rate for crossover 2", '2', "Variation Operators").value();
propXover.add(*cross, cross2Rate);
*/

----------------------------------------

I don't see the big difference between my code and this one. I even try 
to uncomment those lines of code and i have the same final results. I 
didn't make any change to eoPropCombinedQuadOp.

So... What's wrong? I didn't have any compilation error when compiling 
ParadisEO-EO. It's not a big deal because my thesis is finished but i 
wanted to try the recommendation of El-Ghazali Talbi in his book on the 
Metaheuristics when he says that the use of several crossover gives 
generally better results than use only one.

Thanks you very much for your time,
Albin Gilles.




Plus d'informations sur la liste de diffusion Paradiseo-help