Big source code update: simplification, accessibility, include, date, ... All .h have been verified and updated

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@877 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jboisson 2008-01-15 15:50:39 +00:00
commit a94380fadb
39 changed files with 3045 additions and 3155 deletions

View file

@ -3,7 +3,7 @@
@section Introduction @section Introduction
MO is an extension of the ANSI-C++ compliant evolutionary computation library EO. MO is an extension of the ANSI-C++ compliant evolutionary computation library EO.
<br> <BR>
It contains classes for almost any kind of one solution based heuristics. It contains classes for almost any kind of one solution based heuristics.
@section authors AUTHORS @section authors AUTHORS
@ -13,7 +13,9 @@ It contains classes for almost any kind of one solution based heuristics.
<TD>Sebastien CAHON</TD> <TD>Sebastien CAHON</TD>
</TR> </TR>
<TR> <TR>
<TD><A href=http://www.lifl.fr/~boisson TARGET=blank>Jean-Charles BOISSON</A></TD> <TD>
<A href=http://www.lifl.fr/~boisson TARGET=blank>Jean-Charles BOISSON</A>
</TD>
</TR> </TR>
</TABLE> </TABLE>

View file

@ -1,38 +1,38 @@
/* /*
* <mo> <mo>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __mo #ifndef __mo
#define __mo #define __mo

View file

@ -1,77 +1,76 @@
/* /*
* <mo.h> <mo.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2007
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __mo_h #ifndef _mo_h
#define __mo_h #define _mo_h
#include "moAlgo.h" #include <moAlgo.h>
#include "moAspirCrit.h" #include <moAspirCrit.h>
#include "moBestImprSelect.h" #include <moBestImprSelect.h>
#include "moComparator.h" #include <moComparator.h>
#include "moCoolingSchedule.h" #include <moCoolingSchedule.h>
#include "moExponentialCoolingSchedule.h" #include <moExponentialCoolingSchedule.h>
#include "moFirstImprSelect.h" #include <moFirstImprSelect.h>
#include "moFitComparator.h" #include <moFitComparator.h>
#include "moFitSolContinue.h" #include <moFitSolContinue.h>
#include "moGenSolContinue.h" #include <moGenSolContinue.h>
#include "moHC.h" #include <moHC.h>
#include "moHCMoveLoopExpl.h" #include <moHCMoveLoopExpl.h>
#include "moILS.h" #include <moILS.h>
#include "moImprBestFitAspirCrit.h" #include <moImprBestFitAspirCrit.h>
#include "moItRandNextMove.h" #include <moItRandNextMove.h>
#include "moLinearCoolingSchedule.h" #include <moLinearCoolingSchedule.h>
#include "moLSCheckPoint.h" #include <moLSCheckPoint.h>
#include "moMoveExpl.h" #include <moMoveExpl.h>
#include "moMove.h" #include <moMove.h>
#include "moMoveIncrEval.h" #include <moMoveIncrEval.h>
#include "moMoveInit.h" #include <moMoveInit.h>
#include "moMoveLoopExpl.h" #include <moMoveLoopExpl.h>
#include "moMoveSelect.h" #include <moMoveSelect.h>
#include "moNextMove.h" #include <moNextMove.h>
#include "moNoAspirCrit.h" #include <moNoAspirCrit.h>
#include "moNoFitImprSolContinue.h" #include <moNoFitImprSolContinue.h>
#include "moRandImprSelect.h" #include <moRandImprSelect.h>
#include "moRandMove.h" #include <moRandMove.h>
#include "moSA.h" #include <moSA.h>
#include "moSimpleMoveTabuList.h" #include <moSimpleMoveTabuList.h>
#include "moSimpleSolutionTabuList.h" #include <moSimpleSolutionTabuList.h>
#include "moSolContinue.h" #include <moSolContinue.h>
#include "moSteadyFitSolContinue.h" #include <moSteadyFitSolContinue.h>
#include "moTabuList.h" #include <moTabuList.h>
#include "moTS.h" #include <moTS.h>
#include "moTSMoveLoopExpl.h" #include <moTSMoveLoopExpl.h>
#endif #endif

View file

@ -1,41 +1,41 @@
/* /*
* <moAlgo.h> <moAlgo.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moAlgo_h #ifndef _moAlgo_h
#define __moAlgo_h #define _moAlgo_h
#include <eoOp.h> #include <eoOp.h>

View file

@ -1,41 +1,40 @@
/* /*
* <moAspirCrit.h> <moAspirCrit.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moAspirCrit_h #ifndef _moAspirCrit_h
#define __moAspirCrit_h #define _moAspirCrit_h
#include <eoFunctor.h> #include <eoFunctor.h>
@ -44,19 +43,16 @@
It is only a description... An object that herits from this class is needed to be used in a moTS. It is only a description... An object that herits from this class is needed to be used in a moTS.
See moNoAspriCrit for example. See moNoAspriCrit for example.
*/ */
template < class M > class moAspirCrit:public eoBF < const M &, const typename template < class M >
M::EOType::Fitness &, class moAspirCrit: public eoBF < const M &, const typename M::EOType::Fitness &, bool >
bool >
{ {
public: public:
//! Procedure which initialises all that needs a aspiration criterion.
/*!
It can be possible that this procedure do nothing...
*/
virtual void
init () = 0;
//! Procedure which initialises all that needs an aspiration criterion.
/*!
It can be possible that this procedure does nothing...
*/
virtual void init () = 0;
}; };
#endif #endif

View file

