#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 AlgBase { public: AlgCarJam(const string name,const Json::Value rulejson, const string ruleId); virtual ~AlgCarJam(); public: virtual int init() override; virtual int calculate(string& outjson); private: //slide avg queue cache double m_sum; std::shared_ptr ihdb; //CMemTable* pFDAA; // HD3TimeRegion timeRegion; HD3Record **records_queried_; 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