Ajout des statistics, j'espère avoir fini ;)

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1804 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
verel 2010-05-07 15:42:18 +00:00
commit fb4a9f1df7
6 changed files with 268 additions and 0 deletions

View file

@ -34,6 +34,10 @@ using namespace std;
// the sampling class
#include <sampling/moDensityOfStatesSampling.h>
//-----------------------------------------------------------------------------
// the statistics class
#include <sampling/moStatistics.h>
// Declaration of types
//-----------------------------------------------------------------------------
// Indi is the typedef of the solution type like in paradisEO-eo
@ -165,6 +169,14 @@ void main_function(int argc, char **argv)
std::cout << "Last values:" << std::endl;
std::cout << "Fitness " << fitnessValues[fitnessValues.size() - 1] << std::endl;
// more basic statistics on the distribution:
double min, max, avg, std;
moStatistics statistics;
statistics.basic(fitnessValues, min, max, avg, std);
std::cout << "min=" << min << ", max=" << max << ", average=" << avg << ", std dev=" << std << std::endl;
}
// A main that catches the exceptions