test added
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1801 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
d83cebe643
commit
2cf997ca72
20 changed files with 894 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
|
|
||||||
#include <continuator/moContinuator.h>
|
#include <continuator/moContinuator.h>
|
||||||
#include <neighborhood/moNeighborhood.h>
|
#include <neighborhood/moNeighborhood.h>
|
||||||
|
#include <vector>
|
||||||
/**
|
/**
|
||||||
* Combined several continuators
|
* Combined several continuators
|
||||||
* Continue until one of the continuators is false
|
* Continue until one of the continuators is false
|
||||||
|
|
@ -58,6 +59,15 @@ public:
|
||||||
continuators.push_back(&_cont);
|
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
|
*@param _solution a solution
|
||||||
*@return true all the continuators are true
|
*@return true all the continuators are true
|
||||||
|
|
@ -76,7 +86,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** continuators vector */
|
/** continuators vector */
|
||||||
std::vector<moContinuator<Neighbor>*> continuators;
|
std::vector< moContinuator<Neighbor>* > continuators;
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,21 @@ SET (TEST_LIST
|
||||||
t-moMonOpDiversification
|
t-moMonOpDiversification
|
||||||
t-moTS
|
t-moTS
|
||||||
t-moILS
|
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})
|
FOREACH (test ${TEST_LIST})
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@
|
||||||
#include <utils/eoMonitor.h>
|
#include <utils/eoMonitor.h>
|
||||||
#include <utils/eoUpdater.h>
|
#include <utils/eoUpdater.h>
|
||||||
|
|
||||||
|
#include <eoInit.h>
|
||||||
|
|
||||||
typedef eoBit<eoMinimizingFitness> bitVector;
|
typedef eoBit<eoMinimizingFitness> bitVector;
|
||||||
typedef moBitNeighbor<eoMinimizingFitness> bitNeighbor;
|
typedef moBitNeighbor<eoMinimizingFitness> bitNeighbor;
|
||||||
|
|
||||||
|
|
@ -202,4 +204,9 @@ private:
|
||||||
unsigned int& a;
|
unsigned int& a;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class dummyInit: public eoInit<bitVector>{
|
||||||
|
void operator()(bitVector& sol){
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
65
trunk/paradiseo-mo/test/t-moCombinedContinuator.cpp
Normal file
65
trunk/paradiseo-mo/test/t-moCombinedContinuator.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
<t-moCombinedContinuator.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <continuator/moCombinedContinuator.h>
|
||||||
|
#include <continuator/moIterContinuator.h>
|
||||||
|
#include <continuator/moTrueContinuator.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moCombinedContinuator] => START" << std::endl;
|
||||||
|
|
||||||
|
moIterContinuator<moDummyNeighborTest> cont1(3, false);
|
||||||
|
moTrueContinuator<moDummyNeighborTest> cont2;
|
||||||
|
|
||||||
|
moCombinedContinuator<moDummyNeighborTest> 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;
|
||||||
|
}
|
||||||
|
|
||||||
49
trunk/paradiseo-mo/test/t-moDummyExplorer.cpp
Normal file
49
trunk/paradiseo-mo/test/t-moDummyExplorer.cpp
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
<t-moDummyExplorer.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <explorer/moDummyExplorer.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moDummyExplorer] => START" << std::endl;
|
||||||
|
|
||||||
|
moDummyExplorer<bitNeighbor> test;
|
||||||
|
|
||||||
|
assert(test.className()=="moDummyExplorer");
|
||||||
|
|
||||||
|
std::cout << "[t-moDummyExplorer] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
51
trunk/paradiseo-mo/test/t-moDummyLS.cpp
Normal file
51
trunk/paradiseo-mo/test/t-moDummyLS.cpp
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
<t-moDummyLS.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <algo/moDummyLS.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
#include <eval/oneMaxEval.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moDummyLS] => START" << std::endl;
|
||||||
|
|
||||||
|
oneMaxEval<bitVector> fullEval;
|
||||||
|
moDummyLS<bitNeighbor> test(fullEval);
|
||||||
|
|
||||||
|
assert(test.className()=="moDummyLS");
|
||||||
|
|
||||||
|
std::cout << "[t-moDummyLS] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -37,7 +37,6 @@ int main(){
|
||||||
|
|
||||||
std::cout << "[t-moDummyNeighbor] => START" << std::endl;
|
std::cout << "[t-moDummyNeighbor] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
moDummyNeighbor<bitVector> test;
|
moDummyNeighbor<bitVector> test;
|
||||||
|
|
||||||
std::cout << "[t-moDummyNeighbor] => OK" << std::endl;
|
std::cout << "[t-moDummyNeighbor] => OK" << std::endl;
|
||||||
|
|
|
||||||
45
trunk/paradiseo-mo/test/t-moEvalCounter.cpp
Normal file
45
trunk/paradiseo-mo/test/t-moEvalCounter.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
<t-moEvalCounter.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <eval/moEvalCounter.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moEvalCounter] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moEvalCounter] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
45
trunk/paradiseo-mo/test/t-moFitContinuator.cpp
Normal file
45
trunk/paradiseo-mo/test/t-moFitContinuator.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
<t-moFitContinuator.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <continuator/moFitContinuator.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moFitContinuator] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moFitContinuator] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
45
trunk/paradiseo-mo/test/t-moFullEvalContinuator.cpp
Normal file
45
trunk/paradiseo-mo/test/t-moFullEvalContinuator.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
<t-moFullEvalContinuator.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <continuator/moFullEvalContinuator.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moFullEvalContinuator] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moFullEvalContinuator] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
61
trunk/paradiseo-mo/test/t-moIterContinuator.cpp
Normal file
61
trunk/paradiseo-mo/test/t-moIterContinuator.cpp
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
<t-moIterContinuator.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <continuator/moIterContinuator.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moIterContinuator] => START" << std::endl;
|
||||||
|
|
||||||
|
moIterContinuator<moDummyNeighborTest> test(3, false);
|
||||||
|
moIterContinuator<moDummyNeighborTest> 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;
|
||||||
|
}
|
||||||
|
|
||||||
45
trunk/paradiseo-mo/test/t-moLocalSearchInit.cpp
Normal file
45
trunk/paradiseo-mo/test/t-moLocalSearchInit.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
<t-moLocalSearchInit.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <perturb/moLocalSearchInit.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moLocalSearchInit] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moLocalSearchInit] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
65
trunk/paradiseo-mo/test/t-moMetropolisHasting.cpp
Normal file
65
trunk/paradiseo-mo/test/t-moMetropolisHasting.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
<t-moMetropolisHasting.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <algo/moMetropolisHasting.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
#include <eval/oneMaxEval.h>
|
||||||
|
#include <continuator/moTrueContinuator.h>
|
||||||
|
#include <comparator/moSolNeighborComparator.h>
|
||||||
|
#include <comparator/moNeighborComparator.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moMetropolisHasting] => START" << std::endl;
|
||||||
|
|
||||||
|
bitNeighborhood nh(4);
|
||||||
|
oneMaxEval<bitVector> fullEval;
|
||||||
|
evalOneMax eval(4);
|
||||||
|
moTrueContinuator<bitNeighbor> cont;
|
||||||
|
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||||
|
moNeighborComparator<bitNeighbor> ncomp;
|
||||||
|
|
||||||
|
//test du 1er constructeur
|
||||||
|
moMetropolisHasting<bitNeighbor> test1(nh, fullEval, eval, 3);
|
||||||
|
|
||||||
|
//test du 2eme constructeur
|
||||||
|
moMetropolisHasting<bitNeighbor> test2(nh, fullEval, eval, 3, cont);
|
||||||
|
|
||||||
|
//test du 3eme constructeur
|
||||||
|
moMetropolisHasting<bitNeighbor> test3(nh, fullEval, eval, 3, cont, ncomp, sncomp);
|
||||||
|
|
||||||
|
std::cout << "[t-moMetropolisHasting] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
45
trunk/paradiseo-mo/test/t-moNeighborEvalContinuator.cpp
Normal file
45
trunk/paradiseo-mo/test/t-moNeighborEvalContinuator.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
<t-moNeighborEvalContinuator.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <continuator/moNeighborEvalContinuator.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moNeighborEvalContinuator] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moNeighborEvalContinuator] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
65
trunk/paradiseo-mo/test/t-moNeutralHC.cpp
Normal file
65
trunk/paradiseo-mo/test/t-moNeutralHC.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
<t-moNeutralHC.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <algo/moNeutralHC.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
#include <eval/oneMaxEval.h>
|
||||||
|
#include <continuator/moTrueContinuator.h>
|
||||||
|
#include <comparator/moSolNeighborComparator.h>
|
||||||
|
#include <comparator/moNeighborComparator.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moNeutralHC] => START" << std::endl;
|
||||||
|
|
||||||
|
bitNeighborhood nh(4);
|
||||||
|
oneMaxEval<bitVector> fullEval;
|
||||||
|
evalOneMax eval(4);
|
||||||
|
moTrueContinuator<bitNeighbor> cont;
|
||||||
|
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||||
|
moNeighborComparator<bitNeighbor> ncomp;
|
||||||
|
|
||||||
|
//test du 1er constructeur
|
||||||
|
moNeutralHC<bitNeighbor> test1(nh, fullEval, eval, 3);
|
||||||
|
|
||||||
|
//test du 2eme constructeur
|
||||||
|
moNeutralHC<bitNeighbor> test2(nh, fullEval, eval, 3, cont);
|
||||||
|
|
||||||
|
//test du 3eme constructeur
|
||||||
|
moNeutralHC<bitNeighbor> test3(nh, fullEval, eval, 3, cont, ncomp, sncomp);
|
||||||
|
|
||||||
|
std::cout << "[t-moNeutralHC] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
44
trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp
Normal file
44
trunk/paradiseo-mo/test/t-moRandomNeutralWalk.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
<t-moRandomNeutralWalk.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moRandomNeutralWalk] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moRandomNeutralWalk] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
56
trunk/paradiseo-mo/test/t-moRandomSearch.cpp
Normal file
56
trunk/paradiseo-mo/test/t-moRandomSearch.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
<t-moRandomSearch.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <algo/moRandomSearch.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
#include <eval/oneMaxEval.h>
|
||||||
|
#include <continuator/moTrueContinuator.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moRandomSearch] => START" << std::endl;
|
||||||
|
oneMaxEval<bitVector> fullEval;
|
||||||
|
dummyInit init;
|
||||||
|
moTrueContinuator<bitNeighbor> cont;
|
||||||
|
//test du 1er constructor
|
||||||
|
moRandomSearch<bitNeighbor> test1(init, fullEval, 3);
|
||||||
|
//test du 2e constructor
|
||||||
|
moRandomSearch<bitNeighbor> test2(init, fullEval, 3, cont);
|
||||||
|
|
||||||
|
assert(test1.className()=="moRandomSearch");
|
||||||
|
|
||||||
|
std::cout << "[t-moRandomSearch] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
63
trunk/paradiseo-mo/test/t-moRandomWalk.cpp
Normal file
63
trunk/paradiseo-mo/test/t-moRandomWalk.cpp
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
<t-moRandomWalk.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <algo/moRandomWalk.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
#include <eval/oneMaxEval.h>
|
||||||
|
#include <continuator/moTrueContinuator.h>
|
||||||
|
#include <comparator/moSolNeighborComparator.h>
|
||||||
|
#include <comparator/moNeighborComparator.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moRandomWalk] => START" << std::endl;
|
||||||
|
|
||||||
|
bitNeighborhood nh(4);
|
||||||
|
oneMaxEval<bitVector> fullEval;
|
||||||
|
evalOneMax eval(4);
|
||||||
|
moTrueContinuator<bitNeighbor> cont;
|
||||||
|
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||||
|
moNeighborComparator<bitNeighbor> ncomp;
|
||||||
|
|
||||||
|
//test du 1er constructeur
|
||||||
|
moRandomWalk<bitNeighbor> test1(nh, fullEval, eval, 3);
|
||||||
|
|
||||||
|
//test du 2eme constructeur
|
||||||
|
moRandomWalk<bitNeighbor> test2(nh, fullEval, eval, 3, cont);
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moRandomWalk] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
45
trunk/paradiseo-mo/test/t-moSolInit.cpp
Normal file
45
trunk/paradiseo-mo/test/t-moSolInit.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
<t-moSolInit.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <perturb/moSolInit.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moSolInit] => START" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "[t-moSolInit] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
71
trunk/paradiseo-mo/test/t-moTimeContinuator.cpp
Normal file
71
trunk/paradiseo-mo/test/t-moTimeContinuator.cpp
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
/*
|
||||||
|
<t-moTimeContinuator.cpp>
|
||||||
|
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 <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <continuator/moTimeContinuator.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
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<moDummyNeighborTest> test(2, false);
|
||||||
|
moTimeContinuator<moDummyNeighborTest> 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;
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue