diff --git a/src/main/java/net/webstructor/data/Counter.java b/src/main/java/net/webstructor/data/Counter.java index a1d64de..c63c1b1 100644 --- a/src/main/java/net/webstructor/data/Counter.java +++ b/src/main/java/net/webstructor/data/Counter.java @@ -103,7 +103,13 @@ public Linker count(Linker other){ if (other != null) for (Iterator it = other.keys().iterator(); it.hasNext();){ Object key = it.next(); - count(key,round(other.value(key))); + Number value = other.value(key); + // Preserve double values for reputation scores (like predictiveness in range 0.0-1.0) + // Only round integer-like values + if (value instanceof Double || value instanceof Float) + count(key, value.doubleValue()); + else + count(key, round(value)); } return this; } diff --git a/src/main/java/net/webstructor/peer/Reputationer.java b/src/main/java/net/webstructor/peer/Reputationer.java index f1064fe..2d35c57 100644 --- a/src/main/java/net/webstructor/peer/Reputationer.java +++ b/src/main/java/net/webstructor/peer/Reputationer.java @@ -469,8 +469,7 @@ private int build(Date prevdate, Date nextdate, String[] domains){ sum += r[0]; den += r.length > 1 ? r[1] : 1; if (params.verbose) env.debug("reputation debug rating: "+rater+" "+ratee+" "+c[j].a+" "+c[j].b+" "+r[0]); - differential.count(ratee, raterValue * Math.round(r[0]), 0);//TODO: no round!? -// differential.count(ratee, Math.round(raterValue * r[0]), 0);//TODO: no round!? + differential.count(ratee, raterValue * r[0], 0); if (params.denomination && r.length > 1) normalizer.count(ratee, r[1], 0); if (params.spendings > 0 && r.length > 1)