Encore du nettoyage
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1814 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
3d8057ac4d
commit
02e5cfb6c0
66 changed files with 987 additions and 1785 deletions
|
|
@ -34,18 +34,18 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <acceptCrit/moAlwaysAcceptCrit.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moAlwaysAcceptCrit] => START" << std::endl;
|
||||
std::cout << "[t-moAlwaysAcceptCrit] => START" << std::endl;
|
||||
|
||||
bitVector sol1, sol2;
|
||||
bitVector sol1, sol2;
|
||||
|
||||
moAlwaysAcceptCrit<bitNeighbor> test;
|
||||
moAlwaysAcceptCrit<bitNeighbor> test;
|
||||
|
||||
assert(test(sol1,sol2));
|
||||
assert(test(sol1,sol2));
|
||||
|
||||
std::cout << "[t-moAlwaysAcceptCrit] => OK" << std::endl;
|
||||
std::cout << "[t-moAlwaysAcceptCrit] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,24 +35,24 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include "moTestClass.h"
|
||||
#include <eval/oneMaxEval.h>
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moAutocorrelationSampling] => START" << std::endl;
|
||||
std::cout << "[t-moAutocorrelationSampling] => START" << std::endl;
|
||||
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
dummyInit2 init(4);
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
dummyInit2 init(4);
|
||||
|
||||
moAutocorrelationSampling<bitNeighbor> test(init, nh, fullEval, eval, 3);
|
||||
moAutocorrelationSampling<bitNeighbor> test(init, nh, fullEval, eval, 3);
|
||||
|
||||
test();
|
||||
test();
|
||||
|
||||
test.fileExport("outputTestAutocorrelationSampling");
|
||||
test.fileExport("outputTestAutocorrelationSampling");
|
||||
|
||||
|
||||
std::cout << "[t-moAutocorrelationSampling] => OK" << std::endl;
|
||||
std::cout << "[t-moAutocorrelationSampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,27 +35,27 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <acceptCrit/moBetterAcceptCrit.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moBetterAcceptCrit] => START" << std::endl;
|
||||
std::cout << "[t-moBetterAcceptCrit] => START" << std::endl;
|
||||
|
||||
bitVector sol1, sol2, sol3;
|
||||
bitVector sol1, sol2, sol3;
|
||||
|
||||
sol1.fitness(2);
|
||||
sol2.fitness(3);
|
||||
sol3.fitness(3);
|
||||
sol1.fitness(2);
|
||||
sol2.fitness(3);
|
||||
sol3.fitness(3);
|
||||
|
||||
moSolComparator<bitVector> comparator;
|
||||
moSolComparator<bitVector> comparator;
|
||||
|
||||
moBetterAcceptCrit<bitNeighbor> test(comparator);
|
||||
moBetterAcceptCrit<bitNeighbor> test(comparator);
|
||||
|
||||
assert(test(sol2, sol1));
|
||||
assert(!test(sol1, sol2));
|
||||
assert(!test(sol2, sol3));
|
||||
assert(test(sol2, sol1));
|
||||
assert(!test(sol1, sol2));
|
||||
assert(!test(sol2, sol3));
|
||||
|
||||
|
||||
std::cout << "[t-moBetterAcceptCrit] => OK" << std::endl;
|
||||
std::cout << "[t-moBetterAcceptCrit] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include "moTestClass.h"
|
||||
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moCombinedContinuator] => START" << std::endl;
|
||||
std::cout << "[t-moCombinedContinuator] => START" << std::endl;
|
||||
|
||||
moIterContinuator<moDummyNeighborTest> cont1(3, false);
|
||||
moTrueContinuator<moDummyNeighborTest> cont2;
|
||||
|
|
@ -58,8 +58,8 @@ int main(){
|
|||
assert(test(s));
|
||||
assert(!test(s));
|
||||
|
||||
std::cout << "[t-moCombinedContinuator] => OK" << std::endl;
|
||||
std::cout << "[t-moCombinedContinuator] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,58 +34,58 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <memory/moCountMoveMemory.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moCountMoveMemory] => START" << std::endl;
|
||||
std::cout << "[t-moCountMoveMemory] => START" << std::endl;
|
||||
|
||||
bitVector sol;
|
||||
bitNeighbor n;
|
||||
bitVector sol;
|
||||
bitNeighbor n;
|
||||
|
||||
|
||||
moCountMoveMemory<bitNeighbor> test;
|
||||
moCountMoveMemory<bitNeighbor> test;
|
||||
|
||||
test.init(sol);
|
||||
assert(test.getNbMove()==0);
|
||||
assert(test.getNbNoMove()==0);
|
||||
assert(test.getCounter()==0);
|
||||
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()==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.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.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.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()==2);
|
||||
assert(test.getCounter()==1);
|
||||
|
||||
test.update(sol,n);
|
||||
assert(test.getNbMove()==3);
|
||||
assert(test.getNbNoMove()==3);
|
||||
assert(test.getCounter()==2);
|
||||
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);
|
||||
test.clearMemory();
|
||||
assert(test.getNbMove()==0);
|
||||
assert(test.getNbNoMove()==0);
|
||||
assert(test.getCounter()==0);
|
||||
|
||||
std::cout << "[t-moCountMoveMemory] => OK" << std::endl;
|
||||
std::cout << "[t-moCountMoveMemory] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,30 +33,30 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
|
||||
#include <continuator/moCounterStat.h>
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moCounterStat] => START" << std::endl;
|
||||
std::cout << "[t-moCounterStat] => START" << std::endl;
|
||||
|
||||
moCounterStat<int> test;
|
||||
moCounterStat<int> test;
|
||||
|
||||
int a=3;
|
||||
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);
|
||||
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");
|
||||
assert(test.className()=="moCounterStat");
|
||||
|
||||
std::cout << "[t-moCounterStat] => OK" << std::endl;
|
||||
std::cout << "[t-moCounterStat] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,20 +35,20 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include "moTestClass.h"
|
||||
#include <eval/oneMaxEval.h>
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDensityOfStatesSampling] => START" << std::endl;
|
||||
std::cout << "[t-moDensityOfStatesSampling] => START" << std::endl;
|
||||
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
dummyInit2 init(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
dummyInit2 init(4);
|
||||
|
||||
moDensityOfStatesSampling<bitNeighbor> test(init, fullEval, 3);
|
||||
test();
|
||||
moDensityOfStatesSampling<bitNeighbor> test(init, fullEval, 3);
|
||||
test();
|
||||
|
||||
test.fileExport("outputTestDensityOfState");
|
||||
test.fileExport("outputTestDensityOfState");
|
||||
|
||||
std::cout << "[t-moDensityOfStatesSampling] => OK" << std::endl;
|
||||
std::cout << "[t-moDensityOfStatesSampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <eval/moDummyEval.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDummyEval] => START" << std::endl;
|
||||
std::cout << "[t-moDummyEval] => START" << std::endl;
|
||||
|
||||
moDummyEval<bitNeighbor> test;
|
||||
moDummyEval<bitNeighbor> test;
|
||||
|
||||
std::cout << "[t-moDummyEval] => OK" << std::endl;
|
||||
std::cout << "[t-moDummyEval] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,16 +34,16 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <explorer/moDummyExplorer.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDummyExplorer] => START" << std::endl;
|
||||
std::cout << "[t-moDummyExplorer] => START" << std::endl;
|
||||
|
||||
moDummyExplorer<bitNeighbor> test;
|
||||
moDummyExplorer<bitNeighbor> test;
|
||||
|
||||
assert(test.className()=="moDummyExplorer");
|
||||
assert(test.className()=="moDummyExplorer");
|
||||
|
||||
std::cout << "[t-moDummyExplorer] => OK" << std::endl;
|
||||
std::cout << "[t-moDummyExplorer] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,17 +35,17 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include "moTestClass.h"
|
||||
#include <eval/oneMaxEval.h>
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDummyLS] => START" << std::endl;
|
||||
std::cout << "[t-moDummyLS] => START" << std::endl;
|
||||
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
moDummyLS<bitNeighbor> test(fullEval);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
moDummyLS<bitNeighbor> test(fullEval);
|
||||
|
||||
assert(test.className()=="moDummyLS");
|
||||
assert(test.className()=="moDummyLS");
|
||||
|
||||
std::cout << "[t-moDummyLS] => OK" << std::endl;
|
||||
std::cout << "[t-moDummyLS] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <neighborhood/moDummyNeighbor.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
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;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,23 +34,23 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <neighborhood/moDummyNeighborhood.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moDummyNeighborhood] => START" << std::endl;
|
||||
std::cout << "[t-moDummyNeighborhood] => START" << std::endl;
|
||||
|
||||
bitVector sol;
|
||||
moDummyNeighbor<bitVector> n;
|
||||
bitVector sol;
|
||||
moDummyNeighbor<bitVector> n;
|
||||
|
||||
moDummyNeighborhood<moDummyNeighbor<bitVector> > test;
|
||||
moDummyNeighborhood<moDummyNeighbor<bitVector> > test;
|
||||
|
||||
assert(!test.hasNeighbor(sol));
|
||||
assert(!test.cont(sol));
|
||||
test.init(sol,n);
|
||||
test.next(sol,n);
|
||||
assert(!test.hasNeighbor(sol));
|
||||
assert(!test.cont(sol));
|
||||
test.init(sol,n);
|
||||
test.next(sol,n);
|
||||
|
||||
|
||||
std::cout << "[t-moDummyNeighborhood] => OK" << std::endl;
|
||||
std::cout << "[t-moDummyNeighborhood] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,33 +34,33 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <eval/moEvalCounter.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moEvalCounter] => START" << std::endl;
|
||||
std::cout << "[t-moEvalCounter] => START" << std::endl;
|
||||
|
||||
evalOneMax eval(4);
|
||||
bitVector sol;
|
||||
sol.resize(4);
|
||||
sol[0]=true;
|
||||
sol[1]=false;
|
||||
sol[2]=true;
|
||||
sol[3]=true;
|
||||
sol.fitness(3);
|
||||
bitNeighbor n;
|
||||
n.index(2);
|
||||
evalOneMax eval(4);
|
||||
bitVector sol;
|
||||
sol.resize(4);
|
||||
sol[0]=true;
|
||||
sol[1]=false;
|
||||
sol[2]=true;
|
||||
sol[3]=true;
|
||||
sol.fitness(3);
|
||||
bitNeighbor n;
|
||||
n.index(2);
|
||||
|
||||
moEvalCounter<bitNeighbor> test(eval);
|
||||
moEvalCounter<bitNeighbor> test(eval);
|
||||
|
||||
test(sol,n);
|
||||
assert(test.value()==1);
|
||||
assert(n.fitness()==2);
|
||||
n.index(1);
|
||||
test(sol,n);
|
||||
assert(test.value()==2);
|
||||
assert(n.fitness()==4);
|
||||
test(sol,n);
|
||||
assert(test.value()==1);
|
||||
assert(n.fitness()==2);
|
||||
n.index(1);
|
||||
test(sol,n);
|
||||
assert(test.value()==2);
|
||||
assert(n.fitness()==4);
|
||||
|
||||
std::cout << "[t-moEvalCounter] => OK" << std::endl;
|
||||
std::cout << "[t-moEvalCounter] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,25 +37,25 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <utils/eoDistance.h>
|
||||
#include <eval/oneMaxEval.h>
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moFDCsampling] => START" << std::endl;
|
||||
std::cout << "[t-moFDCsampling] => START" << std::endl;
|
||||
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
dummyInit2 init(4);
|
||||
eoHammingDistance<bitVector> dist;
|
||||
bitVector sol(4, false);
|
||||
sol.fitness(0);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
dummyInit2 init(4);
|
||||
eoHammingDistance<bitVector> dist;
|
||||
bitVector sol(4, false);
|
||||
sol.fitness(0);
|
||||
|
||||
|
||||
moFDCsampling<bitNeighbor> test(init, fullEval, dist, sol, 3);
|
||||
moFDCsampling<bitNeighbor> test(init, fullEval, dist, sol, 3);
|
||||
|
||||
test();
|
||||
test();
|
||||
|
||||
test.fileExport("outputTestFDCsampling");
|
||||
test.fileExport("outputTestFDCsampling");
|
||||
|
||||
std::cout << "[t-moFDCsampling] => OK" << std::endl;
|
||||
std::cout << "[t-moFDCsampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,28 +37,28 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <continuator/moTrueContinuator.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moFirstImprHC] => START" << std::endl;
|
||||
std::cout << "[t-moFirstImprHC] => START" << std::endl;
|
||||
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
|
||||
//test first constructor
|
||||
moFirstImprHC<bitNeighbor> test1(nh, fullEval, eval);
|
||||
//test first constructor
|
||||
moFirstImprHC<bitNeighbor> test1(nh, fullEval, eval);
|
||||
|
||||
//test second constructor
|
||||
moTrueContinuator<bitNeighbor> cont;
|
||||
moFirstImprHC<bitNeighbor> test2(nh, fullEval, eval, cont);
|
||||
//test second constructor
|
||||
moTrueContinuator<bitNeighbor> cont;
|
||||
moFirstImprHC<bitNeighbor> test2(nh, fullEval, eval, cont);
|
||||
|
||||
//test third constructor
|
||||
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||
moNeighborComparator<bitNeighbor> ncomp;
|
||||
moFirstImprHC<bitNeighbor> test3(nh, fullEval, eval, cont, ncomp, sncomp);
|
||||
//test third constructor
|
||||
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||
moNeighborComparator<bitNeighbor> ncomp;
|
||||
moFirstImprHC<bitNeighbor> test3(nh, fullEval, eval, cont, ncomp, sncomp);
|
||||
|
||||
std::cout << "[t-moFirstImprHC] => OK" << std::endl;
|
||||
std::cout << "[t-moFirstImprHC] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,28 +34,28 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <continuator/moFitContinuator.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moFitContinuator] => START" << std::endl;
|
||||
std::cout << "[t-moFitContinuator] => START" << std::endl;
|
||||
|
||||
moFitContinuator<bitNeighbor> test1(3);
|
||||
moFitContinuator<moDummyNeighborTest> test2(5);
|
||||
moFitContinuator<bitNeighbor> test1(3);
|
||||
moFitContinuator<moDummyNeighborTest> test2(5);
|
||||
|
||||
bitVector sol1;
|
||||
Solution sol2;
|
||||
bitVector sol1;
|
||||
Solution sol2;
|
||||
|
||||
sol1.fitness(4);
|
||||
assert(test1(sol1));
|
||||
sol1.fitness(3);
|
||||
assert(!test1(sol1));
|
||||
sol1.fitness(4);
|
||||
assert(test1(sol1));
|
||||
sol1.fitness(3);
|
||||
assert(!test1(sol1));
|
||||
|
||||
sol2.fitness(3);
|
||||
assert(test2(sol2));
|
||||
sol2.fitness(5);
|
||||
assert(!test2(sol2));
|
||||
sol2.fitness(3);
|
||||
assert(test2(sol2));
|
||||
sol2.fitness(5);
|
||||
assert(!test2(sol2));
|
||||
|
||||
std::cout << "[t-moFitContinuator] => OK" << std::endl;
|
||||
std::cout << "[t-moFitContinuator] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,36 +40,36 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <eval/oneMaxEval.h>
|
||||
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moFitnessCloudSampling] => START" << std::endl;
|
||||
std::cout << "[t-moFitnessCloudSampling] => START" << std::endl;
|
||||
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
dummyInit2 init(4);
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
dummyInit2 init(4);
|
||||
|
||||
moFitnessCloudSampling<bitNeighbor> test1(init, nh, fullEval, eval, 3);
|
||||
moFitnessCloudSampling<bitNeighbor> test1(init, nh, fullEval, eval, 3);
|
||||
|
||||
moRndRndFitnessCloudSampling<bitNeighbor> test2(init, nh, fullEval, eval, 3);
|
||||
moRndRndFitnessCloudSampling<bitNeighbor> test2(init, nh, fullEval, eval, 3);
|
||||
|
||||
moRndBestFitnessCloudSampling<bitNeighbor> test3(init, nh, fullEval, eval, 3);
|
||||
moRndBestFitnessCloudSampling<bitNeighbor> test3(init, nh, fullEval, eval, 3);
|
||||
|
||||
moMHRndFitnessCloudSampling<bitNeighbor> test4(init, nh, fullEval, eval, 3);
|
||||
moMHRndFitnessCloudSampling<bitNeighbor> test4(init, nh, fullEval, eval, 3);
|
||||
|
||||
moMHBestFitnessCloudSampling<bitNeighbor> test5(init, nh, fullEval, eval, 3);
|
||||
moMHBestFitnessCloudSampling<bitNeighbor> test5(init, nh, fullEval, eval, 3);
|
||||
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
test4();
|
||||
test5();
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
test4();
|
||||
test5();
|
||||
|
||||
test1.fileExport("outputTestFitnessCloudSampling");
|
||||
test1.fileExport("outputTestFitnessCloudSampling");
|
||||
|
||||
|
||||
std::cout << "[t-moFitnessCloudSampling] => OK" << std::endl;
|
||||
std::cout << "[t-moFitnessCloudSampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,19 +37,19 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
|
||||
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moForwardVariableNeighborhood] => START" << std::endl;
|
||||
std::cout << "[t-moForwardVariableNeighborhood] => START" << std::endl;
|
||||
|
||||
moRndWithoutReplNeighborhood<bitNeighbor> rndNH(8);
|
||||
moOrderNeighborhood<moIndexNeighbor<eoBit<eoMinimizingFitness> > >orderNH(8);
|
||||
moRndWithoutReplNeighborhood<bitNeighbor> rndNH(8);
|
||||
moOrderNeighborhood<moIndexNeighbor<eoBit<eoMinimizingFitness> > >orderNH(8);
|
||||
|
||||
|
||||
//moForwardVariableNeighborhood<eoBit<eoMinimizingFitness>, eoMinimizingFitness> test(orderNH);
|
||||
//moForwardVariableNeighborhood<eoBit<eoMinimizingFitness>, eoMinimizingFitness> test(orderNH);
|
||||
|
||||
|
||||
std::cout << "[t-moForwardVariableNeighborhood] => OK" << std::endl;
|
||||
std::cout << "[t-moForwardVariableNeighborhood] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,36 +35,36 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <eval/oneMaxEval.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moFullEvalContinuator] => START" << std::endl;
|
||||
std::cout << "[t-moFullEvalContinuator] => START" << std::endl;
|
||||
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
eoEvalFuncCounter<bitVector> evalCount(fullEval);
|
||||
moFullEvalContinuator<bitNeighbor> test(evalCount, 3);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
eoEvalFuncCounter<bitVector> evalCount(fullEval);
|
||||
moFullEvalContinuator<bitNeighbor> test(evalCount, 3);
|
||||
|
||||
bitVector sol;
|
||||
sol.push_back(1);
|
||||
bitVector sol;
|
||||
sol.push_back(1);
|
||||
|
||||
|
||||
test.init(sol);
|
||||
evalCount(sol);
|
||||
sol.invalidate();
|
||||
assert(test.value()==1);
|
||||
evalCount(sol);
|
||||
sol.invalidate();
|
||||
assert(test.value()==2);
|
||||
assert(test(sol));
|
||||
evalCount(sol);
|
||||
sol.invalidate();
|
||||
assert(test.value()==3);
|
||||
assert(!test(sol));
|
||||
test.init(sol);
|
||||
assert(test.value()==0);
|
||||
assert(test(sol));
|
||||
test.init(sol);
|
||||
evalCount(sol);
|
||||
sol.invalidate();
|
||||
assert(test.value()==1);
|
||||
evalCount(sol);
|
||||
sol.invalidate();
|
||||
assert(test.value()==2);
|
||||
assert(test(sol));
|
||||
evalCount(sol);
|
||||
sol.invalidate();
|
||||
assert(test.value()==3);
|
||||
assert(!test(sol));
|
||||
test.init(sol);
|
||||
assert(test.value()==0);
|
||||
assert(test(sol));
|
||||
|
||||
std::cout << "[t-moFullEvalContinuator] => OK" << std::endl;
|
||||
std::cout << "[t-moFullEvalContinuator] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,23 +35,23 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include "moTestClass.h"
|
||||
#include <eval/oneMaxEval.h>
|
||||
|
||||
int main(){
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moHillClimberSampling] => START" << std::endl;
|
||||
std::cout << "[t-moHillClimberSampling] => START" << std::endl;
|
||||
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
dummyInit2 init(4);
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
dummyInit2 init(4);
|
||||
|
||||
moHillClimberSampling<bitNeighbor> test(init, nh, fullEval, eval, 3);
|
||||
moHillClimberSampling<bitNeighbor> test(init, nh, fullEval, eval, 3);
|
||||
|
||||
test();
|
||||
test();
|
||||
|
||||
test.fileExport("outputTestHillClimberSampling");
|
||||
test.fileExport("outputTestHillClimberSampling");
|
||||
|
||||
std::cout << "[t-moHillClimberSampling] => OK" << std::endl;
|
||||
std::cout << "[t-moHillClimberSampling] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
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