00001 #ifndef GLSTATISTICSSIMPLE_H_
00002 #define GLSTATISTICSSIMPLE_H_
00003 #include <ostream>
00004 #include <string>
00005 #include <vector>
00006
00007 #include <NLInterfaceOutput.h>
00008 using namespace std;
00009 class GLBaseGaStatus;
00020 class GLStatisticsSimple : public nlutils::NLInterfaceOutput
00021 {
00022 public:
00031 GLStatisticsSimple(const vector<GLBaseGaStatus*>& results);
00032
00036 virtual ~GLStatisticsSimple();
00037
00042 int getNumberOfRuns()
00043 { return m_number_of_runs; }
00044
00051 const pair<long, long>& getMinMaxEvaluatorCalls() const
00052 { return m_minmax_evaluator_calls; }
00053
00061 const pair<int, int>& getMinMaxGenerationsToFindBest() const
00062 { return m_minmax_generations_to_find_best; }
00063
00074 const pair<int, int>& getMinMaxGenerationsToFindAllBests() const
00075 { return m_minmax_generations_to_find_all_bests; }
00076
00084 const pair<int, int>& getMinMaxNumberOfGenerations() const
00085 { return m_minmax_number_of_generations; }
00086
00093 const pair<double, double>& getStatEvaluatorCalls() const
00094 { return m_stat_evaluator_calls; }
00095
00104 const pair<double, double>& getStatGenerationsToFindBest() const
00105 { return m_stat_generations_to_find_best; }
00106
00117 const pair<double, double>& getStatGenerationsToFindAllBests() const
00118 { return m_stat_generations_to_find_all_bests; }
00119
00127 const pair<double, double>& getStatNumberOfGenerations() const
00128 { return m_stat_number_of_generations; }
00129
00133 virtual ostream& toStream(ostream& out) const;
00134
00135 private:
00140 void collectGaStatistics(const vector<GLBaseGaStatus*>& results);
00141 private:
00142
00143 int m_number_of_runs;
00144
00145
00146 pair<long, long> m_minmax_evaluator_calls;
00147
00148 pair<int, int> m_minmax_generations_to_find_best;
00149
00150 pair<int, int> m_minmax_generations_to_find_all_bests;
00151
00152 pair<int, int> m_minmax_number_of_generations;
00153
00154 pair<double, double> m_minmax_time;
00155
00156
00157
00158 pair<double, double> m_stat_evaluator_calls;
00159
00160 pair<double, double> m_stat_generations_to_find_best;
00161
00162 pair<double, double> m_stat_generations_to_find_all_bests;
00163
00164 pair<double, double> m_stat_number_of_generations;
00165
00166 pair<double, double> m_stat_time;
00167
00168 };
00169
00170 #endif