diff --git a/trunk/paradiseo-mo/src/moCoolSched.h b/trunk/paradiseo-mo/src/moCoolingSchedule.h old mode 100755 new mode 100644 similarity index 59% rename from trunk/paradiseo-mo/src/moCoolSched.h rename to trunk/paradiseo-mo/src/moCoolingSchedule.h index 9ce2d40b3..c73b25c01 --- a/trunk/paradiseo-mo/src/moCoolSched.h +++ b/trunk/paradiseo-mo/src/moCoolingSchedule.h @@ -1,25 +1,25 @@ // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- -// "moCoolSched.h" +// "moCoolingSchedule.h" -// (c) OPAC Team, LIFL, 2003-2006 +// (c) OPAC Team, LIFL, 2003-2007 /* LICENCE TEXT Contact: paradiseo-help@lists.gforge.inria.fr */ -#ifndef __moCoolSched_h -#define __moCoolSched_h +#ifndef __moCoolingSchedule_h +#define __moCoolingSchedule_h #include //! This class gives the description of a cooling schedule. /*! It is only a description... An object that herits from this class is needed to be used in a moSA. - See moEasyCoolSched for example. + See moExponentialCoolingSchedule or moLinearCoolingSchedule for example. */ -class moCoolSched:public eoUF < double &, bool > +class moCoolingSchedule:public eoUF < double &, bool > { }; diff --git a/trunk/paradiseo-mo/src/moEasyCoolSched.h b/trunk/paradiseo-mo/src/moExponentialCoolingSchedule.h old mode 100755 new mode 100644 similarity index 51% rename from trunk/paradiseo-mo/src/moEasyCoolSched.h rename to trunk/paradiseo-mo/src/moExponentialCoolingSchedule.h index 90baecc22..e67614951 --- a/trunk/paradiseo-mo/src/moEasyCoolSched.h +++ b/trunk/paradiseo-mo/src/moExponentialCoolingSchedule.h @@ -1,25 +1,25 @@ // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- -// "moEasyCoolSched.h" +// "moExponentialCoolingSchedule.h" -// (c) OPAC Team, LIFL, 2003-2006 +// (c) OPAC Team, LIFL, 2003-2007 /* LICENCE TEXT Contact: paradiseo-help@lists.gforge.inria.fr */ -#ifndef __moEasyCoolSched_h -#define __moEasyCoolSched_h +#ifndef __moExponentialCoolingSchedule_h +#define __moExponentialCoolingSchedule_h -#include "moCoolSched.h" +#include "moCoolingSchedule.h" -//! One of the possible moCoolSched +//! One of the possible moCoolingSchedule /*! - The simpliest, the temperature decrease according to a ratio until - it greater than a threshold. + An other very simple cooling schedule, the temperature decrease according to a ratio while + the temperature is greater than a given threshold. */ -class moEasyCoolSched:public moCoolSched +class moExponentialCoolingSchedule: public moCoolingSchedule { public: @@ -28,22 +28,18 @@ public: \param __threshold the threshold. \param __ratio the ratio used to descrease the temperature. */ - moEasyCoolSched (double __threshold, - double __ratio):threshold (__threshold), ratio (__ratio) - { - - } + moExponentialCoolingSchedule (double __threshold, double __ratio):threshold (__threshold), ratio (__ratio) + {} //! Function which proceeds to the cooling. /*! - Decrease the temperature and indicates if it is greater than the threshold. + It decreases the temperature and indicates if it is greater than the threshold. \param __temp the current temperature. \return if the new temperature (current temperature * ratio) is greater than the threshold. */ - bool operator () (double &__temp) + bool operator() (double &__temp) { - return (__temp *= ratio) > threshold; } @@ -54,7 +50,6 @@ private: //! The decreasing factor of the temperature. double ratio; - }; #endif diff --git a/trunk/paradiseo-mo/src/moLinearCoolingSchedule.h b/trunk/paradiseo-mo/src/moLinearCoolingSchedule.h new file mode 100644 index 000000000..62d48c427 --- /dev/null +++ b/trunk/paradiseo-mo/src/moLinearCoolingSchedule.h @@ -0,0 +1,55 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +// "moLinearCoolingSchedule.h" + +// (c) OPAC Team, LIFL, 2003-2007 + +/* LICENCE TEXT + + Contact: paradiseo-help@lists.gforge.inria.fr +*/ + +#ifndef __moLinearCoolingSchedule_h +#define __moLinearCoolingSchedule_h + +#include "moCoolingSchedule.h" + +//! One of the possible moCoolingSchedule +/*! + An another very simple cooling schedule, the temperature decrease according to a quantity while + the temperature is greater than a threshold. + */ +class moLinearCoolingSchedule: public moCoolingSchedule +{ + +public: + //! Simple constructor + /*! + \param __threshold the threshold. + \param __quantity the quantity used to descrease the temperature. + */ + moLinearCoolingSchedule (double __threshold, double __quantity):threshold (__threshold), quantity (__quantity) + {} + + //! Function which proceeds to the cooling. + /*! + It decreases the temperature and indicates if it is greater than the threshold. + + \param __temp the current temperature. + \return if the new temperature (current temperature - quantity) is greater than the threshold. + */ + bool operator() (double &__temp) + { + return (__temp -= quantity) > threshold; + } + +private: + + //! The temperature threhold. + double threshold; + + //! The quantity that allows the temperature to decrease. + double quantity; +}; + +#endif