git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1608 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
jhumeau 2009-09-11 09:19:30 +00:00
commit d34328e5f6

View file

@ -13,22 +13,24 @@ class eoAmeliorationContinue: public eoContinue<EOT>
{ {
public: public:
eoAmeliorationContinue(moeoDMLSArchive<EOT> & _arch, unsigned int _neighborhoodSize, bool _multiply) : arch(_arch),maxGen(_neighborhoodSize), neighborhoodSize(_neighborhoodSize), counter(0), multiply(_multiply){} eoAmeliorationContinue(moeoDMLSArchive<EOT> & _arch, unsigned int _neighborhoodSize, bool _multiply) : arch(_arch),maxGen(_neighborhoodSize), neighborhoodSize(_neighborhoodSize), counter(0){
if(_multiply)
multiply=1;
else
multiply=0;
}
// _pop must be an archive // _pop must be an archive
virtual bool operator() (const eoPop<EOT> & _pop) virtual bool operator() (const eoPop<EOT> & _pop)
{ {
bool res; bool res;
if(multiply){ maxGen=((arch.size()-1) * multiply +1) * neighborhoodSize;
maxGen=arch.size() * neighborhoodSize;
}
else{
maxGen = neighborhoodSize;
}
if(arch.modified()) if(arch.modified())
counter=0; counter=0;
else else
counter++; counter++;
//std::cout << counter << " " << maxGen << std::endl;
res = (counter < maxGen); res = (counter < maxGen);
if(!res) if(!res)
counter=0; counter=0;
@ -46,8 +48,7 @@ private:
unsigned int maxGen; unsigned int maxGen;
unsigned int neighborhoodSize; unsigned int neighborhoodSize;
unsigned int counter; unsigned int counter;
bool multiply; unsigned int multiply;
}; };
#endif #endif