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
|
|
@ -38,44 +38,44 @@
|
|||
#include <continuator/moStat.h>
|
||||
|
||||
/**
|
||||
* The statistic which save the best solution found during the search
|
||||
* The statistic which save the best solution found during the search
|
||||
*/
|
||||
template <class EOT>
|
||||
class moBestSoFarStat : public moStat<EOT, EOT&>
|
||||
{
|
||||
public :
|
||||
using moStat< EOT , EOT& >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
moBestSoFarStat(): moStat<EOT, EOT&>(EOT(), "best") {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialization of the best solution on the first one
|
||||
* @param _sol the first solution
|
||||
*/
|
||||
virtual void init(EOT & _sol) {
|
||||
value() = _sol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the best solution
|
||||
* @param _sol the current solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol) {
|
||||
if (value().fitness() < _sol.fitness())
|
||||
value() = _sol;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return name of the class
|
||||
*/
|
||||
virtual std::string className(void) const {
|
||||
return "moBestSoFarStat";
|
||||
}
|
||||
|
||||
using moStat< EOT , EOT& >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
moBestSoFarStat(): moStat<EOT, EOT&>(EOT(), "best") {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialization of the best solution on the first one
|
||||
* @param _sol the first solution
|
||||
*/
|
||||
virtual void init(EOT & _sol) {
|
||||
value() = _sol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the best solution
|
||||
* @param _sol the current solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol) {
|
||||
if (value().fitness() < _sol.fitness())
|
||||
value() = _sol;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return name of the class
|
||||
*/
|
||||
virtual std::string className(void) const {
|
||||
return "moBestSoFarStat";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue