00001 00002 00007 #ifndef ADAPT5_H 00008 #define ADAPT5_H 00009 00010 #define ALGORITHM_TO_USE 4 00011 00012 class adapt5 : public opt3 { 00013 public: 00014 int iter, objUsage; 00015 int recentAvgRBLeash, recentTotalRBLeash, recentAvgRBLeashCount, avgEventsPerRB; 00016 int avgRBsPerGVTIter, recentAvgEventSparsity; 00017 bool initialAvgRBLeashCalc; // true until the first rollback occurs 00018 adapt5() { 00019 // divide maximums by 64 to give some room in case POSE_TimeType is an int 00020 // timeLeashTotal = 0LL; 00021 // stepCalls = 0; 00022 iter = 0; 00023 objUsage = pose_config.max_usage * pose_config.store_rate; 00024 STRAT_T = ADAPT5_T; 00025 //timeLeash = POSE_TimeMax/2; 00026 timeLeash = POSE_TimeMax / 64; 00027 avgRBsPerGVTIter = 0; 00028 recentAvgEventSparsity = 1; 00029 recentAvgRBLeash = 1000; 00030 recentTotalRBLeash = 0; 00031 recentAvgRBLeashCount = 0; 00032 avgEventsPerRB = 1000; 00033 initialAvgRBLeashCalc = true; 00034 } 00035 virtual void Step(); 00037 inline void setAvgRBsPerGVTIter(int avgRBs) { avgRBsPerGVTIter = avgRBs; } 00039 inline void setRecentAvgEventSparsity(int avgSparsity) { recentAvgEventSparsity = avgSparsity; } 00041 inline void setTimeLeash(POSE_TimeType tl) { 00042 #if ALGORITHM_TO_USE == 4 00043 timeLeash = tl; 00044 if (timeLeash > 50000) { 00045 timeLeash = 50000; 00046 } 00047 if (timeLeash < 1) { 00048 timeLeash = 1; 00049 } 00050 #endif 00051 } 00052 }; 00053 00054 #endif