Migration from SVN
This commit is contained in:
parent
d7d6c3a217
commit
8cd56f37db
86 changed files with 0 additions and 4096888 deletions
112
mo/test/CMakeLists.txt
Normal file
112
mo/test/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
######################################################################################
|
||||
### 0) Include headers
|
||||
######################################################################################
|
||||
|
||||
include_directories(${EO_SRC_DIR}/src)
|
||||
include_directories(${MO_SRC_DIR}/src)
|
||||
include_directories(${PROBLEMS_SRC_DIR})
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
######################################################################################
|
||||
### 1) Define test list
|
||||
######################################################################################
|
||||
|
||||
set (TEST_LIST
|
||||
t-moAdaptiveWalkSampling
|
||||
t-moNeighbor
|
||||
t-moBitNeighbor
|
||||
t-moOrderNeighborhood
|
||||
t-moFullEvalByCopy
|
||||
t-moFullEvalByModif
|
||||
t-moNeighborComparator
|
||||
t-moSolNeighborComparator
|
||||
t-moTrueContinuator
|
||||
t-moRndWithoutReplNeighborhood
|
||||
t-moRndWithReplNeighborhood
|
||||
t-moFitnessStat
|
||||
t-moDistanceStat
|
||||
t-moNeighborhoodStat
|
||||
t-moCounterMonitorSaver
|
||||
t-moSolutionStat
|
||||
t-moCheckpoint
|
||||
t-moDummyMemory
|
||||
t-moSolVectorTabuList
|
||||
t-moBestImprAspiration
|
||||
t-moSimpleHCexplorer
|
||||
t-moRandomBestHCexplorer
|
||||
t-moNeutralHCexplorer
|
||||
t-moFirstImprHCexplorer
|
||||
t-moRandomWalkExplorer
|
||||
t-moMetropolisHastingExplorer
|
||||
t-moRandomNeutralWalkExplorer
|
||||
t-moTSexplorer
|
||||
t-moSolComparator
|
||||
t-moDummyEval
|
||||
t-moDummyNeighbor
|
||||
t-moDummyNeighborhood
|
||||
t-moSimpleCoolingSchedule
|
||||
t-moAlwaysAcceptCrit
|
||||
t-moBetterAcceptCrit
|
||||
t-moCountMoveMemory
|
||||
t-moMonOpPerturb
|
||||
t-moRestartPerturb
|
||||
t-moNeighborhoodPerturb
|
||||
t-moSAexplorer
|
||||
t-moSA
|
||||
t-moLocalSearch
|
||||
t-moILSexplorer
|
||||
t-moSimpleHC
|
||||
t-moFirstImprHC
|
||||
t-moRandomBestHC
|
||||
t-moNeighborVectorTabuList
|
||||
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
|
||||
t-moEvalCounter
|
||||
t-moNeighborBestStat
|
||||
t-moCounterStat
|
||||
t-moMinusOneCounterStat
|
||||
t-moVectorMonitor
|
||||
t-moRandomSearchExplorer
|
||||
t-moSampling
|
||||
t-moDensityOfStatesSampling
|
||||
t-moAutocorrelationSampling
|
||||
t-moHillClimberSampling
|
||||
t-moFDCsampling
|
||||
t-moNeutralDegreeSampling
|
||||
t-moFitnessCloudSampling
|
||||
t-moNeutralWalkSampling
|
||||
t-moStatistics
|
||||
t-moIndexedVectorTabuList
|
||||
t-moRndIndexedVectorTabuList
|
||||
t-moDynSpanCoolingSchedule
|
||||
)
|
||||
|
||||
######################################################################################
|
||||
### 3) Create each test
|
||||
######################################################################################
|
||||
|
||||
foreach (test ${TEST_LIST})
|
||||
set ("T_${test}_SOURCES" "${test}.cpp")
|
||||
add_executable(${test} ${T_${test}_SOURCES})
|
||||
add_test(${test} ${test})
|
||||
target_link_libraries(${test} ga es eoutils eo)
|
||||
install(TARGETS ${test} RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/mo/test COMPONENT tests)
|
||||
endforeach (test)
|
||||
|
||||
|
||||
251
mo/test/moTestClass.h
Normal file
251
mo/test/moTestClass.h
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
/*
|
||||
<moTestClass.h>
|
||||
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 use,
|
||||
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".
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited liability.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#ifndef _moTestClass_h
|
||||
#define _moTestClass_h
|
||||
|
||||
#include <EO.h>
|
||||
#include <eoEvalFunc.h>
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
#include <neighborhood/moBackableNeighbor.h>
|
||||
#include <neighborhood/moNeighborhood.h>
|
||||
#include <neighborhood/moRndNeighborhood.h>
|
||||
#include <eval/moEval.h>
|
||||
|
||||
#include <ga/eoBit.h>
|
||||
#include <eoScalarFitness.h>
|
||||
#include <neighborhood/moOrderNeighborhood.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
#include <neighborhood/moIndexNeighbor.h>
|
||||
|
||||
#include <utils/eoMonitor.h>
|
||||
#include <utils/eoUpdater.h>
|
||||
|
||||
#include <eoInit.h>
|
||||
|
||||
typedef eoBit<eoMinimizingFitness> bitVector;
|
||||
typedef moBitNeighbor<eoMinimizingFitness> bitNeighbor;
|
||||
|
||||
class moDummyRndNeighborhood: public moOrderNeighborhood<bitNeighbor> ,
|
||||
public moRndNeighborhood<bitNeighbor> {
|
||||
public:
|
||||
moDummyRndNeighborhood(unsigned int a) :
|
||||
moOrderNeighborhood<bitNeighbor> (a) {
|
||||
}
|
||||
};
|
||||
|
||||
typedef moDummyRndNeighborhood bitNeighborhood;
|
||||
|
||||
typedef EO<int> Solution;
|
||||
|
||||
class moDummyNeighborTest: public moNeighbor<Solution> {
|
||||
public:
|
||||
virtual void move(Solution & _solution) {
|
||||
}
|
||||
};
|
||||
|
||||
class moDummyBackableNeighbor: public moBackableNeighbor<Solution> {
|
||||
public:
|
||||
virtual void move(Solution & _solution) {
|
||||
}
|
||||
virtual void moveBack(Solution & _solution) {
|
||||
}
|
||||
};
|
||||
|
||||
class moDummyNeighborhoodTest: public moNeighborhood<moDummyNeighborTest> {
|
||||
public:
|
||||
typedef moDummyNeighborTest Neighbor;
|
||||
|
||||
moDummyNeighborhoodTest() :
|
||||
i(0), j(0) {
|
||||
}
|
||||
|
||||
virtual bool hasNeighbor(EOT & _solution) {
|
||||
bool res;
|
||||
if (i % 3 == 0 || i == 1)
|
||||
res = false;
|
||||
else
|
||||
res = true;
|
||||
i++;
|
||||
return res;
|
||||
}
|
||||
virtual void init(EOT & _solution, Neighbor & _current) {
|
||||
}
|
||||
virtual void next(EOT & _solution, Neighbor & _current) {
|
||||
}
|
||||
virtual bool cont(EOT & _solution) {
|
||||
j++;
|
||||
return (j % 10 != 0);
|
||||
}
|
||||
|
||||
private:
|
||||
int i, j;
|
||||
};
|
||||
|
||||
class moDummyEvalTest: public eoEvalFunc<Solution> {
|
||||
public:
|
||||
void operator()(Solution& _sol) {
|
||||
if (_sol.invalid())
|
||||
_sol.fitness(100);
|
||||
else
|
||||
_sol.fitness(_sol.fitness() + 50);
|
||||
}
|
||||
};
|
||||
|
||||
class evalOneMax: public moEval<bitNeighbor> {
|
||||
private:
|
||||
unsigned size;
|
||||
|
||||
public:
|
||||
evalOneMax(unsigned _size) :
|
||||
size(_size) {
|
||||
}
|
||||
;
|
||||
|
||||
~evalOneMax(void) {
|
||||
}
|
||||
;
|
||||
|
||||
void operator()(bitVector& _sol, bitNeighbor& _n) {
|
||||
unsigned int fit = _sol.fitness();
|
||||
if (_sol[_n.index()])
|
||||
fit--;
|
||||
else
|
||||
fit++;
|
||||
_n.fitness(fit);
|
||||
}
|
||||
};
|
||||
|
||||
class dummyEvalOneMax: public moEval<bitNeighbor> {
|
||||
private:
|
||||
unsigned size;
|
||||
|
||||
public:
|
||||
dummyEvalOneMax(unsigned _size) :
|
||||
size(_size) {
|
||||
}
|
||||
;
|
||||
|
||||
~dummyEvalOneMax(void) {
|
||||
}
|
||||
;
|
||||
|
||||
void operator()(bitVector& _sol, bitNeighbor& _n) {
|
||||
unsigned int fit = _sol.fitness();
|
||||
_n.fitness(fit);
|
||||
}
|
||||
};
|
||||
|
||||
class monitor1: public eoMonitor {
|
||||
public:
|
||||
|
||||
monitor1(unsigned int& _a) :
|
||||
a(_a) {
|
||||
}
|
||||
|
||||
eoMonitor& operator()() {
|
||||
a++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void lastCall() {
|
||||
a++;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned int& a;
|
||||
};
|
||||
|
||||
class monitor2: public eoMonitor {
|
||||
public:
|
||||
|
||||
monitor2(unsigned int& _a) :
|
||||
a(_a) {
|
||||
}
|
||||
|
||||
eoMonitor& operator()() {
|
||||
a++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void lastCall() {
|
||||
a++;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned int& a;
|
||||
};
|
||||
|
||||
class updater1: public eoUpdater {
|
||||
public:
|
||||
updater1(unsigned int& _a) :
|
||||
a(_a) {
|
||||
}
|
||||
|
||||
void operator()() {
|
||||
a++;
|
||||
}
|
||||
|
||||
void lastCall() {
|
||||
a++;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned int& a;
|
||||
};
|
||||
|
||||
class dummyInit: public eoInit<bitVector> {
|
||||
public:
|
||||
void operator()(bitVector& sol) {
|
||||
}
|
||||
};
|
||||
|
||||
class dummyInit2: public eoInit<bitVector> {
|
||||
|
||||
public:
|
||||
dummyInit2(unsigned int _size) :
|
||||
size(_size) {
|
||||
}
|
||||
|
||||
void operator()(bitVector& sol) {
|
||||
sol.resize(0);
|
||||
for (unsigned int i = 0; i < size; i++)
|
||||
sol.push_back(true);
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
#endif
|
||||
77
mo/test/t-moAdaptiveWalkSampling.cpp
Executable file
77
mo/test/t-moAdaptiveWalkSampling.cpp
Executable file
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
<t-moAdaptiveWalkSampling.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Boufaras Karima
|
||||
|
||||
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 <sampling/moAdaptiveWalkSampling.h>
|
||||
#include "moTestClass.h"
|
||||
#include <algo/moFirstImprHC.h>
|
||||
#include <eval/oneMaxEval.h>
|
||||
#include <continuator/moSolutionStat.h>
|
||||
#include <continuator/moCounterStat.h>
|
||||
#include <continuator/moIterContinuator.h>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moAdaptiveWalkSampling] => START" << std::endl;
|
||||
|
||||
bitNeighborhood nh(5);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(5);
|
||||
dummyInit2 init(5);
|
||||
moIterContinuator<bitNeighbor> cont(2);
|
||||
|
||||
moAdaptiveWalkSampling<bitNeighbor> test(init,nh,fullEval,eval,3);
|
||||
moCounterStat<bitVector> stat2;
|
||||
test.add(stat2);
|
||||
|
||||
test();
|
||||
|
||||
std::vector<double> res;
|
||||
std::vector<bitVector> res2;
|
||||
res = test.getValues(1);
|
||||
res2= test.getSolutions(0);
|
||||
|
||||
for (unsigned int i=0; i<res2.size(); i++)
|
||||
assert(res2[i].fitness()==5-i);
|
||||
|
||||
for (unsigned int i=0; i<res.size(); i++)
|
||||
assert(res[i]==i);
|
||||
|
||||
test.fileExport("outputTestAdaptativeWalkSampling1");
|
||||
test.fileExport(1, "outputTestAdaptativeWalkSampling2");
|
||||
|
||||
|
||||
std::cout << "[t-moAdaptiveWalkSampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
51
mo/test/t-moAlwaysAcceptCrit.cpp
Normal file
51
mo/test/t-moAlwaysAcceptCrit.cpp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
<t-moAlwaysAcceptCrit.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 <acceptCrit/moAlwaysAcceptCrit.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moAlwaysAcceptCrit] => START" << std::endl;
|
||||
|
||||
bitVector sol1, sol2;
|
||||
|
||||
moAlwaysAcceptCrit<bitNeighbor> test;
|
||||
|
||||
assert(test(sol1,sol2));
|
||||
|
||||
std::cout << "[t-moAlwaysAcceptCrit] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
58
mo/test/t-moAutocorrelationSampling.cpp
Normal file
58
mo/test/t-moAutocorrelationSampling.cpp
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
<t-moAutocorrelationSampling.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 <sampling/moAutocorrelationSampling.h>
|
||||
#include "moTestClass.h"
|
||||
#include <eval/oneMaxEval.h>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moAutocorrelationSampling] => START" << std::endl;
|
||||
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
dummyInit2 init(4);
|
||||
|
||||
moAutocorrelationSampling<bitNeighbor> test(init, nh, fullEval, eval, 3);
|
||||
|
||||
test();
|
||||
|
||||
test.fileExport("outputTestAutocorrelationSampling");
|
||||
|
||||
|
||||
std::cout << "[t-moAutocorrelationSampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
78
mo/test/t-moBestImprAspiration.cpp
Normal file
78
mo/test/t-moBestImprAspiration.cpp
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
<t-moBestImprAspiration.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 <memory/moBestImprAspiration.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moBestImprAspiration] => START" << std::endl;
|
||||
|
||||
moBestImprAspiration<bitNeighbor> test;
|
||||
eoBit<eoMinimizingFitness> sol1(4);
|
||||
eoBit<eoMinimizingFitness> sol2(4);
|
||||
eoBit<eoMinimizingFitness> sol3(4);
|
||||
eoBit<eoMinimizingFitness> sol4(4);
|
||||
bitNeighbor n1;
|
||||
bitNeighbor n2;
|
||||
bitNeighbor n3;
|
||||
bitNeighbor n4;
|
||||
|
||||
sol3[0]=true;
|
||||
sol4[3]=true;
|
||||
|
||||
sol1.fitness(4);
|
||||
sol2.fitness(5);
|
||||
sol3.fitness(3);
|
||||
sol4.fitness(3);
|
||||
n1.fitness(4);
|
||||
n2.fitness(5);
|
||||
n3.fitness(3);
|
||||
n4.fitness(3);
|
||||
|
||||
|
||||
//verification qu'on update bien le best so far quand il faut
|
||||
test.init(sol1);
|
||||
assert(test.getBest()==sol1);
|
||||
assert(!test(sol2,n2));
|
||||
assert(test(sol3,n3));
|
||||
test.update(sol3,n3);
|
||||
assert(test.getBest()==sol3);
|
||||
assert(!test(sol4,n4));
|
||||
test.update(sol4,n4);
|
||||
assert(test.getBest()==sol3);
|
||||
|
||||
std::cout << "[t-moBestImprAspiration] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
61
mo/test/t-moBetterAcceptCrit.cpp
Normal file
61
mo/test/t-moBetterAcceptCrit.cpp
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
<t-moBetterAcceptCrit.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 <comparator/moSolComparator.h>
|
||||
#include <acceptCrit/moBetterAcceptCrit.h>
|
||||
#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<bitVector> comparator;
|
||||
|
||||
moBetterAcceptCrit<bitNeighbor> test(comparator);
|
||||
|
||||
assert(test(sol2, sol1));
|
||||
assert(!test(sol1, sol2));
|
||||
assert(!test(sol2, sol3));
|
||||
|
||||
|
||||
std::cout << "[t-moBetterAcceptCrit] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
85
mo/test/t-moBitNeighbor.cpp
Normal file
85
mo/test/t-moBitNeighbor.cpp
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
<t-moBitNeighborh.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 use,
|
||||
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".
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited liability.
|
||||
|
||||
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 <problems/bitString/moBitNeighbor.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moBitNeighbor] => START" << std::endl;
|
||||
|
||||
//init sol
|
||||
eoBit<int> sol;
|
||||
sol.push_back(true);
|
||||
sol.push_back(false);
|
||||
sol.push_back(true);
|
||||
|
||||
//verif du constructeur vide
|
||||
moBitNeighbor<int> test1;
|
||||
assert(test1.index()==0);
|
||||
|
||||
//verif du setter d'index et du constructeur de copy
|
||||
test1.index(6);
|
||||
test1.fitness(2);
|
||||
moBitNeighbor<int> test2(test1);
|
||||
assert(test2.index()==6);
|
||||
assert(test2.fitness()==2);
|
||||
|
||||
//verif du getter
|
||||
assert(test1.index()==6);
|
||||
|
||||
//verif de l'operateur=
|
||||
test1.fitness(8);
|
||||
test1.index(2);
|
||||
test2=test1;
|
||||
assert(test2.fitness()==8);
|
||||
assert(test2.index()==2);
|
||||
|
||||
//verif de move
|
||||
test2.move(sol);
|
||||
assert(!sol[2]);
|
||||
|
||||
//verif de moveBack
|
||||
test2.moveBack(sol);
|
||||
assert(sol[2]);
|
||||
|
||||
test1.printOn(std::cout);
|
||||
test2.printOn(std::cout);
|
||||
|
||||
assert(test1.className()=="moBitNeighbor");
|
||||
std::cout << "[t-moBitNeighbor] => OK" << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
122
mo/test/t-moCheckpoint.cpp
Normal file
122
mo/test/t-moCheckpoint.cpp
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
<t-moCheckpoint.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 <continuator/moCheckpoint.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <continuator/moSolutionStat.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moCheckpoint] => START" << std::endl;
|
||||
|
||||
unsigned int a=2;
|
||||
unsigned int b=15;
|
||||
unsigned int c= 10;
|
||||
unsigned int d= 47;
|
||||
|
||||
eoBit<eoMinimizingFitness> s(3);
|
||||
s[0]=true;
|
||||
s[1]=true;
|
||||
s[2]=false;
|
||||
|
||||
s.fitness(17);
|
||||
|
||||
|
||||
//verification que toutes les operateurs sont bien apellés
|
||||
moSolutionStat< eoBit< eoMinimizingFitness > > stat;
|
||||
updater1 up1(a);
|
||||
updater1 up2(b);
|
||||
monitor1 mon1(c);
|
||||
monitor2 mon2(d);
|
||||
moTrueContinuator< bitNeighbor > cont;
|
||||
|
||||
moCheckpoint< bitNeighbor > test1(cont);
|
||||
moCheckpoint< bitNeighbor > test2(cont, 3);
|
||||
|
||||
test1.add(up1);
|
||||
test1.add(up2);
|
||||
test1.add(mon1);
|
||||
test1.add(mon2);
|
||||
test1.add(stat);
|
||||
|
||||
test2.add(up1);
|
||||
test2.add(up2);
|
||||
test2.add(mon1);
|
||||
test2.add(mon2);
|
||||
test2.add(stat);
|
||||
|
||||
test1.init(s);
|
||||
test1(s);
|
||||
assert(a==3 && b==16 && c==12 && d==49);
|
||||
assert(stat.value()[0]);
|
||||
assert(stat.value()[1]);
|
||||
assert(!stat.value()[2]);
|
||||
assert(stat.value().fitness()==17);
|
||||
|
||||
test1(s);
|
||||
assert(a==4 && b==17 && c==13 && d==50);
|
||||
assert(stat.value()[0]);
|
||||
assert(stat.value()[1]);
|
||||
assert(!stat.value()[2]);
|
||||
assert(stat.value().fitness()==17);
|
||||
|
||||
s.fitness(4);
|
||||
|
||||
test2.init(s);
|
||||
test2(s);
|
||||
assert(a==5 && b==18 && c==15 && d==52);
|
||||
assert(stat.value()[0]);
|
||||
assert(stat.value()[1]);
|
||||
assert(!stat.value()[2]);
|
||||
assert(stat.value().fitness()==4);
|
||||
|
||||
s.fitness(6);
|
||||
test2(s);
|
||||
assert(stat.value().fitness()==4);
|
||||
test2(s);
|
||||
assert(stat.value().fitness()==6);
|
||||
test2(s);
|
||||
assert(stat.value().fitness()==6);
|
||||
|
||||
test1.lastCall(s);
|
||||
assert(a==9 && b==22 && c==19 && d==56);
|
||||
test2.lastCall(s);
|
||||
assert(a==10 && b==23 && c==20 && d==57);
|
||||
|
||||
assert(test1.className()=="moCheckpoint");
|
||||
std::cout << "[t-moCheckpoint] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
65
mo/test/t-moCombinedContinuator.cpp
Normal file
65
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;
|
||||
}
|
||||
|
||||
91
mo/test/t-moCountMoveMemory.cpp
Normal file
91
mo/test/t-moCountMoveMemory.cpp
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
<t-moCountMoveMemory.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 <memory/moCountMoveMemory.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moCountMoveMemory] => START" << std::endl;
|
||||
|
||||
bitVector sol;
|
||||
bitNeighbor n;
|
||||
|
||||
|
||||
moCountMoveMemory<bitNeighbor> test;
|
||||
|
||||
test.init(sol);
|
||||
assert(test.getNbMove()==0);
|
||||
assert(test.getNbNoMove()==0);
|
||||
assert(test.getCounter()==0);
|
||||
|
||||
test.add(sol,n);
|
||||
assert(test.getNbMove()==1);
|
||||
assert(test.getNbNoMove()==0);
|
||||
assert(test.getCounter()==0);
|
||||
|
||||
test.add(sol,n);
|
||||
assert(test.getNbMove()==2);
|
||||
assert(test.getNbNoMove()==0);
|
||||
assert(test.getCounter()==0);
|
||||
|
||||
test.update(sol,n);
|
||||
assert(test.getNbMove()==2);
|
||||
assert(test.getNbNoMove()==1);
|
||||
assert(test.getCounter()==1);
|
||||
|
||||
test.add(sol,n);
|
||||
assert(test.getNbMove()==3);
|
||||
assert(test.getNbNoMove()==1);
|
||||
assert(test.getCounter()==0);
|
||||
|
||||
test.update(sol,n);
|
||||
assert(test.getNbMove()==3);
|
||||
assert(test.getNbNoMove()==2);
|
||||
assert(test.getCounter()==1);
|
||||
|
||||
test.update(sol,n);
|
||||
assert(test.getNbMove()==3);
|
||||
assert(test.getNbNoMove()==3);
|
||||
assert(test.getCounter()==2);
|
||||
|
||||
test.clearMemory();
|
||||
assert(test.getNbMove()==0);
|
||||
assert(test.getNbNoMove()==0);
|
||||
assert(test.getCounter()==0);
|
||||
|
||||
std::cout << "[t-moCountMoveMemory] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
71
mo/test/t-moCounterMonitorSaver.cpp
Normal file
71
mo/test/t-moCounterMonitorSaver.cpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
<t-moCounterMonitorSaver.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 <continuator/moCounterMonitorSaver.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moCounterMonitorSaver] => START" << std::endl;
|
||||
|
||||
unsigned int a=1;
|
||||
unsigned int b=10;
|
||||
|
||||
monitor1 mon1(a);
|
||||
monitor2 mon2(b);
|
||||
|
||||
moCounterMonitorSaver test(3, mon1);
|
||||
test.add(mon2);
|
||||
|
||||
//on verifie qu'on apelle les moniteurs seulement tout les 3 itération
|
||||
|
||||
test();
|
||||
assert(a==2 && b==11);
|
||||
test();
|
||||
assert(a==2 && b==11);
|
||||
test();
|
||||
assert(a==2 && b==11);
|
||||
test();
|
||||
assert(a==3 && b==12);
|
||||
|
||||
//test du lastCall
|
||||
test.lastCall();
|
||||
assert(a==4 && b==13);
|
||||
|
||||
assert(test.className()=="moCounterMonitorSaver");
|
||||
std::cout << "[t-moCounterMonitorSaver] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
62
mo/test/t-moCounterStat.cpp
Normal file
62
mo/test/t-moCounterStat.cpp
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
<t-moCounterStat.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/moCounterStat.h>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moCounterStat] => START" << std::endl;
|
||||
|
||||
moCounterStat<int> test;
|
||||
|
||||
int a=3;
|
||||
|
||||
test.init(a);
|
||||
assert(test.value()==0);
|
||||
a=5;
|
||||
test(a);
|
||||
assert(test.value()==1);
|
||||
a=-3;
|
||||
test(a);
|
||||
assert(test.value()==2);
|
||||
a=-12;
|
||||
test.init(a);
|
||||
assert(test.value()==0);
|
||||
|
||||
assert(test.className()=="moCounterStat");
|
||||
|
||||
std::cout << "[t-moCounterStat] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
54
mo/test/t-moDensityOfStatesSampling.cpp
Normal file
54
mo/test/t-moDensityOfStatesSampling.cpp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
<t-moDensityOfStatesSampling.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 <sampling/moDensityOfStatesSampling.h>
|
||||
#include "moTestClass.h"
|
||||
#include <eval/oneMaxEval.h>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDensityOfStatesSampling] => START" << std::endl;
|
||||
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
dummyInit2 init(4);
|
||||
|
||||
moDensityOfStatesSampling<bitNeighbor> test(init, fullEval, 3);
|
||||
test();
|
||||
|
||||
test.fileExport("outputTestDensityOfState");
|
||||
|
||||
std::cout << "[t-moDensityOfStatesSampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
73
mo/test/t-moDistanceStat.cpp
Normal file
73
mo/test/t-moDistanceStat.cpp
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
<t-moDistanceStat.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 <problems/bitString/moBitNeighbor.h>
|
||||
#include <continuator/moDistanceStat.h>
|
||||
#include <utils/eoDistance.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDistanceStat] => START" << std::endl;
|
||||
|
||||
eoBit<int> sol1;
|
||||
eoBit<int> sol2;
|
||||
eoBit<int> sol3;
|
||||
sol1.push_back(true);
|
||||
sol1.push_back(false);
|
||||
sol1.push_back(true);
|
||||
|
||||
sol2.push_back(true);
|
||||
sol2.push_back(true);
|
||||
sol2.push_back(false);
|
||||
|
||||
sol3.push_back(true);
|
||||
sol3.push_back(true);
|
||||
sol3.push_back(true);
|
||||
|
||||
//verification de la stat avec une distance de Hamming
|
||||
|
||||
eoHammingDistance< eoBit<int> > dist;
|
||||
|
||||
moDistanceStat< eoBit<int> > test(dist, sol1);
|
||||
|
||||
test(sol2);
|
||||
assert(test.value()==2);
|
||||
test(sol3);
|
||||
assert(test.value()==1);
|
||||
|
||||
assert(test.className()=="moDistanceStat");
|
||||
std::cout << "[t-moDistanceStat] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
46
mo/test/t-moDummyEval.cpp
Normal file
46
mo/test/t-moDummyEval.cpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
<t-moDummyEval.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/moDummyEval.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDummyEval] => START" << std::endl;
|
||||
|
||||
moDummyEval<bitNeighbor> test;
|
||||
|
||||
std::cout << "[t-moDummyEval] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
49
mo/test/t-moDummyExplorer.cpp
Normal file
49
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
mo/test/t-moDummyLS.cpp
Normal file
51
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;
|
||||
}
|
||||
|
||||
63
mo/test/t-moDummyMemory.cpp
Normal file
63
mo/test/t-moDummyMemory.cpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
<t-moDummyMemory.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 <memory/moDummyIntensification.h>
|
||||
#include <memory/moDummyDiversification.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDummyMemory] => START" << std::endl;
|
||||
|
||||
eoBit<eoMinimizingFitness> sol(4);
|
||||
bitNeighbor n;
|
||||
moDummyDiversification<bitNeighbor> test1;
|
||||
test1.init(sol);
|
||||
test1.add(sol, n);
|
||||
test1.update(sol, n);
|
||||
test1.clearMemory();
|
||||
assert(!test1(sol));
|
||||
|
||||
moDummyIntensification<bitNeighbor> test2;
|
||||
test2.init(sol);
|
||||
test2.add(sol, n);
|
||||
test2.update(sol, n);
|
||||
test2.clearMemory();
|
||||
assert(!test2(sol));
|
||||
|
||||
|
||||
std::cout << "[t-moDummyMemory] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
46
mo/test/t-moDummyNeighbor.cpp
Normal file
46
mo/test/t-moDummyNeighbor.cpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
<t-moDummyNeighbor.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 <neighborhood/moDummyNeighbor.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDummyNeighbor] => START" << std::endl;
|
||||
|
||||
moDummyNeighbor<bitVector> test;
|
||||
|
||||
std::cout << "[t-moDummyNeighbor] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue