00001 #ifndef STATCALC_H_
00002 #define STATCALC_H_
00003
00008 class StatCalc : public Operator
00009 {
00010 private:
00011 uint statNo;
00012 std::vector<double> average_;
00013 std::vector<double> stdDev_;
00014 std::vector<double> max_;
00015 std::vector<double> min_;
00016 std::vector<uint> sampleSize_;
00017 std::vector<uint> time_;
00018 StateP state_;
00019 std::string statsFileName_;
00020 std::ofstream statsFile_;
00021
00022 public:
00023 StatCalc();
00024
00025 bool operate(StateP)
00026 { return false; }
00027
00031 bool operate(const std::vector<IndividualP>&);
00032
00033 void registerParameters(StateP);
00034
00035 bool initialize(StateP);
00036
00040 bool update(std::vector<double>);
00041
00045 void log(int generation = -1);
00046
00050 std::vector<double> getStats(int generation = -1);
00051
00052 void output(uint step);
00053
00057 double getFitnessMin(int generation = -1);
00058
00062 double getFitnessMax(int generation = -1);
00063 };
00064 typedef boost::shared_ptr<StatCalc> StatCalcP;
00065
00066 #endif