Debug some new class

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2554 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
verel 2011-12-08 22:39:11 +00:00
commit 05a41c7592
4 changed files with 17 additions and 10 deletions

View file

@ -96,7 +96,7 @@ public :
* add a MO updater to the checkpoint * add a MO updater to the checkpoint
* @param _moupd an mo updater * @param _moupd an mo updater
*/ */
void add(eoUpdater& _moupd) { void add(moUpdater& _moupd) {
moupdaters.push_back(&_moupd); moupdaters.push_back(&_moupd);
} }

View file

@ -47,12 +47,15 @@ template<class Neighbor>
class moDoubleIncrEvaluation : public moNeighborhoodEvaluation<Neighbor>, moUpdater class moDoubleIncrEvaluation : public moNeighborhoodEvaluation<Neighbor>, moUpdater
{ {
public: public:
typedef typename Neighbor::EOT EOT;
typedef typename EOT::Fitness Fitness;
/** /**
* Constructor * Constructor
* *
* @param _neighborhoodSize the size of the neighborhood * @param _neighborhoodSize the size of the neighborhood
*/ */
moDoubleIncrEvaluation(unsigned int _neighborhoodSize) : moNeighborhoodEvaluation<Neighbor>, moUpdater(), neighborhoodSize(_neighborhoodSize), firstEval(true) { moDoubleIncrEvaluation(unsigned int _neighborhoodSize) : moNeighborhoodEvaluation<Neighbor>(), moUpdater(), neighborhoodSize(_neighborhoodSize), firstEval(true) {
deltaFitness = new Fitness[neighborhoodSize]; deltaFitness = new Fitness[neighborhoodSize];
} }
@ -79,7 +82,7 @@ public:
* *
* @param _solution the current solution * @param _solution the current solution
*/ */
virtual operator()(EOT & _solution) { virtual void operator()(EOT & _solution) {
} }
/** the delta of fitness for each neighbors /** the delta of fitness for each neighbors

View file

@ -36,7 +36,7 @@
#define moDoubleIncrNeighborhoodEval_H #define moDoubleIncrNeighborhoodEval_H
#include <eval/moEval.h> #include <eval/moEval.h>
#include <evla/moDoubleIncrEvaluation.h> #include <eval/moDoubleIncrEvaluation.h>
/** /**
* Evaluation of a neighbor from the full evaluation f the neighborhood * Evaluation of a neighbor from the full evaluation f the neighborhood

View file

@ -35,8 +35,8 @@
#ifndef moUBQPdoubleIncrEvaluation_H #ifndef moUBQPdoubleIncrEvaluation_H
#define moUBQPdoubleIncrEvaluation_H #define moUBQPdoubleIncrEvaluation_H
#include <eval/moDoubleIncrNeighborhoodEvaluation.h> #include <eval/moDoubleIncrEvaluation.h>
#include <neighborhood/moNeighborhoodExplorer.h> #include <explorer/moNeighborhoodExplorer.h>
#include <eval/moEval.h> #include <eval/moEval.h>
/** /**
@ -46,10 +46,14 @@
* BECAREFULL: This object must be added to the moCheckpoint of the local search (init method) * BECAREFULL: This object must be added to the moCheckpoint of the local search (init method)
*/ */
template<class Neighbor> template<class Neighbor>
class moUBQPdoubleIncrEvaluation : public moNeighborhoodEvaluation<Neighbor> class moUBQPdoubleIncrEvaluation : public moDoubleIncrEvaluation<Neighbor>
{ {
public: public:
using moDoubleIncrEvaluation::deltaFitness; typedef typename Neighbor::EOT EOT;
typedef typename EOT::Fitness Fitness;
using moDoubleIncrEvaluation<Neighbor>::deltaFitness;
using moDoubleIncrEvaluation<Neighbor>::firstEval;
/** /**
* Constructor * Constructor
@ -58,7 +62,7 @@ public:
* @param _searchExplorer the neighborhood explorer of the local search * @param _searchExplorer the neighborhood explorer of the local search
* @param _incrEval the incremental evaluation of the UBQP * @param _incrEval the incremental evaluation of the UBQP
*/ */
moUBQPdoubleIncrEvaluation(unsigned int _neighborhoodSize, moNeighborhoodExplorer<Neighbor> & _searchExplorer, moEval<Neighbor> & _incrEval) : moDoubleIncrNeighborhoodEvaluation<Neighbor>(_neighborhoodSize), searchExplorer(_searchExplorer) moUBQPdoubleIncrEvaluation(unsigned int _neighborhoodSize, moNeighborhoodExplorer<Neighbor> & _searchExplorer, moEval<Neighbor> & _incrEval) : moDoubleIncrEvaluation<Neighbor>(_neighborhoodSize), searchExplorer(_searchExplorer)
{ {
n = _incrEval.getNbVar(); n = _incrEval.getNbVar();
Q = _incrEval.getQ(); Q = _incrEval.getQ();
@ -71,7 +75,7 @@ public:
* *
* @param _solution the current solution * @param _solution the current solution
*/ */
virtual operator()(EOT & _solution) { virtual void operator()(EOT & _solution) {
if (firstEval) { if (firstEval) {
firstEval = false; firstEval = false;