git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1825 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
jhumeau 2010-05-26 15:29:42 +00:00
commit 633e961b80
3 changed files with 166 additions and 0 deletions

View file

@ -0,0 +1,34 @@
#ifndef moIncrEvalWrapper_H
#define moIncrEvalWrapper_H
#include <eoEvalFunc.h>
#include <moEval.h>
/*
* (Old fashioned) Incremental evaluation to use with a moMoveNeighbor
* WARNING: Don't use this class unless you are an moMove user.
*/
template<class MoveNeighbor, class M>
class moIncrEvalWrapper : public moEval<MoveNeighbor>
{
public:
using moEval<BackableNeighbor>::EOT EOT;
using moEval<BackableNeighbor>::Fitness Fitness;
moIncrEvalWrapper(moIncrEval<M>& _incr):incr(_incr) {}
/*
* make the evaluation of the current neighbor and update the information on this neighbor
* the evaluation could be incremental
*/
virtual void eval(MoveNeighbor& _neighbor,EOT & _solution) {
_neighbor.fitness(incrEval(*(_neighbor.getMove()), _solution));
}
private:
/** the full evaluation object */
moIncrEval<M> & incrEval;
};
#endif