Skip to content

Commit 794d58c

Browse files
committed
get item slot in histogram using 'count' key instead of index
1 parent f61a70e commit 794d58c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/main/java/swim/tutorial/UnitAgent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class UnitAgent extends AbstractAgent {
6262
logMessage("histogram: replaced " + k + "'s value to " + Recon.toString(n) + " from " + Recon.toString(o));
6363

6464
// calculating overall mean to send to average lane
65-
countSum += n.getItem(0).longValue();
65+
countSum += n.get("count").longValue();
6666
countTotal ++;
6767
final long setAvg = countSum / countTotal;
6868
avg.set(setAvg);
@@ -71,7 +71,7 @@ public class UnitAgent extends AbstractAgent {
7171
if (index >= recentData.length-1) {
7272
index = 0;
7373
}
74-
recentData[index] = n.getItem(0).longValue();
74+
recentData[index] = n.get("count").longValue();
7575
index ++;
7676

7777
// calculating local mean to send to local average lane
@@ -103,7 +103,7 @@ public class UnitAgent extends AbstractAgent {
103103
logMessage("histogram: removed <" + k + "," + Recon.toString(o) + ">");
104104

105105
// remove logic for avg lane
106-
countSum -= o.getItem(0).longValue();
106+
countSum -= o.get("count").longValue() ;
107107
countTotal --;
108108
final long setUpdatedAvg = countSum / countTotal;
109109
avg.set(setUpdatedAvg);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy