Added bounds to FitnessStat and Gnuplot monitor
This commit is contained in:
parent
86c7c8fe95
commit
18cd20da78
3 changed files with 60 additions and 6 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#ifndef _eoScalarFitnessStat_h
|
||||
#define _eoScalarFitnessStat_h
|
||||
|
||||
#include <utils/eoRealVectorBounds.h>
|
||||
#include <utils/eoStat.h>
|
||||
|
||||
/**
|
||||
|
|
@ -36,15 +37,24 @@ template <class EOT, class FitT = typename EOT::Fitness>
|
|||
class eoScalarFitnessStat : public eoSortedStat<EOT, vector<double> >
|
||||
{
|
||||
public :
|
||||
eoScalarFitnessStat(std::string _description = "FitnessES") :
|
||||
eoSortedStat<EOT, vector<double> >(vector<double>(0), _description) {}
|
||||
|
||||
virtual void operator()(const vector<const EOT*>& _popPters)
|
||||
eoScalarFitnessStat(std::string _description = "FitnessES",
|
||||
eoRealVectorBounds & _bounds = eoDummyVectorNoBounds) :
|
||||
eoSortedStat<EOT, vector<double> >(vector<double>(0), _description) ,
|
||||
range(*_bounds[0])
|
||||
{}
|
||||
|
||||
virtual void operator()(const vector<const EOT*>& _popPters)
|
||||
{
|
||||
value().resize(_popPters.size());
|
||||
for (unsigned i=0; i<_popPters.size(); i++)
|
||||
value()[i] = _popPters[i]->fitness();
|
||||
{
|
||||
value()[i] = _popPters[i]->fitness();
|
||||
range.truncate(value()[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private :
|
||||
eoRealBounds & range;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Reference in a new issue