From 3f759bd20646d6064ca95cb0756522ab8fa85fe5 Mon Sep 17 00:00:00 2001 From: liefooga Date: Fri, 6 Jul 2007 07:27:07 +0000 Subject: [PATCH] add 'maximizing' function in all lesson's Objective Traits git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@556 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-moeo/tutorial/Lesson2/Sch1.cpp | 4 ++++ .../examples/flowshop/FlowShopObjectiveVectorTraits.cpp | 5 +++++ .../examples/flowshop/FlowShopObjectiveVectorTraits.h | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/trunk/paradiseo-moeo/tutorial/Lesson2/Sch1.cpp b/trunk/paradiseo-moeo/tutorial/Lesson2/Sch1.cpp index 055a2155e..718039921 100644 --- a/trunk/paradiseo-moeo/tutorial/Lesson2/Sch1.cpp +++ b/trunk/paradiseo-moeo/tutorial/Lesson2/Sch1.cpp @@ -25,6 +25,10 @@ public: { return true; } + static bool maximizing (int i) + { + return false; + } static unsigned int nObjectives () { return 2; diff --git a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp index b12d33aae..7296fdf0b 100644 --- a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp +++ b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp @@ -19,6 +19,11 @@ bool FlowShopObjectiveVectorTraits::minimizing (int _i) return true; } +bool FlowShopObjectiveVectorTraits::maximizing (int _i) +{ + // minimizing both + return false; +} unsigned int FlowShopObjectiveVectorTraits::nObjectives () { diff --git a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.h b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.h index dac46aab0..994304e3f 100644 --- a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.h +++ b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.h @@ -29,6 +29,13 @@ public: static bool minimizing (int _i); + /** + * Returns true if the _ith objective have to be maximzed + * @param _i index of the objective + */ + static bool maximizing (int _i); + + /** * Returns the number of objectives */