diff --git a/src/freenet/node/LocationManager.java b/src/freenet/node/LocationManager.java index 74b8814..67ec354 100644 --- a/src/freenet/node/LocationManager.java +++ b/src/freenet/node/LocationManager.java @@ -746,37 +746,45 @@ public class LocationManager implements ByteCounter { if(logMINOR) Logger.minor(this, sb.toString()); double A = 1.0; + int Ac = 0; for(int i=0;i A="+A+" B="+B + " swap = " + (A>B)); if(A>B) return true; - double p = A / B; + double p = Math.pow(0.01, 1.0-A / B); // Take last 63 bits, then turn into a double double randProb = ((double)(rand & Long.MAX_VALUE)) / ((double) Long.MAX_VALUE); - //Logger.normal(this, "p="+p+" randProb="+randProb); + Logger.normal(this, "`~~> p="+p+" randProb="+randProb + " swap = " +(randProb < p) ); if(randProb < p) return true; return false;