Code lesson1_simpleHC.cpp ajouter au tutorial

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1747 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
verel 2010-04-27 12:21:32 +00:00
commit 7b518b9d08
11 changed files with 1157 additions and 111 deletions

View file

@ -36,10 +36,9 @@
#define _moSimpleCoolingSchedule_h
#include <coolingSchedule/moCoolingSchedule.h>
#include <eoFunctor.h>
/**
* Cooling Schedule of the temperature in the simulated algorithm
* Classical cooling Schedule of the temperature in the simulated algorithm with initial and final temperature and a factor of decrease
*
*/
template< class EOT >
@ -50,8 +49,8 @@ public:
* default constructor
* @param _initT initial temperature
* @param _alpha factor of decreasing
* @param span number of iteration with equal temperature
* @param finalT final temperature, threshold of the stopping criteria
* @param _span number of iteration with equal temperature
* @param _finalT final temperature, threshold of the stopping criteria
*/
moSimpleCoolingSchedule(double _initT, double _alpha, unsigned _span, double _finalT) : initT(_initT), alpha(_alpha), span(_span), finalT(_finalT) {
}
@ -61,7 +60,7 @@ public:
* @param _solution initial solution
* @return the initial temperature
*/
double init(EOT & _solution) {
virtual double init(EOT & _solution) {
// number of iteration with the same temperature
step = 0;
@ -72,7 +71,7 @@ public:
* update the temperature by a factor
* @param _temp current temperature to update
*/
void update(double& _temp) {
virtual void update(double& _temp) {
if (step >= span) {
_temp *= alpha;
step = 0;
@ -85,7 +84,7 @@ public:
* @param _temp current temperature
* @return true if the current temperature is over the threshold (final temperature)
*/
bool operator()(double _temp) {
virtual bool operator()(double _temp) {
return _temp > finalT;
}