@ -1,60 +1,64 @@
/* /*
* <moBestImprSelect.h> <moBestImprSelect.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moBestImprSelect_h #ifndef _moBestImprSelect_h
#define __moBestImprSelect_h #define _moBestImprSelect_h
#include "moMoveSelect.h" #include <moMoveSelect.h>
//! One of the possible moMoveSelect. //! One of the possible moMoveSelect.
/*! /*!
All neighbors are considered, and the movement All neighbors are considered, and the movement
which enables the best improvement is selected. which enables the best improvement is selected.
*/ */
template < class M > class moBestImprSelect:public moMoveSelect < M > template < class M >
class moBestImprSelect:public moMoveSelect < M >
{ {
public: public:
//! Alias for the fitness. //! Alias for the fitness.
typedef typename M::EOType::Fitness Fitness; typedef typename M::EOType::Fitness Fitness;
//! Procedure which initialise the exploration //! Procedure which initialise the exploration
void init (const Fitness & __fit) /*!
\param _fitness The current fitness.
*/
void init (const Fitness & _fitness)
{ {
//Code only used to avoid warning because _fitness is not used in this procedure.
Fitness fitness=(Fitness)_fitness;
first_time = true; first_time = true;
} }
@ -65,18 +69,16 @@ template < class M > class moBestImprSelect:public moMoveSelect < M >
If the given fitness enables an improvment, If the given fitness enables an improvment,
the move (moMove) and the fitness linked to this move are saved. the move (moMove) and the fitness linked to this move are saved.
\param __move a move. \param _move a move.
\param __fit a fitness linked to the move. \param _fitness a fitness linked to the move.
\return TRUE if the move does not improve the fitness. \return TRUE if the move does not improve the fitness.
*/ */
bool update (const M & __move, const Fitness & __fit) bool update (const M & _move, const Fitness & _fitness)
{ {
if ( first_time || (_fitness > best_fitness) )
if (first_time || __fit > best_fit)
{ {
best_fitness = _fitness;
best_fit = __fit; best_move = _move;
best_move = __move;
first_time = false; first_time = false;
} }
@ -86,20 +88,18 @@ template < class M > class moBestImprSelect:public moMoveSelect < M >
//! Procedure which saved the best move and fitness. //! Procedure which saved the best move and fitness.
/*! /*!
\param __move the current move (result of the procedure). \param _move the current move (result of the procedure).
\param __fit the current fitness (result of the procedure). \param _fitness the current fitness (result of the procedure).
\throws EmptySelection if no move has improved the fitness.
*/ */
void operator () (M & __move, Fitness & __fit) throw (EmptySelection) void operator () (M & _move, Fitness & _fitness)
{ {
if(first_time)
if (!first_time)
{ {
__move = best_move; throw std::runtime_error("[moBestImprSelect.h]: no move or/and no fitness already saved, update has to be called first.");
__fit = best_fit;
} }
else
throw EmptySelection (); _move = best_move;
_fitness = best_fitness;
} }
private: private:
@ -111,8 +111,7 @@ template < class M > class moBestImprSelect:public moMoveSelect < M >
M best_move; M best_move;
//! The best fitness. //! The best fitness.
Fitness best_fit; Fitness best_fitness;
}; };
#endif #endif

View file

@ -1,41 +1,40 @@
/* /*
* <moComparator.h> <moComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moComparator_h #ifndef _moComparator_h
#define __moComparator_h #define _moComparator_h
//! Template for classes which need to compare two EOT and indicate if the first is "better" than the second. //! Template for classes which need to compare two EOT and indicate if the first is "better" than the second.

View file

@ -1,41 +1,40 @@
/* /*
* <moCoolingSchedule.h> <moCoolingSchedule.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moCoolingSchedule_h #ifndef _moCoolingSchedule_h
#define __moCoolingSchedule_h #define _moCoolingSchedule_h
#include <eoFunctor.h> #include <eoFunctor.h>

View file

@ -1,43 +1,42 @@
/* /*
* <moExponentialCoolingSchedule.h> <moExponentialCoolingSchedule.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moExponentialCoolingSchedule_h #ifndef _moExponentialCoolingSchedule_h
#define __moExponentialCoolingSchedule_h #define _moExponentialCoolingSchedule_h
#include "moCoolingSchedule.h" #include <moCoolingSchedule.h>
//! One of the possible moCoolingSchedule //! One of the possible moCoolingSchedule
/*! /*!
@ -46,26 +45,26 @@
*/ */
class moExponentialCoolingSchedule: public moCoolingSchedule class moExponentialCoolingSchedule: public moCoolingSchedule
{ {
public: public:
//! Simple constructor //! Simple constructor
/*! /*!
\param __threshold the threshold. \param _threshold the threshold.
\param __ratio the ratio used to descrease the temperature. \param _ratio the ratio used to descrease the temperature.
*/ */
moExponentialCoolingSchedule (double __threshold, double __ratio):threshold (__threshold), ratio (__ratio) moExponentialCoolingSchedule (double _threshold, double _ratio):threshold (_threshold), ratio (_ratio)
{} {}
//! Function which proceeds to the cooling. //! Function which proceeds to the cooling.
/*! /*!
It decreases 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. \param _temperature the current temperature.
\return if the new temperature (current temperature * ratio) is greater than the threshold. \return if the new temperature (current temperature * ratio) is greater than the threshold.
*/ */
bool operator() (double &__temp) bool operator() (double & _temperature)
{ {
return (__temp *= ratio) > threshold; return (_temperature *= ratio) > threshold;
} }
private: private:

View file

@ -1,43 +1,42 @@
/* /*
* <moFirstImprSelect.h> <moFirstImprSelect.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moFirstImprSelect_h #ifndef _moFirstImprSelect_h
#define __moFirstImprSelect_h #define _moFirstImprSelect_h
#include "moMoveSelect.h" #include <moMoveSelect.h>
//! One possible moMoveSelect. //! One possible moMoveSelect.
/*! /*!
@ -45,9 +44,9 @@
a move enables an improvment of the a move enables an improvment of the
current solution. current solution.
*/ */
template < class M > class moFirstImprSelect:public moMoveSelect < M > template < class M >
class moFirstImprSelect:public moMoveSelect < M >
{ {
public: public:
//! Alias for the fitness. //! Alias for the fitness.
@ -56,58 +55,51 @@ template < class M > class moFirstImprSelect:public moMoveSelect < M >
//! Procedure which initialise the exploration. //! Procedure which initialise the exploration.
/*! /*!
It save the current fitness as the initial value for the fitness. It save the current fitness as the initial value for the fitness.
\param _fitness The current fitness.
*/ */
virtual void init (const Fitness & __fit) virtual void init (const Fitness & _fitness)
{ {
valid = false; valid = false;
init_fit = __fit; initial_fitness = _fitness;
} }
//!Function that indicates if the current move has not improved the fitness. //!Function that indicates if the current move has not improved the fitness.
/*! /*!
If the given fitness enables an improvment, If the given fitness enables an improvment,
the move (moMove) should be applied to the current solution. the move (moMove) should be applied to the current solution.
\param __move a move. \param _move a move.
\param __fit a fitness linked to the move. \param _fitness a fitness linked to the move.
\return TRUE if the move does not improve the fitness. \return true if the move does not improve the fitness.
*/ */
bool update (const M & __move, const typename M::EOType::Fitness & __fit) bool update (const M & _move, const Fitness & _fitness)
{ {
if (__fit > init_fit) if (_fitness > initial_fitness)
{ {
best_fit = __fit; best_fitness = _fitness;
best_move = __move; best_move = _move;
valid = true; valid = true;
return false; return false;
} }
else
{
return true; return true;
} }
}
//! Procedure which saved the best move and fitness. //! Procedure which saved the best move and fitness.
/*! /*!
\param __move the current move (result of the procedure). \param _move the current move (result of the procedure).
\param __fit the current fitness (result of the procedure). \param _fitness the current fitness (result of the procedure).
\throws EmptySelection if no move has improved the fitness.
*/ */
void operator () (M & __move, Fitness & __fit) throw (EmptySelection) void operator () (M & _move, Fitness & _fitness)
{ {
if (valid) if (valid)
{ {
__move = best_move; _move = best_move;
__fit = best_fit; _fitness = best_fitness;
} }
else
throw EmptySelection ();
} }
private: private:
@ -119,11 +111,10 @@ template < class M > class moFirstImprSelect:public moMoveSelect < M >
M best_move; M best_move;
//! Initial fitness. //! Initial fitness.
Fitness init_fit; Fitness initial_fitness;
//! Best stored fitness. //! Best stored fitness.
Fitness best_fit; Fitness best_fitness;
}; };
#endif #endif

View file

@ -1,41 +1,42 @@
/* /*
* <moFitComparator.h> <moFitComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moFitComparator_h #ifndef _moFitComparator_h
#define __moFitComparator_h #define _moFitComparator_h
#include <moComparator.h>
//! Comparison according to the fitness. //! Comparison according to the fitness.
/*! /*!

View file

@ -1,51 +1,50 @@
/* /*
* <moFitSolContinue.h> <moFitSolContinue.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moFitSolContinue_h #ifndef _moFitSolContinue_h
#define __moFitSolContinue_h #define _moFitSolContinue_h
#include "moSolContinue.h" #include <moSolContinue.h>
//! One possible stop criterion for a solution-based heuristic. //! One possible stop criterion for a solution-based heuristic.
/*! /*!
The stop criterion corresponds to a fitness threshold gained. The stop criterion corresponds to a fitness threshold gained.
*/ */
template < class EOT > class moFitSolContinue:public moSolContinue < EOT > template < class EOT >
class moFitSolContinue:public moSolContinue < EOT >
{ {
public: public:
//! Alias for the fitness. //! Alias for the fitness.
@ -53,26 +52,26 @@ template < class EOT > class moFitSolContinue:public moSolContinue < EOT >
//! Basic constructor. //! Basic constructor.
/*! /*!
\param __fitness The fitness to reach. \param _fitness The fitness to reach.
*/ */
moFitSolContinue (Fitness __fitness): fitness (__fitness) moFitSolContinue (Fitness _fitness): fitness(_fitness)
{} {}
//! Function that activates the stopping criterion. //! Function that activates the stopping criterion.
/*! /*!
Indicates if the fitness threshold has not yet been reached. Indicates if the fitness threshold has not yet been reached.
\param __sol the current solution. \param _solution the current solution.
\return true or false according to the value of the fitness. \return true or false according to the value of the fitness.
*/ */
bool operator () (const EOT & __sol) bool operator () (const EOT & _solution)
{ {
if (__sol.invalid()) if ( _solution.invalid() )
{ {
return true; throw std::runtime_error("[moFitSolContinue.h]: The current solution has not been evaluated.");
} }
return __sol.fitness() < fitness; return fitness > _solution.fitness();
} }
//! Procedure which allows to initialise all the stuff needed. //! Procedure which allows to initialise all the stuff needed.

View file

@ -1,41 +1,40 @@
/* /*
* <moGenSolContinue.h> <moGenSolContinue.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moGenSolContinue_h #ifndef _moGenSolContinue_h
#define __moGenSolContinue_h #define _moGenSolContinue_h
#include "moSolContinue.h" #include "moSolContinue.h"
@ -43,16 +42,16 @@
/*! /*!
The stop criterion corresponds to a maximum number of iteration. The stop criterion corresponds to a maximum number of iteration.
*/ */
template < class EOT > class moGenSolContinue:public moSolContinue < EOT > template < class EOT >
class moGenSolContinue:public moSolContinue < EOT >
{ {
public: public:
//! Simple constructor. //! Simple constructor.
/*! /*!
\param __maxNumGen the maximum number of generation. \param _generationMaximumNumber The maximum number of generations.
*/ */
moGenSolContinue (unsigned int __maxNumGen):maxNumGen (__maxNumGen), numGen (0) moGenSolContinue (unsigned int _generationMaximumNumber): generationMaximumNumber(_generationMaximumNumber), generationNumber(0)
{} {}
//! Function that activates the stop criterion. //! Function that activates the stop criterion.
@ -61,13 +60,15 @@ template < class EOT > class moGenSolContinue:public moSolContinue < EOT >
current number of iteration is lower than the given current number of iteration is lower than the given
maximum number of iterations. maximum number of iterations.
\param __sol the current solution. \param _solution The current solution.
\return TRUE or FALSE according to the current generation number. \return true or false according to the current generation number.
*/ */
bool operator () (const EOT & __sol) bool operator () (const EOT & _solution)
{ {
//code only used for avoiding warning because _sol is not used in this function.
EOT solution=(EOT)_solution;
return (++numGen < maxNumGen); return (++generationNumber < generationMaximumNumber);
} }
//! Procedure which allows to initialise the generation counter. //! Procedure which allows to initialise the generation counter.
@ -76,17 +77,16 @@ template < class EOT > class moGenSolContinue:public moSolContinue < EOT >
*/ */
void init () void init ()
{ {
generationNumber = 0;
numGen = 0;
} }
private: private:
//! Iteration maximum number. //! Iteration maximum number.
unsigned int maxNumGen; unsigned int generationMaximumNumber;
//! Iteration current number. //! Iteration current number.
unsigned int numGen; unsigned int generationNumber;
}; };
#endif #endif

View file

@ -1,37 +1,36 @@
/* /*
* <moHC.h> <moHC.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moHC_h #ifndef __moHC_h
@ -39,28 +38,21 @@
#include <eoEvalFunc.h> #include <eoEvalFunc.h>
#include "moAlgo.h" #include <moAlgo.h>
#include "moMoveExpl.h" #include <moHCMoveLoopExpl.h>
#include "moHCMoveLoopExpl.h"
//! Hill Climbing (HC) //! Hill Climbing (HC)
/*! /*!
Class which describes the algorithm for a hill climbing. Class which describes the algorithm for a hill climbing.
*/ */
template < class M > class moHC:public moAlgo < typename M::EOType > template < class M >
class moHC:public moAlgo < typename M::EOType >
{ {
//! Alias for the type. //! Alias for the type.
typedef typedef typename M::EOType EOT;
typename
M::EOType
EOT;
//! Alias for the fitness. //! Alias for the fitness.
typedef typedef typename EOT::Fitness Fitness;
typename
EOT::Fitness
Fitness;
public: public:
@ -68,27 +60,27 @@ template < class M > class moHC:public moAlgo < typename M::EOType >
/*! /*!
All the boxes are given in order the HC to use a moHCMoveLoopExpl. All the boxes are given in order the HC to use a moHCMoveLoopExpl.
\param __move_init a move initialiser. \param _move_initializer a move initialiser.
\param __next_move a neighborhood explorer. \param _next_move_generator a neighborhood explorer.
\param __incr_eval a (generally) efficient evaluation function. \param _incremental_evaluation a (generally) efficient evaluation function.
\param __move_select a move selector. \param _move_selection a move selector.
\param __full_eval a full evaluation function. \param _full_evaluation a full evaluation function.
*/ */
moHC (moMoveInit < M > &__move_init, moNextMove < M > &__next_move, moMoveIncrEval < M > &__incr_eval, moMoveSelect < M > &__move_select, eoEvalFunc < EOT > &__full_eval):move_expl (*new moHCMoveLoopExpl < M > moHC (moMoveInit < M > & _move_initializer, moNextMove < M > & _next_move_generator,
(__move_init, __next_move, __incr_eval, __move_select)), moMoveIncrEval < M > & _incremental_evaluation, moMoveSelect < M > & _move_selection, eoEvalFunc < EOT > & _full_evaluation) :
full_eval (__full_eval) move_explorer ( *new moHCMoveLoopExpl < M > (_move_initializer, _next_move_generator, _incremental_evaluation, _move_selection) ),
full_evaluation (_full_evaluation)
{} {}
//! Light constructor. //! Light constructor.
/*! /*!
This constructor allow to use another moMoveExpl (generally not a moHCMoveLoopExpl). This constructor allow to use another moMoveExpl (generally not a moHCMoveLoopExpl).
\param __move_expl a complete explorer. \param _move_explorer a complete explorer.
\param __full_eval a full evaluation function. \param _full_evaluation a full evaluation function.
*/ */
moHC (moMoveExpl < M > &__move_expl, eoEvalFunc < EOT > &__full_eval):move_expl (__move_expl), moHC (moMoveExpl < M > & _move_explorer, eoEvalFunc < EOT > & _full_evaluation):
full_eval move_explorer (_move_explorer), full_evaluation (_full_evaluation)
(__full_eval)
{} {}
//! Function which launches the HC //! Function which launches the HC
@ -96,47 +88,26 @@ template < class M > class moHC:public moAlgo < typename M::EOType >
The HC has to improve a current solution. The HC has to improve a current solution.
As the moSA and the mo TS, it can be used for HYBRIDATION in an evolutionnary algorithm. As the moSA and the mo TS, it can be used for HYBRIDATION in an evolutionnary algorithm.
\param __sol a current solution to improve. \param _solution a current solution to improve.
\return TRUE. \return true.
*/ */
bool operator ()(EOT & __sol) bool operator ()(EOT & _solution)
{ {
EOT new_solution;
if (__sol.invalid ()) if ( _solution.invalid() )
{ {
full_eval (__sol); full_evaluation(_solution);
} }
EOT new_sol; new_solution=_solution;
do do
{ {
_solution=new_solution;
new_sol = __sol; move_explorer (_solution, new_solution);
try
{
move_expl (__sol, new_sol);
} }
catch (EmptySelection & __ex) while ( new_solution.fitness() > _solution.fitness() );
{
break;
}
if (new_sol.fitness () > __sol.fitness ())
{
__sol = new_sol;
}
else
{
break;
}
}
while (true);
return true; return true;
} }
@ -144,10 +115,10 @@ template < class M > class moHC:public moAlgo < typename M::EOType >
private: private:
//! Complete exploration of the neighborhood. //! Complete exploration of the neighborhood.
moMoveExpl < M > &move_expl; moMoveExpl < M > & move_explorer;
//! A full evaluation function. //! A full evaluation function.
eoEvalFunc < EOT > &full_eval; eoEvalFunc < EOT > & full_evaluation;
}; };
#endif #endif

View file

@ -1,53 +1,51 @@
/* /*
* <moHCMoveLoopExpl.h> <moHCMoveLoopExpl.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moHCMoveLoopExpl_h #ifndef __moHCMoveLoopExpl_h
#define __moHCMoveLoopExpl_h #define __moHCMoveLoopExpl_h
#include "moMoveLoopExpl.h" #include <moMoveLoopExpl.h>
#include <moMoveInit.h>
#include "moMoveInit.h" #include <moNextMove.h>
#include "moNextMove.h" #include <moMoveIncrEval.h>
#include "moMoveIncrEval.h" #include <moMoveSelect.h>
#include "moMoveSelect.h"
//! Iterative explorer used by a moHC. //! Iterative explorer used by a moHC.
template < class M > class moHCMoveLoopExpl:public moMoveLoopExpl < M > template < class M >
class moHCMoveLoopExpl:public moMoveLoopExpl < M >
{ {
//! Alias for the type. //! Alias for the type.
typedef typename M::EOType EOT; typedef typename M::EOType EOT;
@ -60,72 +58,81 @@ template < class M > class moHCMoveLoopExpl:public moMoveLoopExpl < M >
/*! /*!
All the boxes have to be specified. All the boxes have to be specified.
\param __move_init the move initialiser. \param _move_initializer The move initialiser.
\param __next_move the neighborhood explorer. \param _next_move_generator The neighbourhood explorer.
\param __incr_eval (generally) efficient evaluation function. \param _incremental_evaluation (generally) Efficient evaluation function.
\param __move_select the move selector. \param _move_selection The move selector.
*/ */
moHCMoveLoopExpl (moMoveInit < M > &__move_init, moNextMove < M > &__next_move, moMoveIncrEval < M > &__incr_eval, moMoveSelect < M > &__move_select): moHCMoveLoopExpl (moMoveInit < M > & _move_initializer, moNextMove < M > & _next_move_generator,
moMoveIncrEval < M > & _incremental_evaluation, moMoveSelect < M > & _move_selection) :
move_init (__move_init), move_initializer (_move_initializer), next_move_generator (_next_move_generator),
next_move (__next_move), incremental_evaluation (_incremental_evaluation), move_selection (_move_selection)
incr_eval (__incr_eval), move_select (__move_select)
{} {}
//! Procedure which launches the explorer. //! Procedure which launches the explorer.
/*! /*!
The exploration starts from an old solution and provides a new solution. The exploration starts from an old solution and provides a new solution.
\param __old_sol the current solution. \param _old_solution The current solution.
\param __new_sol the new_sol (result of the procedure). \param _new_solution The new solution (result of the procedure).
*/ */
void operator () (const EOT & __old_sol, EOT & __new_sol) void operator () (const EOT & _old_solution, EOT & _new_solution)
{ {
M move, best_move;
Fitness best_fitness;
bool has_next_move, selection_update_is_ok;
M move; if( _old_solution.invalid() )
//
move_init (move, __old_sol); /* Restarting the exploration of
of the neighborhood ! */
move_select.init (__old_sol.fitness ());
while (move_select.update (move, incr_eval (move, __old_sol))
&& next_move (move, __old_sol));
try
{ {
throw std::runtime_error("[moHCMoveLoopExpl.h]: The current solution has not been evaluated.");
M best_move;
Fitness best_move_fit;
move_select (best_move, best_move_fit);
best_move (__new_sol);
__new_sol.fitness (best_move_fit);
} }
catch (EmptySelection & __ex)
{
// ? /*
The two following lines are added to avoid compilation warning.
<=> current best move fitness is the current fitness.
<=> move and best move are empty for the moment.
*/
best_fitness=_old_solution.fitness();
move=best_move;
//At the begining, the new sol is equivalent to the old one.
_new_solution=(EOT)_old_solution;
// Restarting the exploration of the neighbourhood
move_initializer(move, _old_solution);
move_selection.init(_old_solution.fitness ());
do
{
selection_update_is_ok = move_selection.update (move, incremental_evaluation(move, _old_solution) );
has_next_move = next_move_generator (move, _old_solution);
} }
while ( selection_update_is_ok && has_next_move);
//The selecter gives the value of the best move and the corresponding best fitness.
move_selection (best_move, best_fitness);
//The best move is applied on the new solution.
best_move(_new_solution);
//The fitness is set (avoid an additional fitness compuation).
_new_solution.fitness (best_fitness);
} }
private: private:
//! Move initialiser. //! Move initialiser.
moMoveInit < M > &move_init; moMoveInit < M > & move_initializer;
//! Neighborhood explorer. //! Neighborhood explorer.
moNextMove < M > &next_move; moNextMove < M > & next_move_generator;
//! (generally) Efficient evaluation. //! (generally) Efficient evaluation.
moMoveIncrEval < M > &incr_eval; moMoveIncrEval < M > & incremental_evaluation;
//! Move selector. //! Move selector.
moMoveSelect < M > &move_select; moMoveSelect < M > & move_selection;
}; };
#endif #endif

View file

@ -1,55 +1,54 @@
/* /*
* <moILS.h> <moILS.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moILS_h #ifndef _moILS_h
#define __moILS_h #define _moILS_h
#include <eoEvalFunc.h> #include <eoEvalFunc.h>
#include "moHC.h" #include <moHC.h>
#include "moTS.h" #include <moTS.h>
#include "moSA.h" #include <moSA.h>
//! Iterated Local Search (ILS) //! Iterated Local Search (ILS)
/*! /*!
Class which describes the algorithm for a iterated local search. Class which describes the algorithm for a iterated local search.
*/ */
template < class M > class moILS:public moAlgo < typename M::EOType > template < class M >
class moILS:public moAlgo < typename M::EOType >
{ {
//! Alias for the type. //! Alias for the type.
typedef typename M::EOType EOT; typedef typename M::EOType EOT;
@ -62,120 +61,123 @@ template < class M > class moILS:public moAlgo < typename M::EOType >
/*! /*!
Generic constructor using a moAlgo Generic constructor using a moAlgo
\param __algo The solution based heuristic to use. \param _algorithm The solution based heuristic to use.
\param __continue The stopping criterion. \param _continue The stopping criterion.
\param __acceptance_criterion The acceptance criterion. \param _acceptance_criterion The acceptance criterion.
\param __perturbation The pertubation generator. \param _perturbation The pertubation generator.
\param __full_eval The evaluation function. \param _full_evaluation The evaluation function.
*/ */
moILS (moAlgo<EOT> &__algo, moSolContinue <EOT> &__continue, moComparator<EOT> &__acceptance_criterion, eoMonOp<EOT> &__perturbation, moILS (moAlgo<EOT> & _algorithm, moSolContinue <EOT> & _continue, moComparator<EOT> & _acceptance_criterion,
eoEvalFunc<EOT> &__full_eval): eoMonOp<EOT> & _perturbation, eoEvalFunc<EOT> & _full_evaluation):
algo(__algo), cont(__continue), acceptance_criterion(__acceptance_criterion), perturbation(__perturbation), full_eval(__full_eval) algorithm(_algorithm), continu(_continue), acceptance_criterion(_acceptance_criterion),
perturbation(_perturbation), full_evaluation(_full_evaluation)
{} {}
//! Constructor for using a moHC for the moAlgo //! Constructor for using a moHC for the moAlgo
/*! /*!
\param __move_init The move initialisation (for the moHC). \param _move_initializer The move initialisation (for the moHC).
\param __next_move The move generator (for the moHC). \param _next_move_generator The move generator (for the moHC).
\param __incr_eval The partial evaluation function (for the moHC). \param _incremental_evaluation The partial evaluation function (for the moHC).
\param __move_select The move selection strategy (for the moHC). \param _move_selection The move selection strategy (for the moHC).
\param __continue The stopping criterion. \param _continue The stopping criterion.
\param __acceptance_criterion The acceptance criterion. \param _acceptance_criterion The acceptance criterion.
\param __perturbation The pertubation generator. \param _perturbation The pertubation generator.
\param __full_eval The evaluation function. \param _full_evaluation The evaluation function.
*/ */
moILS (moMoveInit < M > &__move_init, moNextMove < M > &__next_move, moMoveIncrEval < M > &__incr_eval, moILS (moMoveInit < M > & _move_initializer, moNextMove < M > & _next_move_generator,
moMoveSelect < M > &__move_select, moSolContinue <EOT> &__continue, moComparator<EOT> &__acceptance_criterion, moMoveIncrEval < M > & _incremental_evaluation, moMoveSelect < M > & _move_selection,
eoMonOp<EOT> &__perturbation, eoEvalFunc<EOT> &__full_eval): moSolContinue <EOT> & _continue, moComparator<EOT> & _acceptance_criterion,
algo(*new moHC<M>(__move_init, __next_move, __incr_eval, __move_select, __full_eval)), cont(__continue), eoMonOp<EOT> & _perturbation, eoEvalFunc<EOT> & _full_evaluation):
acceptance_criterion(__acceptance_criterion), perturbation(__perturbation), full_eval(__full_eval) algorithm( *new moHC<M>(_move_initializer, _next_move_generator, _incremental_evaluation, _move_selection, _full_evaluation) ),
continu(_continue), acceptance_criterion(_acceptance_criterion), perturbation(_perturbation), full_evaluation(_full_evaluation)
{} {}
//! Constructor for using a moTS for the moAlgo //! Constructor for using a moTS for the moAlgo
/*! /*!
\param __move_init The move initialisation (for the moTS). \param _move_initializer The move initialisation (for the moTS).
\param __next_move The move generator (for the moTS). \param _next_move_generator The move generator (for the moTS).
\param __incr_eval The partial evaluation function (for the moTS). \param _incremental_evaluation The partial evaluation function (for the moTS).
\param __tabu_list The tabu list (for the moTS !!!!). \param _tabu_list The tabu list (for the moTS !!!!).
\param __aspir_crit The aspiration criterion (for the moTS). \param _aspiration_criterion The aspiration criterion (for the moTS).
\param __moTS_continue The stopping criterion (for the moTS). \param _moTS_continue The stopping criterion (for the moTS).
\param __continue The stopping criterion. \param _continue The stopping criterion.
\param __acceptance_criterion The acceptance criterion. \param _acceptance_criterion The acceptance criterion.
\param __perturbation The pertubation generator. \param _perturbation The pertubation generator.
\param __full_eval The evaluation function. \param _full_evaluation The evaluation function.
*/ */
moILS (moMoveInit <M> &__move_init, moNextMove <M> &__next_move, moMoveIncrEval <M> &__incr_eval, moILS (moMoveInit <M> & _move_initializer, moNextMove <M> & _next_move_generator,
moTabuList <M> &__tabu_list, moAspirCrit <M> &__aspir_crit, moSolContinue <EOT> &__moTS_continue, moMoveIncrEval <M> & _incremental_evaluation, moTabuList <M> & _tabu_list,
moSolContinue <EOT> &__continue, moComparator<EOT> &__acceptance_criterion, eoMonOp<EOT> &__perturbation, moAspirCrit <M> & _aspiration_criterion, moSolContinue <EOT> & _moTS_continue,
eoEvalFunc<EOT> &__full_eval): moSolContinue <EOT> & _continue, moComparator<EOT> & _acceptance_criterion, eoMonOp<EOT> & _perturbation,
algo(*new moTS<M>(__move_init, __next_move, __incr_eval, __tabu_list, __aspir_crit, __moTS_continue, __full_eval)), eoEvalFunc<EOT> & _full_evaluation):
cont(__continue), acceptance_criterion(__acceptance_criterion), perturbation(__perturbation), full_eval(__full_eval) algorithm( *new moTS<M>(_move_initializer, _next_move_generator, _incremental_evaluation, _tabu_list, _aspiration_criterion,
_moTS_continue, _full_evaluation) ),
continu(_continue), acceptance_criterion(_acceptance_criterion), perturbation(_perturbation), full_evaluation(_full_evaluation)
{} {}
//! Constructor for using a moSA for the moAlgo //! Constructor for using a moSA for the moAlgo
/*! /*!
\param __move_rand The random move generator (for the moSA). \param _random_move_generator The random move generator (for the moSA).
\param __incr_eval The partial evaluation function (for the moSA). \param _incremental_evaluation The partial evaluation function (for the moSA).
\param __moSA_continue The stopping criterion (for the moSA). \param _moSA_continue The stopping criterion (for the moSA).
\param __init_temp The initial temperature (for the moSA). \param _initial_temperature The initial temperature (for the moSA).
\param __cool_sched The cooling scheduler (for the moSA). \param _cooling_schedule The cooling schedule (for the moSA).
\param __continue The stopping criterion. \param _continue The stopping criterion.
\param __acceptance_criterion The acceptance criterion. \param _acceptance_criterion The acceptance criterion.
\param __perturbation The pertubation generator. \param _perturbation The pertubation generator.
\param __full_eval The evaluation function. \param _full_evaluation The evaluation function.
*/ */
moILS (moRandMove<M> &__move_rand, moMoveIncrEval <M> &__incr_eval, moSolContinue <EOT> &__moSA_continue, double __init_temp, moILS (moRandMove<M> & _random_move_generator, moMoveIncrEval <M> & _incremental_evaluation, moSolContinue <EOT> & _moSA_continue,
moCoolingSchedule & __cool_sched, moSolContinue <EOT> &__continue, moComparator<EOT> &__acceptance_criterion, double _initial_temperature, moCoolingSchedule & _cooling_schedule, moSolContinue <EOT> & _continue,
eoMonOp<EOT> &__perturbation, eoEvalFunc<EOT> &__full_eval): moComparator<EOT> & _acceptance_criterion, eoMonOp<EOT> & _perturbation, eoEvalFunc<EOT> & _full_evaluation):
algo(*new moSA<M>(__move_rand, __incr_eval, __moSA_continue, __init_temp, __cool_sched, __full_eval)), algorithm( *new moSA<M>(_random_move_generator, _incremental_evaluation, _moSA_continue, _initial_temperature,
cont(__continue), acceptance_criterion(__acceptance_criterion), perturbation(__perturbation), full_eval(__full_eval) _cooling_schedule, _full_evaluation) ),
continu(_continue), acceptance_criterion(_acceptance_criterion), perturbation(_perturbation), full_evaluation(_full_evaluation)
{} {}
//! Function which launches the ILS //! Function which launches the ILS
/*! /*!
The ILS has to improve a current solution. The ILS has to improve a current solution.
As the moSA, the moTS and the moHC, it can be used for HYBRIDATION in an evolutionnary algorithm. As the moSA, the moTS and the moHC, it can be used for HYBRIDATION in an evolutionnary algorithm.
\param __sol a current solution to improve. \param _solution a current solution to improve.
\return TRUE. \return true.
*/ */
bool operator()(EOT & __sol) bool operator()(EOT & _solution)
{ {
EOT __sol_saved=__sol; EOT _solution_saved=_solution;
cont.init (); continu.init ();
// some code has been duplicated in order to avoid one perturbation and one evaluation without adding a test in the loop. // some code has been duplicated in order to avoid one perturbation and one evaluation without adding a test in the loop.
// better than a do {} while; with a test in the loop. // better than a do {} while; with a test in the loop.
algo(__sol); algorithm(_solution);
if (acceptance_criterion(__sol, __sol_saved)) if ( acceptance_criterion(_solution, _solution_saved) )
{ {
__sol_saved=__sol; _solution_saved=_solution;
} }
else else
{ {
__sol=__sol_saved; _solution=_solution_saved;
} }
while (cont (__sol)) while ( continu (_solution) )
{ {
perturbation(__sol); perturbation(_solution);
full_eval(__sol); full_evaluation(_solution);
algo(__sol); algorithm(_solution);
if (acceptance_criterion(__sol, __sol_saved)) if ( acceptance_criterion(_solution, _solution_saved) )
{ {
__sol_saved=__sol; _solution_saved=_solution;
} }
else else
{ {
__sol=__sol_saved; _solution=_solution_saved;
} }
} }
@ -185,10 +187,10 @@ template < class M > class moILS:public moAlgo < typename M::EOType >
private: private:
//! The solution based heuristic. //! The solution based heuristic.
moAlgo<EOT> &algo; moAlgo<EOT> & algorithm;
//! The stopping criterion. //! The stopping criterion.
moSolContinue<EOT> &cont; moSolContinue<EOT> & continu;
//! The acceptance criterion. //! The acceptance criterion.
moComparator<EOT> & acceptance_criterion; moComparator<EOT> & acceptance_criterion;
@ -197,7 +199,7 @@ template < class M > class moILS:public moAlgo < typename M::EOType >
eoMonOp<EOT> & perturbation; eoMonOp<EOT> & perturbation;
//! The full evaluation function //! The full evaluation function
eoEvalFunc<EOT> &full_eval; eoEvalFunc<EOT> & full_evaluation;
}; };
#endif #endif

View file

@ -1,50 +1,50 @@
/* /*
* <moImprBestFitAspirCrit.h> <moImprBestFitAspirCrit.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moImprBestFitAspirCrit_h #ifndef _moImprBestFitAspirCrit_h
#define __moImprBestFitAspirCrit_h #define _moImprBestFitAspirCrit_h
#include "moAspirCrit.h" #include <moAspirCrit.h>
//! One of the possible moAspirCrit //! One of the possible moAspirCrit
/*! /*!
This criterion is satisfied when a given fitness This criterion is satisfied when a given fitness
is the best ever considered. is the best ever considered.
*/ */
template < class M > class moImprBestFitAspirCrit:public moAspirCrit < M > template < class M >
class moImprBestFitAspirCrit:public moAspirCrit < M >
{ {
public: public:
@ -55,52 +55,47 @@ template < class M > class moImprBestFitAspirCrit:public moAspirCrit < M >
//! Contructor //! Contructor
moImprBestFitAspirCrit () moImprBestFitAspirCrit ()
{ {
first_time = true; first_time = true;
} }
//! Initialisation procedure //! Initialisation procedure
void init () void init ()
{ {
first_time = true; first_time = true;
} }
//! Function that indicates if the fit is better that the already saved fit //! Function that indicates if the current fitness is better that the already saved fitness
/*! /*!
The first time, the function only saved the current move and fitness. The first time, the function only saved the current move and fitness.
\param __move a move. \param _move A move.
\param __fit a fitnes linked to the move. \param _fitness A fitness linked to the move.
\return TRUE the first time and if __fit > best_fit, else FALSE. \return true The first time and if _fitntess > best_fitness, else false.
*/ */
bool operator () (const M & __move, const Fitness & __fit) bool operator () (const M & _move, const Fitness & _fitness)
{ {
if (first_time) if (first_time)
{ {
best_fitness = _fitness;
best_fit = __fit;
first_time = false; first_time = false;
return true; return true;
} }
else if (__fit < best_fit)
return false;
else if (_fitness < best_fitness)
{ {
return false;
}
best_fit = __fit; best_fitness = _fitness;
return true; return true;
} }
}
private: private:
//! Best fitness found until now //! Best fitness found until now
Fitness best_fit; Fitness best_fitness;
//! Indicates that a fitness has been already saved or not //! Indicates that a fitness has been already saved or not
bool first_time; bool first_time;

View file

@ -1,52 +1,51 @@
/* /*
* <moItRandNextMove.h> <moItRandNextMove.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moItRandNextMove_h #ifndef _moItRandNextMove_h
#define __moItRandNextMove_h #define _moItRandNextMove_h
#include "moNextMove.h" #include <moNextMove.h>
#include "moRandMove.h" #include <moRandMove.h>
//! One of the possible moNextMove. //! One of the possible moNextMove.
/*! /*!
This class is a move (moMove) generator with a bound for the maximum number of iterations. This class is a move (moMove) generator with a bound for the maximum number of iterations.
*/ */
template < class M > class moItRandNextMove:public moNextMove < M > template < class M >
class moItRandNextMove:public moNextMove < M >
{ {
//! Alias for the type. //! Alias for the type.
typedef typename M::EOType EOT; typedef typename M::EOType EOT;
@ -56,52 +55,48 @@ template < class M > class moItRandNextMove:public moNextMove < M >
/*! /*!
Parameters only for initialising the attributes. Parameters only for initialising the attributes.
\param __rand_move the random move generator. \param _random_move_generator The random move generator.
\param __max_iter the iteration maximum number. \param _iteration_maximum_number The iteration maximum number.
*/ */
moItRandNextMove (moRandMove < M > &__rand_move, moItRandNextMove (moRandMove < M > & _random_move_generator, unsigned int _iteration_maximum_number):
unsigned int __max_iter):rand_move (__rand_move), random_move_generator(_random_move_generator), iteration_maximum_number(_iteration_maximum_number), iteration_number(0)
max_iter (__max_iter), num_iter (0)
{} {}
//! Generation of a new move //! Generation of a new move
/*! /*!
If the maximum number is not already reached, the current move is forgotten and remplaced by another one. If the maximum number is not already reached, the current move is forgotten and remplaced by another one.
\param __move the current move. \param _move the current move.
\param __sol the current solution. \param _solution the current solution.
\return FALSE if the maximum number of iteration is reached, else TRUE. \return false if the maximum number of iteration is reached, else true.
*/ */
bool operator () (M & __move, const EOT & __sol) bool operator () (M & _move, const EOT & _solution)
{ {
//code only used to avoid warning because _solution is not used in this function.
EOT solution=(EOT)_solution;
if (num_iter++ > max_iter) if (iteration_number++ > iteration_maximum_number)
{ {
iteration_number = 0;
num_iter = 0;
return false; return false;
} }
else
{
/* The given solution is discarded here */ random_move_generator (_move);
rand_move (__move); iteration_number++;
num_iter++;
return true; return true;
} }
}
private: private:
//! A move generator (generally randomly). //! A move generator (generally randomly).
moRandMove < M > &rand_move; moRandMove < M > & random_move_generator;
//! Iteration maximum number. //! Iteration maximum number.
unsigned int max_iter; unsigned int iteration_maximum_number;
//! Iteration current number. //! Iteration current number.
unsigned int num_iter; unsigned int iteration_number;
}; };
#endif #endif

View file

@ -1,41 +1,40 @@
/* /*
* <moLSCheckPoint.h> <moLSCheckPoint.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moSolUpdater_h #ifndef _moLSCheckPoint_h
#define __moSolUpdater_h #define _moLSCheckPoint_h
#include <eoFunctor.h> #include <eoFunctor.h>
@ -43,49 +42,42 @@
/*! /*!
Thanks to this class, at each iteration, additionnal function can be used (and not only one). Thanks to this class, at each iteration, additionnal function can be used (and not only one).
*/ */
template < class M > class moLSCheckPoint:public eoBF < const M &, const typename template < class M >
M::EOType &, void > class moLSCheckPoint:public eoBF < const M &, const typename M::EOType &, void >
{ {
public: public:
//! Function which launches the checkpointing //! Function which launches the checkpointing
/*! /*!
Each saved function is used on the current move and the current solution. Each saved function is used on the current move and the current solution.
\param __move a move. \param _move a move.
\param __sol a solution. \param _solution a solution.
*/ */
void void operator () (const M & _move, const typename M::EOType & _solution)
operator () (const M & __move, const typename M::EOType & __sol)
{ {
unsigned int i;
for (unsigned int i = 0; i < func.size (); i++) for (i = 0; i < functions.size (); i++)
{ {
func[i]->operator ()(__move, __sol); functions[i]->operator ()(_move, _solution);
} }
} }
//! Procedure which add a new function to the function vector //! Procedure which add a new function to the function vector
/*! /*!
The new function is added at the end of the vector. The new function is added at the end of the vector.
\param __f a new function to add. \param _function a new function to add.
*/ */
void void add (eoBF < const M &, const typename M::EOType &, void >& _function)
add (eoBF < const M &, const typename M::EOType &, void >&__f)
{ {
functions.push_back(& _function);
func.push_back (&__f);
} }
private: private:
//! vector of function //! Vector of functions.
std::vector < eoBF < const std::vector < eoBF < const M &, const typename M::EOType &, void >*> functions;
M &, const
typename
M::EOType &, void >*>
func;
}; };
#endif #endif

View file

@ -1,43 +1,42 @@
/* /*
* <moLinearCoolingSchedule.h> <moLinearCoolingSchedule.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
* (C) OPAC Team, LIFL, 2002-2007 (C) OPAC Team, LIFL, 2002-2008
*
* Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr) Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
*
* This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited liability. economic rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, 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 that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. same conditions as regards security.
* The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
*
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr ParadisEO WebSite : http://paradiseo.gforge.inria.fr
* Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*
*/ */
#ifndef __moLinearCoolingSchedule_h #ifndef _moLinearCoolingSchedule_h
#define __moLinearCoolingSchedule_h #define _moLinearCoolingSchedule_h
#include "moCoolingSchedule.h" #include <moCoolingSchedule.h>
//! One of the possible moCoolingSchedule //! One of the possible moCoolingSchedule
/*! /*!
@ -50,22 +49,22 @@ class moLinearCoolingSchedule: public moCoolingSchedule
public: public:
//! Simple constructor //! Simple constructor
/*! /*!
\param __threshold the threshold. \param _threshold the threshold.
\param __quantity the quantity used to descrease the temperature. \param _quantity the quantity used to descrease the temperature.
*/ */
moLinearCoolingSchedule (double __threshold, double __quantity):threshold (__threshold), quantity (__quantity) moLinearCoolingSchedule (double _threshold, double _quantity):threshold (_threshold), quantity (_quantity)
{} {}
//! Function which proceeds to the cooling. //! Function which proceeds to the cooling.
/*! /*!
It decreases 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. \param _current_temperature The current temperature.
\return if the new temperature (current temperature - quantity) is greater than the threshold. \return true if the new temperature (current temperature - quantity) is greater than the threshold, false otherwise.
*/ */
bool operator() (double &__temp) bool operator() (double & _current_temperature)
{ {
return (__temp -= quantity) > threshold; return (_current_temperature -= quantity) > threshold;
} }
private: private:

Some files were not shown because too many files have changed in this diff Show more