diff --git a/trunk/paradiseo-mo/src/eval/moDoubleIncrEvaluation.h b/trunk/paradiseo-mo/src/eval/moDoubleIncrEvaluation.h index 1f4ce3b24..c7027e2b8 100644 --- a/trunk/paradiseo-mo/src/eval/moDoubleIncrEvaluation.h +++ b/trunk/paradiseo-mo/src/eval/moDoubleIncrEvaluation.h @@ -44,7 +44,7 @@ * The sizes of the neighborhoods are equal */ template -class moDoubleIncrEvaluation : public moNeighborhoodEvaluation, moUpdater +class moDoubleIncrEvaluation : public moNeighborhoodEvaluation, public moUpdater { public: typedef typename Neighbor::EOT EOT; @@ -76,6 +76,9 @@ public: firstEval = true; } + virtual void operator()() { + } + /** * Evaluation of the neighborhood * Here nothing to do diff --git a/trunk/paradiseo-mo/src/eval/moUBQPdoubleIncrEvaluation.h b/trunk/paradiseo-mo/src/eval/moUBQPdoubleIncrEvaluation.h index 6c8016058..52a54b268 100644 --- a/trunk/paradiseo-mo/src/eval/moUBQPdoubleIncrEvaluation.h +++ b/trunk/paradiseo-mo/src/eval/moUBQPdoubleIncrEvaluation.h @@ -62,12 +62,16 @@ public: * @param _searchExplorer the neighborhood explorer of the local search * @param _incrEval the incremental evaluation of the UBQP */ - moUBQPdoubleIncrEvaluation(unsigned int _neighborhoodSize, moNeighborhoodExplorer & _searchExplorer, moEval & _incrEval) : moDoubleIncrEvaluation(_neighborhoodSize), searchExplorer(_searchExplorer) + // moUBQPdoubleIncrEvaluation(unsigned int _neighborhoodSize, moNeighborhoodExplorer & _searchExplorer, moEval & _incrEval) : moDoubleIncrEvaluation(_neighborhoodSize), searchExplorer(_searchExplorer) + moUBQPdoubleIncrEvaluation(unsigned int _neighborhoodSize, moUBQPSimpleIncrEval & _incrEval) : moDoubleIncrEvaluation(_neighborhoodSize), searchExplorer(NULL) { n = _incrEval.getNbVar(); Q = _incrEval.getQ(); } + void neighborhoodExplorer(moNeighborhoodExplorer & _searchExplorer) { + searchExplorer = & _searchExplorer; + } /** * Evaluation of the neighborhood @@ -100,11 +104,11 @@ public: } } else { - if (searchExplorer.moveApplied()) { // compute the new fitness only when the solution has moved + if (searchExplorer->moveApplied()) { // compute the new fitness only when the solution has moved // the currentNeighbor is the previous neighbor // the movement is made on this neighbor // we suppose that the neighborhood is bit string neighborhood (indexed neighbor) - unsigned iMove = searchExplorer.currentNeighbor.index(); + unsigned iMove = searchExplorer->getCurrentNeighbor().index(); for(unsigned i = 0; i < n; i++) { if (i == iMove) @@ -202,7 +206,7 @@ private: int ** Q; /** The search explorer of the local search */ - moNeighborhoodExplorer & searchExplorer; + moNeighborhoodExplorer * searchExplorer; }; #endif diff --git a/trunk/paradiseo-mo/src/explorer/moNeighborhoodExplorer.h b/trunk/paradiseo-mo/src/explorer/moNeighborhoodExplorer.h index 20cba925a..c9be41188 100644 --- a/trunk/paradiseo-mo/src/explorer/moNeighborhoodExplorer.h +++ b/trunk/paradiseo-mo/src/explorer/moNeighborhoodExplorer.h @@ -125,6 +125,14 @@ public: isMoved=_isMoved; } + /** + * Getter of the current neighbor + * @return current neighbor + */ + Neighbor & getCurrentNeighbor() { + return currentNeighbor; + } + protected: // default class for the empty constructor moDummyNeighborhood dummyNeighborhood;