From 6219acefe25bfceaff6bf00e540b7c3504c730c3 Mon Sep 17 00:00:00 2001 From: Steve Dougherty Date: Thu, 17 May 2012 22:45:41 -0400 Subject: [PATCH] Random noise on link lengths. Link lengths are fairly identifiable - hopefully this will retain the interesting properties of the data while making it more difficult to connect to any given node. --- src/freenet/node/MHProbe.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/freenet/node/MHProbe.java b/src/freenet/node/MHProbe.java index caad3c40edc..8e3764f5311 100644 --- a/src/freenet/node/MHProbe.java +++ b/src/freenet/node/MHProbe.java @@ -344,9 +344,8 @@ public void request(final Message message, final PeerNode source, final AsyncMes double[] linkLengths = new double[degree()]; int i = 0; for (PeerNode peer : node.peers.connectedPeers) { - linkLengths[i++] = Math.min(Math.abs(peer.getLocation() - node.peers.node.getLocation()), - 1.0 - Math.abs(peer.getLocation() - node.peers.node.getLocation())); - //TODO: random noise or limit mantissa + linkLengths[i++] = randomNoise(Math.min(Math.abs(peer.getLocation() - node.peers.node.getLocation()), + 1.0 - Math.abs(peer.getLocation() - node.peers.node.getLocation()))); } result = DMT.createMHProbeLinkLengths(identifier, linkLengths); break;