Skip to content
Snippets Groups Projects
Commit 3ec14e00 authored by Simon Könnecke's avatar Simon Könnecke
Browse files

add q-digest data structure

parent c9ca1bb8
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
<artifactId>jgraphx</artifactId> <artifactId>jgraphx</artifactId>
<version>1.10.1.3</version> <version>1.10.1.3</version>
</dependency> </dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>7.0.12</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -21,6 +21,9 @@ import java.util.concurrent.ConcurrentLinkedQueue; ...@@ -21,6 +21,9 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class WalletImpl extends AbstractWallet { public class WalletImpl extends AbstractWallet {
private static final double sCompression = 0.7;
private QDigest qDigest = new QDigest(sCompression);
private ActorRef preKnownNeighbour; private ActorRef preKnownNeighbour;
private ActorRef remoteSuperVisorActor; private ActorRef remoteSuperVisorActor;
private transient WalletGuiControl gui; private transient WalletGuiControl gui;
...@@ -51,6 +54,7 @@ public class WalletImpl extends AbstractWallet { ...@@ -51,6 +54,7 @@ public class WalletImpl extends AbstractWallet {
*/ */
public void addAmount(int amount) { public void addAmount(int amount) {
setAmount(this.getAmount() + amount); setAmount(this.getAmount() + amount);
qDigest.offer(amount);
addLogMsg(" My amount is now " + this.getAmount()); addLogMsg(" My amount is now " + this.getAmount());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment