moExponentialCoolingSchedule.h has been transformed to moGeometricCoolingSchedule.h
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1303 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
9296968edc
commit
30c1832e7d
9 changed files with 8 additions and 42 deletions
|
|
@ -41,11 +41,11 @@
|
|||
#include <moBestImprSelect.h>
|
||||
#include <moComparator.h>
|
||||
#include <moCoolingSchedule.h>
|
||||
#include <moExponentialCoolingSchedule.h>
|
||||
#include <moFirstImprSelect.h>
|
||||
#include <moFitComparator.h>
|
||||
#include <moFitSolContinue.h>
|
||||
#include <moGenSolContinue.h>
|
||||
#include <moGeometricCoolingSchedule.h>
|
||||
#include <moHC.h>
|
||||
#include <moHCMoveLoopExpl.h>
|
||||
#include <moILS.h>
|
||||
|
|
@ -72,9 +72,5 @@
|
|||
#include <moTabuList.h>
|
||||
#include <moTS.h>
|
||||
#include <moTSMoveLoopExpl.h>
|
||||
#include <moExpl.h>
|
||||
#include <moVNS.h>
|
||||
#include <moTA.h>
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -57,14 +57,6 @@ class moBestImprSelect:public moMoveSelect < M >
|
|||
*/
|
||||
void init (const Fitness & _fitness)
|
||||
{
|
||||
//Code only used to avoid warning because _fitness is not used in this procedure.
|
||||
Fitness fitness;
|
||||
fitness=(Fitness)_fitness;
|
||||
|
||||
//std::cout.precision(10);
|
||||
|
||||
//std::cout << "old fitness = " << _fitness << std::endl;
|
||||
|
||||
first_time = true;
|
||||
}
|
||||
|
||||
|
|
@ -88,8 +80,6 @@ class moBestImprSelect:public moMoveSelect < M >
|
|||
first_time = false;
|
||||
}
|
||||
|
||||
//std::cout << "best fitness = " << best_fitness << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -107,9 +97,7 @@ class moBestImprSelect:public moMoveSelect < M >
|
|||
|
||||
_move = best_move;
|
||||
_fitness = best_fitness;
|
||||
|
||||
|
||||
//std::cout << "Final fitness = " << best_fitness << std::endl;
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -65,9 +65,6 @@ class moGenSolContinue:public moSolContinue < EOT >
|
|||
*/
|
||||
bool operator () (const EOT & _solution)
|
||||
{
|
||||
//code only used for avoiding warning because _sol is not used in this function.
|
||||
const EOT solution(_solution);
|
||||
|
||||
return (++generationNumber < generationMaximumNumber);
|
||||
}
|
||||
|
||||
|
|
|
|||
79
trunk/paradiseo-mo/src/moGeometricCoolingSchedule.h
Normal file
79
trunk/paradiseo-mo/src/moGeometricCoolingSchedule.h
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
<moGeometricCoolingSchedule.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
(C) OPAC Team, LIFL, 2002-2008
|
||||
|
||||
Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can use,
|
||||
modify and/ or redistribute the software under the terms of the CeCILL
|
||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
"http://www.cecill.info".
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited liability.
|
||||
|
||||
In this respect, the user's attention is drawn to the risks associated
|
||||
with loading, using, modifying and/or developing or reproducing the
|
||||
software by the user in light of its specific status of free software,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
same conditions as regards security.
|
||||
The fact that you are presently reading this means that you have had
|
||||
knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#ifndef _moGeometricCoolingSchedule_h
|
||||
#define _moGeometricCoolingSchedule_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 moGeometricCoolingSchedule: public moCoolingSchedule
|
||||
{
|
||||
public:
|
||||
|
||||
//! Simple constructor
|
||||
/*!
|
||||
\param _threshold the threshold.
|
||||
\param _ratio the ratio used to descrease the temperature.
|
||||
*/
|
||||
moGeometricCoolingSchedule (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 _temperature the current temperature.
|
||||
\return if the new temperature (current temperature * ratio) is greater than the threshold.
|
||||
*/
|
||||
bool operator() (double & _temperature)
|
||||
{
|
||||
return (_temperature *= ratio) > threshold;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//! The temperature threhold.
|
||||
double threshold;
|
||||
|
||||
//! The decreasing factor of the temperature.
|
||||
double ratio;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -116,7 +116,7 @@ class moHCMoveLoopExpl:public moMoveLoopExpl < M >
|
|||
//The best move is applied on the new solution.
|
||||
best_move(_new_solution);
|
||||
|
||||
//The fitness is set (avoid an additional fitness compuation).
|
||||
//The fitness is set (avoid an additional fitness computation).
|
||||
_new_solution.fitness (best_fitness);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,9 +72,6 @@ class moImprBestFitAspirCrit:public moAspirCrit < M >
|
|||
*/
|
||||
bool operator () (const M & _move, const Fitness & _fitness)
|
||||
{
|
||||
//code only used for avoiding warning because _move is not used in this function.
|
||||
const M move(_move);
|
||||
|
||||
if (first_time)
|
||||
{
|
||||
best_fitness = _fitness;
|
||||
|
|
|
|||
|
|
@ -72,9 +72,6 @@ class moItRandNextMove:public moNextMove < M >
|
|||
*/
|
||||
bool operator () (M & _move, const EOT & _solution)
|
||||
{
|
||||
//code only used to avoid warning because _solution is not used in this function.
|
||||
const EOT solution(_solution);
|
||||
|
||||
if (iteration_number > iteration_maximum_number)
|
||||
{
|
||||
iteration_number = 0;
|
||||
|
|
|
|||
|
|
@ -58,11 +58,6 @@ class moNoAspirCrit:public moAspirCrit < M >
|
|||
*/
|
||||
bool operator () (const M & _move, const typename M::EOType::Fitness & _fitness)
|
||||
{
|
||||
//Code only used to avoid warning because _move and _fitness are not used in this procedure.
|
||||
const M move(_move);
|
||||
typename M::EOType::Fitness fitness;
|
||||
fitness=(typename M::EOType::Fitness)_fitness;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,8 +69,6 @@ class moSimpleMoveTabuList: public moTabuList < M >
|
|||
bool operator () (const M & _move, const EOT & _solution)
|
||||
{
|
||||
moveIterator it;
|
||||
//code only used to avoid warning because _solution is not used in this function.
|
||||
EOT solution=(EOT)_solution;
|
||||
|
||||
it=tabuList.begin();
|
||||
// The code is !(*it)==_move instead of (*it)!=_move because people designing their specific move representation
|
||||
|
|
@ -85,8 +83,6 @@ class moSimpleMoveTabuList: public moTabuList < M >
|
|||
|
||||
void add(const M & _move, const EOT & _solution)
|
||||
{
|
||||
//code only used to avoid warning because _solution is not used in this function.
|
||||
const EOT solution(_solution);
|
||||
|
||||
if (memory_size!=0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue