Perturb and acceptCrit added

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1728 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2010-03-30 09:59:08 +00:00
commit c2771d8a3a
10 changed files with 690 additions and 8 deletions

View file

@ -30,5 +30,34 @@ Contact: paradiseo-help@lists.gforge.inria.fr
#ifndef _moBetterAcceptCrit_h
#define _moBetterAcceptCrit_h
#include <acceptCrit/moAcceptanceCriterion.h>
#include <memory/moDummyMemory.h>
#include <comparator/moSolComparator.h>
/**
* Acceptance Criterion for extreme intensification : accept if the new solution is better than previous one
*/
template< class Neighbor >
class moBetterAcceptCrit : public moAcceptanceCriterion<Neighbor>, public moDummyMemory<Neighbor>{
public:
typedef typename Neighbor::EOT EOT;
moBetterAcceptCrit(moSolComparator<EOT>& _comparator):comparator(_comparator){}
/**
* Accept if the new solution is better than previous one
* @param _sol1 the previous solution
* @param _sol2 the new solution after local search
* @return true if the new solution is better than previous one
*/
bool operator()(EOT& _sol1, EOT& _sol2){
return comparator(_sol1, _sol2);
}
private:
moSolComparator<EOT>& comparator;
};
#endif