rm problems from mo.h

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2658 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
liefooga 2012-01-18 15:54:03 +00:00
commit 767073a51d
4 changed files with 39 additions and 27 deletions

View file

@ -183,13 +183,13 @@
#include <problems/permutation/moTwoOptExNeighbor.h> #include <problems/permutation/moTwoOptExNeighbor.h>
#include <problems/permutation/moTwoOptExNeighborhood.h> #include <problems/permutation/moTwoOptExNeighborhood.h>
#include <problems/eval/moMaxSATincrEval.h> //#include <problems/eval/moMaxSATincrEval.h>
#include <problems/eval/moOneMaxIncrEval.h> //#include <problems/eval/moOneMaxIncrEval.h>
#include <problems/eval/moQAPIncrEval.h> //#include <problems/eval/moQAPIncrEval.h>
#include <problems/eval/moRoyalRoadIncrEval.h> //#include <problems/eval/moRoyalRoadIncrEval.h>
#include <problems/eval/moUBQPSimpleIncrEval.h> //#include <problems/eval/moUBQPSimpleIncrEval.h>
#include <problems/eval/moUBQPdoubleIncrEvaluation.h> //#include <problems/eval/moUBQPdoubleIncrEvaluation.h>
#include <problems/eval/moUBQPBitsIncrEval.h> //#include <problems/eval/moUBQPBitsIncrEval.h>
#include <sampling/moAdaptiveWalkSampling.h> #include <sampling/moAdaptiveWalkSampling.h>

View file

@ -135,8 +135,10 @@ protected:
unsigned int i=0; unsigned int i=0;
while (!res && i < _pop.size()){ while (!res && i < _pop.size()){
res = (_pop[i].flag() != 1); res = (_pop[i].flag() != 1);
i++; i++;
} }
//if (res==false)
//std::cout << "[Natural stop]" << std::endl;
return res; return res;
} }
} naturalContinuator; } naturalContinuator;

View file

@ -111,9 +111,10 @@ public:
result = insert(_moeo.objectiveVector()); result = insert(_moeo.objectiveVector());
if (result) if (result)
{ {
if(size() < maxSize){ if(size() < maxSize)
// if yes, insert it and recompute fitness value of MOEOT and its neighbors {
insert(hint,_moeo); // if yes, insert it and recompute fitness value of MOEOT and its neighbors
insert(hint, _moeo);
if(size() > 2) if(size() > 2)
{ {
//general case //general case
@ -131,7 +132,8 @@ public:
} }
} }
} }
else{ else
{
result = filter(_moeo); result = filter(_moeo);
} }
} }
@ -198,7 +200,8 @@ public:
/** /**
* print objective vector and fitness value of the archive * print objective vector and fitness value of the archive
*/ */
void print(){ void print()
{
Iterator it = begin(); Iterator it = begin();
while(it!=end()) while(it!=end())
{ {
@ -210,7 +213,7 @@ public:
protected: protected:
/** Size max of the archive*/ /** size max of the archive */
unsigned int maxSize; unsigned int maxSize;
/** fitness assigned to the first and the last solution in the archive */ /** fitness assigned to the first and the last solution in the archive */
double maxValue; double maxValue;
@ -312,7 +315,8 @@ protected:
} }
} }
double computeTmp(const ObjectiveVector & _objVec, int _where){ double computeTmp(const ObjectiveVector & _objVec, int _where)
{
double res, tmp; double res, tmp;
if(hint==begin() || hint==end()) if(hint==begin() || hint==end())
res=maxValue; res=maxValue;
@ -345,7 +349,8 @@ protected:
} }
void filterbis(){ void filterbis()
{
Iterator it, itd; Iterator it, itd;
//used to find sol with minimum fitness value //used to find sol with minimum fitness value
double minFit = maxValue; double minFit = maxValue;
@ -380,21 +385,24 @@ protected:
bool res; bool res;
double x, y, pred, succ, tmp=0; double x, y, pred, succ, tmp=0;
if(hint==begin() || hint==end()){ if(hint==begin() || hint==end())
{
insert(hint, _moeo); insert(hint, _moeo);
hint--; hint--;
computeFitness(hint); computeFitness(hint);
filterbis(); filterbis();
res=true; res=true;
} }
else{ else
{
//compute fitness tmp //compute fitness tmp
tmp=computeTmp(_moeo.objectiveVector(), 0); tmp=computeTmp(_moeo.objectiveVector(), 0);
hint--; hint--;
pred=computeTmp(_moeo.objectiveVector(), -1); pred=computeTmp(_moeo.objectiveVector(), -1);
hint++; hint++;
succ=computeTmp(_moeo.objectiveVector(), 1); succ=computeTmp(_moeo.objectiveVector(), 1);
if(tmp > succ || tmp>pred){ if(tmp>succ || tmp>pred)
{
insert(hint, _moeo); insert(hint, _moeo);
hint--; hint--;
//ici faudrait utiliser les valeurs qu'on vient de calculer pour les affecter direct (faire attention à ou on se trouve) //ici faudrait utiliser les valeurs qu'on vient de calculer pour les affecter direct (faire attention à ou on se trouve)
@ -402,7 +410,8 @@ protected:
filterbis(); filterbis();
res=true; res=true;
} }
else{ else
{
Iterator it; Iterator it;
double minFit = maxValue; double minFit = maxValue;
for(it=begin(); it!=end(); it++) for(it=begin(); it!=end(); it++)
@ -412,11 +421,13 @@ protected:
minFit = it->fitness(); minFit = it->fitness();
} }
} }
if(tmp<=minFit){ if (tmp<=minFit)
res=false; {
res = false;
} }
else{ else
//REDONDANT arranger le code {
// REDONDANT arranger le code
insert(hint, _moeo); insert(hint, _moeo);
hint--; hint--;
//ici faudrait utiliser les valeurs qu'on vient de calculer pour les affecter direct (faire attention à ou on se trouve) //ici faudrait utiliser les valeurs qu'on vient de calculer pour les affecter direct (faire attention à ou on se trouve)
@ -426,10 +437,9 @@ protected:
} }
} }
} }
return res; return res;
} }
}; };
#endif /*MOEO2DMINHYPERVOLUMEARCHIVE_H_ */ #endif /* MOEO2DMINHYPERVOLUMEARCHIVE_H_ */

View file

@ -57,7 +57,7 @@
#include <algo/moeoSPEA2.h> #include <algo/moeoSPEA2.h>
#include <algo/moeoUnifiedDominanceBasedLS.h> #include <algo/moeoUnifiedDominanceBasedLS.h>
#include <archive/moeo2DMinHypervolumeArchive.h> //#include <archive/moeo2DMinHypervolumeArchive.h>
#include <archive/moeoArchive.h> #include <archive/moeoArchive.h>
#include <archive/moeoBoundedArchive.h> #include <archive/moeoBoundedArchive.h>
#include <archive/moeoEpsilonHyperboxArchive.h> #include <archive/moeoEpsilonHyperboxArchive.h>