Add the autocorrelation sampling
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1777 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
69eda3cd18
commit
adde4c4898
9 changed files with 335 additions and 30 deletions
|
|
@ -42,35 +42,35 @@
|
|||
* that need to be calculated over the solution
|
||||
* It is a moStatBase AND an eoValueParam so it can be used in Monitors.
|
||||
*/
|
||||
template <class EOT, class T=typename EOT::Fitness>
|
||||
class moFitnessStat : public moStat<EOT, T>
|
||||
template <class EOT>
|
||||
class moFitnessStat : public moStat<EOT, typename EOT::Fitness>
|
||||
{
|
||||
public :
|
||||
typedef T Fitness;
|
||||
using moStat< EOT, Fitness >::value;
|
||||
typedef typename EOT::Fitness Fitness;
|
||||
using moStat< EOT, Fitness >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _description a description of the stat
|
||||
*/
|
||||
moFitnessStat(std::string _description = "fitness"):
|
||||
moStat<EOT, Fitness>(Fitness(), _description) {}
|
||||
|
||||
/**
|
||||
* store fitness value
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol)
|
||||
{
|
||||
value() = _sol.fitness();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name of the class
|
||||
*/
|
||||
virtual std::string className(void) const {
|
||||
return "moFitnessStat";
|
||||
}
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _description a description of the stat
|
||||
*/
|
||||
moFitnessStat(std::string _description = "fitness"):
|
||||
moStat<EOT, Fitness>(Fitness(), _description) {}
|
||||
|
||||
/**
|
||||
* store fitness value
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol)
|
||||
{
|
||||
value() = _sol.fitness();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name of the class
|
||||
*/
|
||||
virtual std::string className(void) const {
|
||||
return "moFitnessStat";
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue