improve heuristics

This commit is contained in:
Pieter Wuille 2012-05-30 19:17:17 +02:00
parent 9e238be677
commit 0aff2d1817

15
db.h
View file

@ -94,10 +94,11 @@ public:
if (total <= 3 && success * 2 >= total) return true;
if (stat2H.reliability > 0.7 && stat2H.count > 1) return true;
if (stat8H.reliability > 0.6 && stat8H.count > 2) return true;
if (stat1D.reliability > 0.5 && stat1D.count > 4) return true;
if (stat1W.reliability > 0.4 && stat1W.count > 8) return true;
if (stat2H.reliability > 0.85 && stat2H.count > 2) return true;
if (stat8H.reliability > 0.70 && stat8H.count > 4) return true;
if (stat1D.reliability > 0.55 && stat1D.count > 8) return true;
if (stat1W.reliability > 0.45 && stat1W.count > 16) return true;
if (stat1M.reliability > 0.35 && stat1M.count > 32) return true;
return false;
}
@ -108,10 +109,10 @@ public:
}
int GetIgnoreTime() const {
if (IsGood()) return 0;
if (stat8H.reliability - stat8H.weight + 1.0 < 0.20 && stat8H.count > 6) { return 1*3600; }
if (stat1D.reliability - stat1D.weight + 1.0 < 0.16 && stat1D.count > 12) { return 2*3600; }
if (stat1W.reliability - stat1W.weight + 1.0 < 0.12 && stat8H.count > 24) { return 4*3600; }
if (stat1M.reliability - stat1M.weight + 1.0 < 0.08 && stat1D.count > 48) { return 8*3600; }
if (stat1W.reliability - stat1W.weight + 1.0 < 0.12 && stat8H.count > 24) { return 4*3600; }
if (stat1D.reliability - stat1D.weight + 1.0 < 0.16 && stat1D.count > 12) { return 2*3600; }
if (stat8H.reliability - stat8H.weight + 1.0 < 0.20 && stat8H.count > 6) { return 1*3600; }
return 0;
}