From c51f7a8962af41db5d6466644ac0730f4c37ff40 Mon Sep 17 00:00:00 2001 From: jhumeau Date: Thu, 27 May 2010 14:48:44 +0000 Subject: [PATCH] Debug neighborTabuList, index was not initialized git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1836 331e1502-861f-0410-8da2-ba01fb791d7f --- .../src/memory/moNeighborVectorTabuList.h | 4 +-- .../test/t-moNeighborVectorTabuList.cpp | 25 +++---------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/trunk/paradiseo-mo/src/memory/moNeighborVectorTabuList.h b/trunk/paradiseo-mo/src/memory/moNeighborVectorTabuList.h index 392cf0bd8..dbf8edb0f 100644 --- a/trunk/paradiseo-mo/src/memory/moNeighborVectorTabuList.h +++ b/trunk/paradiseo-mo/src/memory/moNeighborVectorTabuList.h @@ -48,7 +48,7 @@ public: * @param _maxSize maximum size of the tabu list * @param _howlong how many iteration a move is tabu (0 -> no limits) */ - moNeighborVectorTabuList(unsigned int _maxSize, unsigned int _howlong) : maxSize(_maxSize), howlong(_howlong) { + moNeighborVectorTabuList(unsigned int _maxSize, unsigned int _howlong) : maxSize(_maxSize), howlong(_howlong), index(0) { tabuList.reserve(_maxSize); tabuList.resize(0); } @@ -119,7 +119,7 @@ public: void print(){ std::cout << "TAbulist:" << std::endl; for(int i=0; i n2 and n3 must be tabu test.add(sol, n3); - if(test.check(sol, n1)) - std::cout << "n1 is in tabuList" << std::endl; - if(test.check(sol, n2)) - std::cout << "n2 is in tabuList" << std::endl; - if(test.check(sol, n3)) - std::cout << "n3 is in tabuList" << std::endl; - if(test.check(sol, n4)) - std::cout << "n4 is in tabuList" << std::endl; - - test.print(); - -// assert(!test.check(sol, n1)); -// assert(test.check(sol, n2)); -// assert(test.check(sol, n3)); -// assert(!test.check(sol, n4)); + assert(!test.check(sol, n1)); + assert(test.check(sol, n2)); + assert(test.check(sol, n3)); + assert(!test.check(sol, n4)); //clear tabu list all neighbor must not be tabu test.init(sol);