43 lines
929 B
C++
43 lines
929 B
C++
#ifndef _H_ALGORITHM_CAR_JAM_H
|
|
#define _H_ALGORITHM_CAR_JAM_H
|
|
|
|
#include <eqpalg/AlgCommonDefine.h>
|
|
#include <eqpalg/AlgorithmBase.h>
|
|
#include <queue>
|
|
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<T_LOV_FDAAITEM::STR_T_LOV_FDAAITEM>* 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
|