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

This commit is contained in:
jhumeau 2009-03-17 09:29:49 +00:00
commit 57007ca1e4
6 changed files with 92 additions and 206 deletions

View file

@ -104,6 +104,7 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${MOEO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(/home/humeau/workspace/MOLS/src2)
INCLUDE_DIRECTORIES(/home/humeau/workspace/MOLS/test)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
######################################################################################

View file

@ -0,0 +1,87 @@
#include <eo>
#include <mo>
#include <moeo>
class ObjectiveVectorTraits : public moeoObjectiveVectorTraits
{
public:
static bool minimizing (int i)
{
return true;
}
static bool maximizing (int i)
{
return false;
}
static unsigned int nObjectives ()
{
return 2;
}
};
typedef moeoRealObjectiveVector < ObjectiveVectorTraits > ObjectiveVector;
typedef MOEO < ObjectiveVector, double, double > Solution;
class testMove : public moMove < Solution >
{
public :
void operator () (Solution & _solution)
{
Solution sol=_solution;
counter++;
}
void setCounter(unsigned int i){
counter=i;
}
unsigned int getCounter(){
return counter;
}
private:
unsigned int counter;
} ;
class testMoveInit : public moMoveInit <testMove>
{
public :
void operator () (testMove & _move, const Solution & _solution)
{
_move.setCounter(0);
const Solution sol(_solution);
}
} ;
class testMoveNext : public moNextMove <testMove>
{
public :
testMoveNext(unsigned int _counter=0):counter(_counter){};
bool operator () (testMove & _move, const Solution & _solution)
{
testMove move(_move);
const Solution sol(_solution);
return _move.getCounter() < 5;
}
private:
unsigned int counter;
} ;
class testMoveIncrEval : public moMoveIncrEval <testMove, ObjectiveVector>
{
public :
ObjectiveVector operator () (const testMove & _move, const Solution & _solution)
{
ObjectiveVector objVec= _solution.objectiveVector();
objVec[0]+=2;
objVec[1]+=2;
return objVec;
}
} ;

View file

@ -45,91 +45,9 @@
#include <set>
#include <iostream>
#include <moeoExhaustiveNeighborhoodExplorer.h>
#include <moeoTestClass.h>
//-----------------------------------------------------------------------------
class ObjectiveVectorTraits : public moeoObjectiveVectorTraits
{
public:
static bool minimizing (int i)
{
return true;
}
static bool maximizing (int i)
{
return false;
}
static unsigned int nObjectives ()
{
return 2;
}
};
typedef moeoRealObjectiveVector < ObjectiveVectorTraits > ObjectiveVector;
typedef MOEO < ObjectiveVector, double, double > Solution;
class testMove : public moMove < Solution >
{
public :
void operator () (Solution & _solution)
{
Solution sol=_solution;
counter++;
}
void setCounter(unsigned int i){
counter=i;
}
unsigned int getCounter(){
return counter;
}
private:
unsigned int counter;
} ;
class testMoveInit : public moMoveInit <testMove>
{
public :
void operator () (testMove & _move, const Solution & _solution)
{
_move.setCounter(0);
const Solution sol(_solution);
}
} ;
class testMoveNext : public moNextMove <testMove>
{
public :
testMoveNext(unsigned int _counter=0):counter(_counter){};
bool operator () (testMove & _move, const Solution & _solution)
{
testMove move(_move);
const Solution sol(_solution);
return _move.getCounter() < 5;
}
private:
unsigned int counter;
} ;
class testMoveIncrEval : public moMoveIncrEval <testMove, ObjectiveVector>
{
public :
ObjectiveVector operator () (const testMove & _move, const Solution & _solution)
{
ObjectiveVector objVec= _solution.objectiveVector();
objVec[0]+=2;
objVec[1]+=2;
return objVec;
}
} ;
//-----------------------------------------------------------------------------
int main()

View file

@ -44,29 +44,9 @@
#include <set>
#include <iostream>
#include <moeoExhaustiveUnvisitedSelect.h>
#include <moeoTestClass.h>
//-----------------------------------------------------------------------------
class ObjectiveVectorTraits : public moeoObjectiveVectorTraits
{
public:
static bool minimizing (int i)
{
return true;
}
static bool maximizing (int i)
{
return false;
}
static unsigned int nObjectives ()
{
return 2;
}
};
typedef moeoRealObjectiveVector < ObjectiveVectorTraits > ObjectiveVector;
typedef MOEO < ObjectiveVector, double, double > Solution;
//-----------------------------------------------------------------------------
int main()

View file

@ -44,29 +44,9 @@
#include <set>
#include <iostream>
#include <moeoNumberUnvisitedSelect.h>
#include <moeoTestClass.h>
//-----------------------------------------------------------------------------
class ObjectiveVectorTraits : public moeoObjectiveVectorTraits
{
public:
static bool minimizing (int i)
{
return true;
}
static bool maximizing (int i)
{
return false;
}
static unsigned int nObjectives ()
{
return 2;
}
};
typedef moeoRealObjectiveVector < ObjectiveVectorTraits > ObjectiveVector;
typedef MOEO < ObjectiveVector, double, double > Solution;
//-----------------------------------------------------------------------------
int main()

View file

@ -45,90 +45,10 @@
#include <set>
#include <iostream>
#include <moeoSubNeighborhoodExplorer.h>
#include <moeoTestClass.h>
//-----------------------------------------------------------------------------
class ObjectiveVectorTraits : public moeoObjectiveVectorTraits
{
public:
static bool minimizing (int i)
{
return true;
}
static bool maximizing (int i)
{
return false;
}
static unsigned int nObjectives ()
{
return 2;
}
};
typedef moeoRealObjectiveVector < ObjectiveVectorTraits > ObjectiveVector;
typedef MOEO < ObjectiveVector, double, double > Solution;
class testMove : public moMove < Solution >
{
public :
void operator () (Solution & _solution)
{
Solution sol=_solution;
counter++;
}
void setCounter(unsigned int i){
counter=i;
}
unsigned int getCounter(){
return counter;
}
private:
unsigned int counter;
} ;
class testMoveInit : public moMoveInit <testMove>
{
public :
void operator () (testMove & _move, const Solution & _solution)
{
_move.setCounter(0);
const Solution sol(_solution);
}
} ;
class testMoveNext : public moNextMove <testMove>
{
public :
testMoveNext(unsigned int _counter=0):counter(_counter){};
bool operator () (testMove & _move, const Solution & _solution)
{
testMove move(_move);
const Solution sol(_solution);
return _move.getCounter() < 5;
}
private:
unsigned int counter;
} ;
class testMoveIncrEval : public moMoveIncrEval <testMove, ObjectiveVector>
{
public :
ObjectiveVector operator () (const testMove & _move, const Solution & _solution)
{
ObjectiveVector objVec= _solution.objectiveVector();
objVec[0]+=2;
objVec[1]+=2;
return objVec;
}
} ;
//-----------------------------------------------------------------------------