00001
00020 #ifndef _EA_STATISTICS_H
00021
00022 #define _EA_STATISTICS_H 1
00023
00030 #include "problem.h"
00031 #include "populationreal.h"
00032
00033 namespace realea {
00034
00035 class Statistics {
00036 public:
00040 Statistics (int num_gen);
00041
00042 void setProblem(Problem *problem) {
00043 m_problem = problem;
00044 }
00045
00046
00047
00048
00049 void reset(void);
00050
00057 void newEvent(string event);
00061 void activeEvent(string event);
00065 void newExperiment(void);
00069 void newGeneration(void);
00073 void endGeneration(tFitness best);
00077 void endExperiment(void);
00078 private:
00079 Problem *m_problem;
00080 tFitness m_lastbest;
00081 unsigned m_experiment, m_generation;
00082 unsigned m_rate;
00083 map<string,bool> m_events;
00084 };
00085
00086 }
00087 #endif