In the TSP, the fitness has to be minimized ... with all the needed modification (for example, moSA.h)
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@587 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
f38dde99a5
commit
1d94071693
170 changed files with 748 additions and 837 deletions
|
|
@ -29,9 +29,8 @@ public:
|
|||
//! Basic constructor.
|
||||
/*!
|
||||
\param __fitness The fitness to reach.
|
||||
\param __minimization Indicate if the the aim is to maximize or minimize the fitness.
|
||||
*/
|
||||
moFitSolContinue (Fitness __fitness, bool __minimization=true): fitness (__fitness), minimization(__minimization)
|
||||
moFitSolContinue (Fitness __fitness): fitness (__fitness)
|
||||
{}
|
||||
|
||||
//! Function that activates the stopping criterion.
|
||||
|
|
@ -48,11 +47,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
if(minimization)
|
||||
{
|
||||
return __sol.fitness()>fitness;
|
||||
}
|
||||
return __sol.fitness()<=fitness;
|
||||
return __sol.fitness() < fitness;
|
||||
}
|
||||
|
||||
//! Procedure which allows to initialise all the stuff needed.
|
||||
|
|
@ -63,13 +58,6 @@ private:
|
|||
|
||||
//! Fitness target.
|
||||
Fitness fitness;
|
||||
|
||||
//! Flag that indicate if there is a minimization (true) or a maximization (false) of the fitness value.
|
||||
/*!
|
||||
It can be interesting to know this information because some solution-based metaheuristics can generate solution with a fitness that
|
||||
is worse that the best known fitness (in this case, the counter is not reinitialized).
|
||||
*/
|
||||
bool minimization;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue