diff --git a/contribution/branches/MOLS/test/CMakeLists.txt b/contribution/branches/MOLS/test/CMakeLists.txt index 2916af7b2..de6a937b1 100644 --- a/contribution/branches/MOLS/test/CMakeLists.txt +++ b/contribution/branches/MOLS/test/CMakeLists.txt @@ -13,7 +13,8 @@ INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${PARADISEO_MO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${PARADISEO_MOEO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${SOURCES_DIR}) +INCLUDE_DIRECTORIES(${FLOWSHOP_SRC_DIR}/src) +INCLUDE_DIRECTORIES(${SOURCES_DIR}/src) ###################################################################################### @@ -23,7 +24,7 @@ INCLUDE_DIRECTORIES(${SOURCES_DIR}) ### 2) Specify where CMake can find the libraries ###################################################################################### -LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib ${PARADISEO_MOEO_BIN_DIR}/lib) +LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib ${PARADISEO_MOEO_BIN_DIR}/lib ${FLOWSHOP_LIB_OUTPUT_PATH}) ###################################################################################### @@ -48,7 +49,7 @@ ENDFOREACH (test) # Link the librairies FOREACH (test ${TEST_LIST}) - TARGET_LINK_LIBRARIES(${test} moeo ga es eoutils eo) + TARGET_LINK_LIBRARIES(${test} moeo flowshop ga es eoutils eo) ENDFOREACH (test) ###################################################################################### diff --git a/contribution/branches/MOLS/test/t-moeoUnifiedDominanceBasedLS.cpp b/contribution/branches/MOLS/test/t-moeoUnifiedDominanceBasedLS.cpp index 8c4d87aa9..292958a91 100644 --- a/contribution/branches/MOLS/test/t-moeoUnifiedDominanceBasedLS.cpp +++ b/contribution/branches/MOLS/test/t-moeoUnifiedDominanceBasedLS.cpp @@ -1,70 +1,44 @@ #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include + +// for the creation of an evaluator +#include +// for the creation of an initializer +#include +// for the creation of the variation operators +#include +// how to initialize the population +#include -class ObjectiveVectorTraits : public moeoObjectiveVectorTraits +int main(int argc, char* argv[]) { -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; - -class Solution : public moeoRealVector < ObjectiveVector, double, double > -{ -public: - Solution() : moeoRealVector < ObjectiveVector, double, double > (1) {} -}; - -class dummyMove : public moMove < Solution > -{ -public : - void operator () (Solution & _solution){} -} ; - - -int main() -{ - - // objective vectors - ObjectiveVector obj0, obj1, obj2, obj3, obj4, obj5, obj6; - obj0[0] = 2; - obj0[1] = 5; - obj1[0] = 3; - obj1[1] = 3; - obj2[0] = 4; - obj2[1] = 1; - obj3[0] = 5; - obj3[1] = 5; - + eoParser parser(argc, argv); // for user-parameter reading + eoState state; // to keep all things allocated + ExchangeMoveNext moveNext; + ExchangeMoveInit moveInit; + ExchangeMove move; + eoEvalFuncCounter& eval = do_make_eval(parser, state); + // population - eoPop < Solution > pop; - pop.resize(4); - pop[0].objectiveVector(obj0); // class 1 - pop[1].objectiveVector(obj1); // class 1 - pop[2].objectiveVector(obj2); // class 1 - pop[3].objectiveVector(obj3); // class 3 - - eoTimeContinue < Solution > continuator(5); - - moeoUnifiedDominanceBasedLS < dummyMove > algo(continuator); - - algo(pop); + eoPop < FlowShop > pop; + eoTimeContinue < FlowShop > continuator(5); + moeoAllSolAllNeighborsExpl < ExchangeMove > explorer(moveInit,moveNext, eval); +// + moeoUnifiedDominanceBasedLS < ExchangeMove > algo(continuator, explorer); + +// +// algo(pop); std::cout << "OK c'est bon" << std::endl; return EXIT_SUCCESS;