From 2cf997ca72f39606bfb1d82363b0a058d425d057 Mon Sep 17 00:00:00 2001 From: jhumeau Date: Fri, 7 May 2010 14:55:37 +0000 Subject: [PATCH] test added git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1801 331e1502-861f-0410-8da2-ba01fb791d7f --- .../src/continuator/moCombinedContinuator.h | 14 +++- trunk/paradiseo-mo/test/CMakeLists.txt | 15 ++++ trunk/paradiseo-mo/test/moTestClass.h | 7 ++ .../test/t-moCombinedContinuator.cpp | 65 +++++++++++++++++ trunk/paradiseo-mo/test/t-moDummyExplorer.cpp | 49 +++++++++++++ trunk/paradiseo-mo/test/t-moDummyLS.cpp | 51 +++++++++++++ trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp | 1 - trunk/paradiseo-mo/test/t-moEvalCounter.cpp | 45 ++++++++++++ .../paradiseo-mo/test/t-moFitContinuator.cpp | 45 ++++++++++++ .../test/t-moFullEvalContinuator.cpp | 45 ++++++++++++ .../paradiseo-mo/test/t-moIterContinuator.cpp | 61 ++++++++++++++++ .../paradiseo-mo/test/t-moLocalSearchInit.cpp | 45 ++++++++++++ .../test/t-moMetropolisHasting.cpp | 65 +++++++++++++++++ .../test/t-moNeighborEvalContinuator.cpp | 45 ++++++++++++ trunk/paradiseo-mo/test/t-moNeutralHC.cpp | 65 +++++++++++++++++ .../test/t-moRandomNeutralWalk.cpp | 44 ++++++++++++ trunk/paradiseo-mo/test/t-moRandomSearch.cpp | 56 +++++++++++++++ trunk/paradiseo-mo/test/t-moRandomWalk.cpp | 63 ++++++++++++++++ trunk/paradiseo-mo/test/t-moSolInit.cpp | 45 ++++++++++++ .../paradiseo-mo/test/t-moTimeContinuator.cpp | 71 +++++++++++++++++++ 20 files changed, 894 insertions(+), 3 deletions(-) create mode 100644 trunk/paradiseo-mo/test/t-moCombinedContinuator.cpp create mode 100644 trunk/paradiseo-mo/test/t-moDummyExplorer.cpp create mode 100644 trunk/paradiseo-mo/test/t-moDummyLS.cpp create mode 100644 trunk/paradiseo-mo/test/t-moEvalCounter.cpp create mode 100644 trunk/paradiseo-mo/test/t-moFitContinuator.cpp create mode 100644 trunk/paradiseo-mo/test/t-moFullEvalContinuator.cpp create mode 100644 trunk/paradiseo-mo/test/t-moIterContinuator.cpp create mode 100644 trunk/paradiseo-mo/test/t-moLocalSearchInit.cpp create mode 100644 trunk/paradiseo-mo/test/t-moMetropolisHasting.cpp create mode 100644 trunk/paradiseo-mo/test/t-moNeighborEvalContinuator.cpp create mode 100644 trunk/paradiseo-mo/test/t-moNeutralHC.cpp create mode 100644 trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp create mode 100644 trunk/paradiseo-mo/test/t-moRandomSearch.cpp create mode 100644 trunk/paradiseo-mo/test/t-moRandomWalk.cpp create mode 100644 trunk/paradiseo-mo/test/t-moSolInit.cpp create mode 100644 trunk/paradiseo-mo/test/t-moTimeContinuator.cpp diff --git a/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h b/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h index 9e7ab54c0..cd25cda48 100644 --- a/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h +++ b/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h @@ -32,6 +32,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include +#include /** * Combined several continuators * Continue until one of the continuators is false @@ -58,6 +59,15 @@ public: continuators.push_back(&_cont); } + /** + * init all continuators + * @param _solution a solution + */ + virtual void init(EOT & _solution) { + for(unsigned int i = 0; i < continuators.size(); ++i) + continuators[i]->init(_solution); + } + /** *@param _solution a solution *@return true all the continuators are true @@ -69,14 +79,14 @@ public: // So, all continuators are tested for(unsigned int i = 0; i < continuators.size(); ++i) if ( !(*continuators[i])(_solution) ) - bContinue = false; + bContinue = false; return bContinue; } private: /** continuators vector */ - std::vector*> continuators; + std::vector< moContinuator* > continuators; }; #endif diff --git a/trunk/paradiseo-mo/test/CMakeLists.txt b/trunk/paradiseo-mo/test/CMakeLists.txt index aa0e00872..eed0a3f31 100644 --- a/trunk/paradiseo-mo/test/CMakeLists.txt +++ b/trunk/paradiseo-mo/test/CMakeLists.txt @@ -82,6 +82,21 @@ SET (TEST_LIST t-moMonOpDiversification t-moTS t-moILS + t-moDummyLS + t-moRandomSearch + t-moMetropolisHasting + t-moNeutralHC + t-moRandomWalk + t-moRandomNeutralWalk + t-moIterContinuator + t-moFitContinuator + t-moCombinedContinuator + t-moFullEvalContinuator + t-moNeighborEvalContinuator + t-moTimeContinuator + t-moDummyExplorer + t-moLocalSearchInit + t-moSolInit ) FOREACH (test ${TEST_LIST}) diff --git a/trunk/paradiseo-mo/test/moTestClass.h b/trunk/paradiseo-mo/test/moTestClass.h index 873bb2bc2..a3f6663dd 100644 --- a/trunk/paradiseo-mo/test/moTestClass.h +++ b/trunk/paradiseo-mo/test/moTestClass.h @@ -52,6 +52,8 @@ #include #include +#include + typedef eoBit bitVector; typedef moBitNeighbor bitNeighbor; @@ -202,4 +204,9 @@ private: unsigned int& a; }; +class dummyInit: public eoInit{ + void operator()(bitVector& sol){ + } +}; + #endif diff --git a/trunk/paradiseo-mo/test/t-moCombinedContinuator.cpp b/trunk/paradiseo-mo/test/t-moCombinedContinuator.cpp new file mode 100644 index 000000000..afeec68c2 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moCombinedContinuator.cpp @@ -0,0 +1,65 @@ +/* + +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 +#include "moTestClass.h" + + +int main(){ + + std::cout << "[t-moCombinedContinuator] => START" << std::endl; + + moIterContinuator cont1(3, false); + moTrueContinuator cont2; + + moCombinedContinuator test(cont2); + test.add(cont1); + + Solution s; + + test.init(s); + assert(test(s)); + assert(test(s)); + assert(!test(s)); + test.init(s); + assert(test(s)); + assert(test(s)); + assert(!test(s)); + + std::cout << "[t-moCombinedContinuator] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moDummyExplorer.cpp b/trunk/paradiseo-mo/test/t-moDummyExplorer.cpp new file mode 100644 index 000000000..f6b53da2f --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moDummyExplorer.cpp @@ -0,0 +1,49 @@ +/* + +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-moDummyExplorer] => START" << std::endl; + + moDummyExplorer test; + + assert(test.className()=="moDummyExplorer"); + + std::cout << "[t-moDummyExplorer] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moDummyLS.cpp b/trunk/paradiseo-mo/test/t-moDummyLS.cpp new file mode 100644 index 000000000..b752e178a --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moDummyLS.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" +#include + +int main(){ + + std::cout << "[t-moDummyLS] => START" << std::endl; + + oneMaxEval fullEval; + moDummyLS test(fullEval); + + assert(test.className()=="moDummyLS"); + + std::cout << "[t-moDummyLS] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp b/trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp index e92a18bef..8d1326e6b 100644 --- a/trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp +++ b/trunk/paradiseo-mo/test/t-moDummyNeighbor.cpp @@ -37,7 +37,6 @@ int main(){ std::cout << "[t-moDummyNeighbor] => START" << std::endl; - moDummyNeighbor test; std::cout << "[t-moDummyNeighbor] => OK" << std::endl; diff --git a/trunk/paradiseo-mo/test/t-moEvalCounter.cpp b/trunk/paradiseo-mo/test/t-moEvalCounter.cpp new file mode 100644 index 000000000..e805c42a7 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moEvalCounter.cpp @@ -0,0 +1,45 @@ +/* + +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 + +int main(){ + + std::cout << "[t-moEvalCounter] => START" << std::endl; + + + std::cout << "[t-moEvalCounter] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moFitContinuator.cpp b/trunk/paradiseo-mo/test/t-moFitContinuator.cpp new file mode 100644 index 000000000..0cadd116a --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moFitContinuator.cpp @@ -0,0 +1,45 @@ +/* + +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 + +int main(){ + + std::cout << "[t-moFitContinuator] => START" << std::endl; + + + std::cout << "[t-moFitContinuator] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moFullEvalContinuator.cpp b/trunk/paradiseo-mo/test/t-moFullEvalContinuator.cpp new file mode 100644 index 000000000..cfcc1308f --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moFullEvalContinuator.cpp @@ -0,0 +1,45 @@ +/* + +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 + +int main(){ + + std::cout << "[t-moFullEvalContinuator] => START" << std::endl; + + + std::cout << "[t-moFullEvalContinuator] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moIterContinuator.cpp b/trunk/paradiseo-mo/test/t-moIterContinuator.cpp new file mode 100644 index 000000000..7bedb7b75 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moIterContinuator.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 "moTestClass.h" + +int main(){ + + std::cout << "[t-moIterContinuator] => START" << std::endl; + + moIterContinuator test(3, false); + moIterContinuator test2(3); + Solution s; + + test.init(s); + assert(test.value()==0); + assert(test(s)); + assert(test.value()==1); + assert(test(s)); + assert(test.value()==2); + assert(!test(s)); + assert(test.value()==3); + test.init(s); + assert(test.value()==0); + + + std::cout << "[t-moIterContinuator] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moLocalSearchInit.cpp b/trunk/paradiseo-mo/test/t-moLocalSearchInit.cpp new file mode 100644 index 000000000..bcdf12b40 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moLocalSearchInit.cpp @@ -0,0 +1,45 @@ +/* + +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 + +int main(){ + + std::cout << "[t-moLocalSearchInit] => START" << std::endl; + + + std::cout << "[t-moLocalSearchInit] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moMetropolisHasting.cpp b/trunk/paradiseo-mo/test/t-moMetropolisHasting.cpp new file mode 100644 index 000000000..d94eee0b1 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moMetropolisHasting.cpp @@ -0,0 +1,65 @@ +/* + +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" +#include +#include +#include +#include + +int main(){ + + std::cout << "[t-moMetropolisHasting] => START" << std::endl; + + bitNeighborhood nh(4); + oneMaxEval fullEval; + evalOneMax eval(4); + moTrueContinuator cont; + moSolNeighborComparator sncomp; + moNeighborComparator ncomp; + + //test du 1er constructeur + moMetropolisHasting test1(nh, fullEval, eval, 3); + + //test du 2eme constructeur + moMetropolisHasting test2(nh, fullEval, eval, 3, cont); + + //test du 3eme constructeur + moMetropolisHasting test3(nh, fullEval, eval, 3, cont, ncomp, sncomp); + + std::cout << "[t-moMetropolisHasting] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moNeighborEvalContinuator.cpp b/trunk/paradiseo-mo/test/t-moNeighborEvalContinuator.cpp new file mode 100644 index 000000000..06d3dbbb3 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moNeighborEvalContinuator.cpp @@ -0,0 +1,45 @@ +/* + +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 + +int main(){ + + std::cout << "[t-moNeighborEvalContinuator] => START" << std::endl; + + + std::cout << "[t-moNeighborEvalContinuator] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moNeutralHC.cpp b/trunk/paradiseo-mo/test/t-moNeutralHC.cpp new file mode 100644 index 000000000..1aa68253b --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moNeutralHC.cpp @@ -0,0 +1,65 @@ +/* + +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" +#include +#include +#include +#include + +int main(){ + + std::cout << "[t-moNeutralHC] => START" << std::endl; + + bitNeighborhood nh(4); + oneMaxEval fullEval; + evalOneMax eval(4); + moTrueContinuator cont; + moSolNeighborComparator sncomp; + moNeighborComparator ncomp; + + //test du 1er constructeur + moNeutralHC test1(nh, fullEval, eval, 3); + + //test du 2eme constructeur + moNeutralHC test2(nh, fullEval, eval, 3, cont); + + //test du 3eme constructeur + moNeutralHC test3(nh, fullEval, eval, 3, cont, ncomp, sncomp); + + std::cout << "[t-moNeutralHC] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp b/trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp new file mode 100644 index 000000000..127f11720 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp @@ -0,0 +1,44 @@ +/* + +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 + + +int main(){ + + std::cout << "[t-moRandomNeutralWalk] => START" << std::endl; + + + std::cout << "[t-moRandomNeutralWalk] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moRandomSearch.cpp b/trunk/paradiseo-mo/test/t-moRandomSearch.cpp new file mode 100644 index 000000000..50a486a91 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moRandomSearch.cpp @@ -0,0 +1,56 @@ +/* + +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" +#include +#include + +int main(){ + + std::cout << "[t-moRandomSearch] => START" << std::endl; + oneMaxEval fullEval; + dummyInit init; + moTrueContinuator cont; + //test du 1er constructor + moRandomSearch test1(init, fullEval, 3); + //test du 2e constructor + moRandomSearch test2(init, fullEval, 3, cont); + + assert(test1.className()=="moRandomSearch"); + + std::cout << "[t-moRandomSearch] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moRandomWalk.cpp b/trunk/paradiseo-mo/test/t-moRandomWalk.cpp new file mode 100644 index 000000000..d2a58f47d --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moRandomWalk.cpp @@ -0,0 +1,63 @@ +/* + +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" +#include +#include +#include +#include + +int main(){ + + std::cout << "[t-moRandomWalk] => START" << std::endl; + + bitNeighborhood nh(4); + oneMaxEval fullEval; + evalOneMax eval(4); + moTrueContinuator cont; + moSolNeighborComparator sncomp; + moNeighborComparator ncomp; + + //test du 1er constructeur + moRandomWalk test1(nh, fullEval, eval, 3); + + //test du 2eme constructeur + moRandomWalk test2(nh, fullEval, eval, 3, cont); + + + std::cout << "[t-moRandomWalk] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moSolInit.cpp b/trunk/paradiseo-mo/test/t-moSolInit.cpp new file mode 100644 index 000000000..0ace1ddf1 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moSolInit.cpp @@ -0,0 +1,45 @@ +/* + +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 + +int main(){ + + std::cout << "[t-moSolInit] => START" << std::endl; + + + std::cout << "[t-moSolInit] => OK" << std::endl; + + return EXIT_SUCCESS; +} + diff --git a/trunk/paradiseo-mo/test/t-moTimeContinuator.cpp b/trunk/paradiseo-mo/test/t-moTimeContinuator.cpp new file mode 100644 index 000000000..0b7ea2254 --- /dev/null +++ b/trunk/paradiseo-mo/test/t-moTimeContinuator.cpp @@ -0,0 +1,71 @@ +/* + +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" +#include + +void wait ( int seconds ) +{ + clock_t endwait; + endwait = clock () + seconds * CLOCKS_PER_SEC ; + while (clock() < endwait) {} +} + + +int main(){ + + std::cout << "[t-moTimeContinuator] => START" << std::endl; + + moTimeContinuator test(2, false); + moTimeContinuator test2(3); + Solution s; + + test.init(s); + assert(test(s)); + wait(1); + assert(test(s)); + wait(1); + assert(!test(s)); + test.init(s); + assert(test(s)); + wait(2); + assert(!test(s)); + + assert(test.className()=="moTimeContinuator"); + + std::cout << "[t-moTimeContinuator] => OK" << std::endl; + + return EXIT_SUCCESS; +} +