Doc and tests added
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1706 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
6cb6070df4
commit
baf31d0c30
25 changed files with 159 additions and 26 deletions
|
|
@ -38,6 +38,7 @@ int main(){
|
|||
|
||||
std::cout << "[t-moMetropolisHastingExplorer] => START" << std::endl;
|
||||
|
||||
//Instanciation
|
||||
eoBit<eoMinimizingFitness> sol(4, true);
|
||||
sol.fitness(4);
|
||||
bitNeighborhood nh(4);
|
||||
|
|
@ -47,6 +48,7 @@ int main(){
|
|||
|
||||
moMetropolisHastingExplorer<bitNeighborhood> test(nh, eval, ncomp, sncomp, 3);
|
||||
|
||||
//test de l'acceptation d'un voisin améliorant
|
||||
test.initParam(sol);
|
||||
test(sol);
|
||||
assert(test.accept(sol));
|
||||
|
|
@ -57,6 +59,7 @@ int main(){
|
|||
|
||||
unsigned int oui=0, non=0;
|
||||
|
||||
//test de l'acceptation d'un voisin non améliorant
|
||||
for(unsigned int i=0; i<1000; i++){
|
||||
test(sol);
|
||||
if(test.accept(sol))
|
||||
|
|
@ -70,11 +73,13 @@ int main(){
|
|||
|
||||
assert(oui > 700 && oui < 800); //verification grossiere
|
||||
|
||||
//test du critere d'arret
|
||||
test.updateParam(sol);
|
||||
assert(test.isContinue(sol));
|
||||
test.updateParam(sol);
|
||||
assert(!test.isContinue(sol));
|
||||
|
||||
//test de l'acceptation d'un voisin
|
||||
sol[0]=false;
|
||||
sol[1]=false;
|
||||
sol[2]=false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue