#ifndef _H_ALGORITHM_CAR_JAM_H #define _H_ALGORITHM_CAR_JAM_H #include #include #include const int SAMPLE_NUM = 1000; const int BACK_WORD = 1; class AlgCarJam:virtual public AlgorithmBase { public: AlgCarJam(const string name,const Json::Value rulejson, const string ruleid); virtual ~AlgCarJam(); public: virtual int Reload(); virtual int calculate(string& outjson); private: //slide avg queue cache double m_sum; IHDBTools* mp_ihdb; //CMemTable* pFDAA; // HD3TimeRegion timeRegion; HD3Record **mp_recordsQueried; private: bool have_sample; time_t m_curr, m_start, m_end; double ave_curr_noload[SAMPLE_NUM]; double ave_curr_load[SAMPLE_NUM]; double limit_curr_noload[SAMPLE_NUM]; double limit_curr_load[SAMPLE_NUM]; bool work_finished; }; #endif