git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1574 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
6fa3fef55b
commit
224e52b4c7
2 changed files with 11 additions and 4 deletions
|
|
@ -13,16 +13,21 @@ class eoAmeliorationContinue: public eoContinue<EOT>
|
|||
{
|
||||
public:
|
||||
|
||||
eoAmeliorationContinue(moeoDMLSArchive<EOT> & _arch, unsigned int _maxGen) : arch(_arch), maxGen(_maxGen), counter(0){}
|
||||
eoAmeliorationContinue(moeoDMLSArchive<EOT> & _arch, unsigned int _neighborhoodSize) : arch(_arch),maxGen(_neighborhoodSize), neighborhoodSize(_neighborhoodSize), counter(0){}
|
||||
|
||||
// _pop must be an archive
|
||||
virtual bool operator() (const eoPop<EOT> & _pop)
|
||||
{
|
||||
bool res;
|
||||
maxGen=arch.size() * neighborhoodSize;
|
||||
if(arch.modified())
|
||||
counter=0;
|
||||
else
|
||||
counter++;
|
||||
return (counter < maxGen);
|
||||
res = (counter < maxGen);
|
||||
if(!res)
|
||||
counter=0;
|
||||
return res;
|
||||
}
|
||||
|
||||
virtual std::string className(void) const
|
||||
|
|
@ -34,6 +39,7 @@ private:
|
|||
|
||||
moeoDMLSArchive <EOT> & arch;
|
||||
unsigned int maxGen;
|
||||
unsigned int neighborhoodSize;
|
||||
unsigned int counter;
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -57,12 +57,13 @@ public:
|
|||
moeoRestartLS(
|
||||
eoInit < MOEOT > & _init,
|
||||
eoEvalFunc < MOEOT > & _eval,
|
||||
eoContinue < MOEOT > & _continuator,
|
||||
eoContinue < MOEOT > & _continuator1,
|
||||
eoContinue < MOEOT > & _continuator2,
|
||||
moeoPopNeighborhoodExplorer < Move > & _explorer,
|
||||
moeoUnvisitedSelect < MOEOT > & _select,
|
||||
moeoArchive < MOEOT > & _globalArchive,
|
||||
std::string _fileName) :
|
||||
init(_init), eval(_eval), continuator(_continuator), ls(continuator, _eval, internalArchive, _explorer, _select), globalArchive(_globalArchive), fileName(_fileName), count(0) {}
|
||||
init(_init), eval(_eval), continuator(_continuator1), ls(_continuator2, _eval, internalArchive, _explorer, _select), globalArchive(_globalArchive), fileName(_fileName), count(0) {}
|
||||
|
||||
|
||||
virtual void operator()(eoPop<MOEOT> & _pop)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue