From 0aff2d18175ef384161808c66ac2da85d0ad2696 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 30 May 2012 19:17:17 +0200 Subject: [PATCH] improve heuristics --- db.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/db.h b/db.h index 7eaff7d..4bca72a 100644 --- a/db.h +++ b/db.h @@ -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; }