moCoolSched and moEasyCoolSched are deleted, moExponentialCoolingSchedule and moLinearCoolingSchedule are added
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@275 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
75b4b6a3cd
commit
29bde011dc
3 changed files with 74 additions and 24 deletions
55
trunk/paradiseo-mo/src/moExponentialCoolingSchedule.h
Normal file
55
trunk/paradiseo-mo/src/moExponentialCoolingSchedule.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "moExponentialCoolingSchedule.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003-2007
|
||||
|
||||
/* LICENCE TEXT
|
||||
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#ifndef __moExponentialCoolingSchedule_h
|
||||
#define __moExponentialCoolingSchedule_h
|
||||
|
||||
#include "moCoolingSchedule.h"
|
||||
|
||||
//! One of the possible moCoolingSchedule
|
||||
/*!
|
||||
An other very simple cooling schedule, the temperature decrease according to a ratio while
|
||||
the temperature is greater than a given threshold.
|
||||
*/
|
||||
class moExponentialCoolingSchedule: public moCoolingSchedule
|
||||
{
|
||||
|
||||
public:
|
||||
//! Simple constructor
|
||||
/*!
|
||||
\param __threshold the threshold.
|
||||
\param __ratio the ratio used to descrease the temperature.
|
||||
*/
|
||||
moExponentialCoolingSchedule (double __threshold, double __ratio):threshold (__threshold), ratio (__ratio)
|
||||
{}
|
||||
|
||||
//! 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 * ratio) is greater than the threshold.
|
||||
*/
|
||||
bool operator() (double &__temp)
|
||||
{
|
||||
return (__temp *= ratio) > threshold;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//! The temperature threhold.
|
||||
double threshold;
|
||||
|
||||
//! The decreasing factor of the temperature.
|
||||
double ratio;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue