From ff67c2c65014e00af5abca4a0f2c776f4a45da18 Mon Sep 17 00:00:00 2001 From: verel Date: Tue, 27 Jul 2010 18:25:00 +0000 Subject: [PATCH] Add a default constructor use default comparator to moBetterAcceptCrit git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1892 331e1502-861f-0410-8da2-ba01fb791d7f --- .../src/acceptCrit/moBetterAcceptCrit.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/trunk/paradiseo-mo/src/acceptCrit/moBetterAcceptCrit.h b/trunk/paradiseo-mo/src/acceptCrit/moBetterAcceptCrit.h index a9a79d511..13f2f867c 100644 --- a/trunk/paradiseo-mo/src/acceptCrit/moBetterAcceptCrit.h +++ b/trunk/paradiseo-mo/src/acceptCrit/moBetterAcceptCrit.h @@ -43,10 +43,21 @@ class moBetterAcceptCrit : public moAcceptanceCriterion, public moDumm public: typedef typename Neighbor::EOT EOT; + /* + constructor with a specific comparator + + @param _comparator the comparaison method of two solutions + */ moBetterAcceptCrit(moSolComparator& _comparator):comparator(_comparator) {} + /* + default constructor: + compare the fitness value: accept if the fitness is higher + */ + moBetterAcceptCrit():comparator(defaultComparator) {} + /** - * Accept if the new solution is better than previous one + * Accept if the new solution is better than previous one according to the comparator * @param _sol1 the previous solution * @param _sol2 the new solution after local search * @return true if the new solution is better than previous one @@ -58,6 +69,8 @@ public: private: moSolComparator& comparator; + moSolComparator defaultComparator; + }; #endif