Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/main/java/net/webstructor/data/Counter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/webstructor/peer/Reputationer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down