test updated
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1803 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
1cc70b9d91
commit
193e016083
5 changed files with 43 additions and 1 deletions
|
|
@ -72,7 +72,7 @@
|
|||
#include <continuator/moStdFitnessNeighborStat.h>
|
||||
#include <continuator/moSizeNeighborStat.h>
|
||||
#include <continuator/moCounterStat.h>
|
||||
#include <continuator/moCounterMinusOneStat.h>
|
||||
#include <continuator/moMinusOneCounterStat.h>
|
||||
#include <continuator/moSolutionStat.h>
|
||||
#include <continuator/moStat.h>
|
||||
#include <continuator/moStatBase.h>
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ SET (TEST_LIST
|
|||
t-moDummyExplorer
|
||||
t-moLocalSearchInit
|
||||
t-moSolInit
|
||||
t-moEvalCounter
|
||||
)
|
||||
|
||||
FOREACH (test ${TEST_LIST})
|
||||
|
|
|
|||
|
|
@ -32,11 +32,32 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <cassert>
|
||||
|
||||
#include <eval/moEvalCounter.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
int main(){
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
std::cout << "[t-moEvalCounter] => OK" << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,30 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include <algo/moRandomNeutralWalk.h>
|
||||
#include "moTestClass.h"
|
||||
#include <eval/oneMaxEval.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moRandomNeutralWalk] => START" << std::endl;
|
||||
|
||||
bitNeighborhood nh(4);
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
evalOneMax eval(4);
|
||||
moTrueContinuator<bitNeighbor> cont;
|
||||
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||
|
||||
//test du 1er constructeur
|
||||
moRandomNeutralWalk<bitNeighbor> test1(nh, fullEval, eval, 3);
|
||||
|
||||
//test du 2eme constructeur
|
||||
moRandomNeutralWalk<bitNeighbor> test2(nh, fullEval, eval, 3, cont);
|
||||
|
||||
//test du 3eme constructeur
|
||||
moRandomNeutralWalk<bitNeighbor> test3(nh, fullEval, eval, 3, cont, sncomp);
|
||||
|
||||
std::cout << "[t-moRandomNeutralWalk] => OK" << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
int main(){
|
||||
|
||||
std::cout << "[t-moRandomSearch] => START" << std::endl;
|
||||
|
||||
oneMaxEval<bitVector> fullEval;
|
||||
dummyInit init;
|
||||
moTrueContinuator<bitNeighbor> cont;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue