Passage du code dans un pretty printer
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1813 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
cc31901008
commit
3d8057ac4d
88 changed files with 2726 additions and 2720 deletions
|
|
@ -36,17 +36,17 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
* Dummy Evaluation function
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moDummyEval : public moEval<Neighbor>{
|
||||
class moDummyEval : public moEval<Neighbor> {
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef typename EOT::Fitness Fitness;
|
||||
|
||||
/**
|
||||
* NOTHING TO DO
|
||||
* @param _sol a solution (unused)
|
||||
* @param _n a neighbor (unused)
|
||||
*/
|
||||
void operator()(EOT& _sol, Neighbor& _n){}
|
||||
* NOTHING TO DO
|
||||
* @param _sol a solution (unused)
|
||||
* @param _n a neighbor (unused)
|
||||
*/
|
||||
void operator()(EOT& _sol, Neighbor& _n) {}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
#include <eval/moEval.h>
|
||||
#include <utils/eoParam.h>
|
||||
|
||||
/**
|
||||
/**
|
||||
Counts the number of neighbor evaluations actually performed, thus checks first
|
||||
if it has to evaluate.. etc.
|
||||
*/
|
||||
|
|
@ -41,25 +41,25 @@ template<class Neighbor>
|
|||
class moEvalCounter : public moEval<Neighbor>, public eoValueParam<unsigned long>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef typename EOT::Fitness Fitness;
|
||||
|
||||
moEvalCounter(moEval<Neighbor>& _eval, std::string _name = "Neighbor Eval. ")
|
||||
: eoValueParam<unsigned long>(0, _name), eval(_eval) {}
|
||||
|
||||
/**
|
||||
* Increase the number of neighbor evaluations and perform the evaluation
|
||||
*
|
||||
* @param _solution a solution
|
||||
* @param _neighbor a neighbor
|
||||
*/
|
||||
void operator()(EOT& _solution, Neighbor& _neighbor) {
|
||||
value()++;
|
||||
eval(_solution, _neighbor);
|
||||
}
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef typename EOT::Fitness Fitness;
|
||||
|
||||
moEvalCounter(moEval<Neighbor>& _eval, std::string _name = "Neighbor Eval. ")
|
||||
: eoValueParam<unsigned long>(0, _name), eval(_eval) {}
|
||||
|
||||
/**
|
||||
* Increase the number of neighbor evaluations and perform the evaluation
|
||||
*
|
||||
* @param _solution a solution
|
||||
* @param _neighbor a neighbor
|
||||
*/
|
||||
void operator()(EOT& _solution, Neighbor& _neighbor) {
|
||||
value()++;
|
||||
eval(_solution, _neighbor);
|
||||
}
|
||||
|
||||
private:
|
||||
moEval<Neighbor> & eval;
|
||||
moEval<Neighbor> & eval;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue