diff --git a/trunk/paradiseo-mo/src/coolingSchedule/moSimpleCoolingSchedule.h b/trunk/paradiseo-mo/src/coolingSchedule/moSimpleCoolingSchedule.h index 90e17b3b7..b0aed9e09 100644 --- a/trunk/paradiseo-mo/src/coolingSchedule/moSimpleCoolingSchedule.h +++ b/trunk/paradiseo-mo/src/coolingSchedule/moSimpleCoolingSchedule.h @@ -58,7 +58,8 @@ public: /** * Initial temperature - * @param _solution initial solution + * @param _solution initial solution + * @return the initial temperature */ double init(EOT & _solution) { // number of iteration with the same temperature diff --git a/trunk/paradiseo-mo/src/mo.h b/trunk/paradiseo-mo/src/mo.h index 2c6813c3c..af09b5c7d 100755 --- a/trunk/paradiseo-mo/src/mo.h +++ b/trunk/paradiseo-mo/src/mo.h @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -91,6 +92,8 @@ #include #include +#include +#include #include #include #include @@ -113,6 +116,11 @@ #include #include +#include +#include +#include +#include +#include //#include //#include diff --git a/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h index 21cb0822a..4c8bfddcf 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h @@ -31,6 +31,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #define _moDummyNeighborhood_h #include +#include /** * Dummy Neighborhood diff --git a/trunk/paradiseo-mo/test/CMakeLists.txt b/trunk/paradiseo-mo/test/CMakeLists.txt index 8cf9df803..aae18e63b 100644 --- a/trunk/paradiseo-mo/test/CMakeLists.txt +++ b/trunk/paradiseo-mo/test/CMakeLists.txt @@ -59,6 +59,13 @@ SET (TEST_LIST t-moRandomNeutralWalkExplorer t-moTSExplorer t-moForwardVariableNeighborhood + t-moSolComparator + t-moDummyEval + t-moDummyNeighbor + t-moDummyNeighborhood + t-moSimpleCoolingSchedule + t-moAlwaysAcceptCrit + t-moBetterAcceptCrit ) FOREACH (test ${TEST_LIST}) diff --git a/trunk/paradiseo-mo/test/t-moAlwaysAcceptCrit.cpp b/trunk/paradiseo-mo/test/t-moAlwaysAcceptCrit.cpp new file mode 100644 index 000000000..ef043c54e --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moAlwaysAcceptCrit.cpp @@ -0,0 +1,51 @@ +/* + +Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 + +Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can ue, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +ParadisEO WebSite : http://paradiseo.gforge.inria.fr +Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include + +#include +#include "moTestClass.h" + +int main(){ + + std::cout << "[t-moAlwaysAcceptCrit] => START" << std::endl; + + bitVector sol1, sol2; + + moAlwaysAcceptCrit test; + + assert(test(sol1,sol2)); + + std::cout << "[t-moAlwaysAcceptCrit] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moBetterAcceptCrit.cpp b/trunk/paradiseo-mo/test/t-moBetterAcceptCrit.cpp new file mode 100644 index 000000000..862c83d35 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moBetterAcceptCrit.cpp @@ -0,0 +1,61 @@ +/* + +Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 + +Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can ue, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +ParadisEO WebSite : http://paradiseo.gforge.inria.fr +Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include + +#include +#include +#include "moTestClass.h" + +int main(){ + + std::cout << "[t-moBetterAcceptCrit] => START" << std::endl; + + bitVector sol1, sol2, sol3; + + sol1.fitness(2); + sol2.fitness(3); + sol3.fitness(3); + + moSolComparator comparator; + + moBetterAcceptCrit test(comparator); + + assert(test(sol2, sol1)); + assert(!test(sol1, sol2)); + assert(!test(sol2, sol3)); + + + std::cout << "[t-moBetterAcceptCrit] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moDummyEval.cpp b/trunk/paradiseo-mo/test/t-moDummyEval.cpp new file mode 100644 index 000000000..bbd04e3fc --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moDummyEval.cpp @@ -0,0 +1,46 @@ +/* + +Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 + +Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can ue, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +ParadisEO WebSite : http://paradiseo.gforge.inria.fr +Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include +#include +#include "moTestClass.h" + +int main(){ + + std::cout << "[t-moDummyEval] => START" << std::endl; + + moDummyEval test; + + std::cout << "[t-moDummyEval] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp b/trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp new file mode 100644 index 000000000..e92a18bef --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp @@ -0,0 +1,47 @@ +/* + +Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 + +Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can ue, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +ParadisEO WebSite : http://paradiseo.gforge.inria.fr +Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include +#include +#include "moTestClass.h" + +int main(){ + + std::cout << "[t-moDummyNeighbor] => START" << std::endl; + + + moDummyNeighbor test; + + std::cout << "[t-moDummyNeighbor] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moDummyNeighborhood.cpp b/trunk/paradiseo-mo/test/t-moDummyNeighborhood.cpp new file mode 100644 index 000000000..8a520e52b --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moDummyNeighborhood.cpp @@ -0,0 +1,47 @@ +/* + +Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 + +Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can ue, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +ParadisEO WebSite : http://paradiseo.gforge.inria.fr +Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include +#include +#include +#include "moTestClass.h" + +int main(){ + + std::cout << "[t-moDummyNeighborhood] => START" << std::endl; + + moDummyNeighborhood > test; + + std::cout << "[t-moDummyNeighborhood] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moSimpleCoolingSchedule.cpp b/trunk/paradiseo-mo/test/t-moSimpleCoolingSchedule.cpp new file mode 100644 index 000000000..03eb8d7a3 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moSimpleCoolingSchedule.cpp @@ -0,0 +1,88 @@ +/* + +Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 + +Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can ue, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +ParadisEO WebSite : http://paradiseo.gforge.inria.fr +Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include + +#include +#include "moTestClass.h" + +int main(){ + + std::cout << "[t-moSimpleCoolingSchedule] => START" << std::endl; + + double temperature; + + bitVector sol; + + moSimpleCoolingSchedule test(100, 0.1, 2, 0.1); + + temperature=test.init(sol); + assert(temperature==100); + + //temperature must not changed 2* + test.update(temperature); + assert(temperature==100); + assert(test(temperature)); + test.update(temperature); + assert(temperature==100); + assert(test(temperature)); + + //then temperature must be /10 + test.update(temperature); + assert(temperature==10); + assert(test(temperature)); + test.update(temperature); + assert(temperature==10); + assert(test(temperature)); + test.update(temperature); + assert(temperature==10); + assert(test(temperature)); + + test.update(temperature); + assert(temperature==1); + assert(test(temperature)); + test.update(temperature); + assert(temperature==1); + assert(test(temperature)); + test.update(temperature); + assert(temperature==1); + assert(test(temperature)); + + test.update(temperature); + assert(temperature==0.1); + assert(!test(temperature)); + + + std::cout << "[t-moSimpleCoolingSchedule] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moSolComparator.cpp b/trunk/paradiseo-mo/test/t-moSolComparator.cpp new file mode 100644 index 000000000..b24abb426 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moSolComparator.cpp @@ -0,0 +1,61 @@ +/* + +Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 + +Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can ue, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +ParadisEO WebSite : http://paradiseo.gforge.inria.fr +Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#include +#include +#include + +#include +#include +#include + +int main(){ + + std::cout << "[t-moSolComparator] => START" << std::endl; + + eoBit sol1, sol2, sol3; + + moSolComparator< eoBit > test; + + sol1.fitness(3); + sol2.fitness(4); + sol3.fitness(4); + + assert(!test(sol1,sol2)); + assert(test(sol2,sol1)); + assert(!test.equals(sol1,sol2)); + assert(test.equals(sol2,sol3)); + + assert(test.className()=="moSolComparator"); + + std::cout << "[t-moSolComparator] => OK" << std::endl; + + return EXIT_SUCCESS; +} +