Author: toad
Date: 2006-08-22 16:41:56 +0000 (Tue, 22 Aug 2006)
New Revision: 10236

Modified:
   trunk/freenet/src/freenet/node/LocationManager.java
   trunk/freenet/src/freenet/node/Version.java
Log:
952: Swapping algorithm was off slightly.

Modified: trunk/freenet/src/freenet/node/LocationManager.java
===================================================================
--- trunk/freenet/src/freenet/node/LocationManager.java 2006-08-22 16:14:04 UTC 
(rev 10235)
+++ trunk/freenet/src/freenet/node/LocationManager.java 2006-08-22 16:41:56 UTC 
(rev 10236)
@@ -557,7 +557,7 @@
      * 
      * If A > B then they switch.
      * 
-     * If A <= B, then calculate p = A^2 / B^2. They then switch with
+     * If A <= B, then calculate p = A / B. They then switch with
      * probability p (that is, switch if rand.nextFloat() < p).
      * 
      * @param myLoc My location as a double.
@@ -618,7 +618,7 @@

         if(A>B) return true;

-        double p = (A*A) / (B*B);
+        double p = A / B;

         // Take last 63 bits, then turn into a double
         double randProb = ((double)(rand & Long.MAX_VALUE)) 

Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-08-22 16:14:04 UTC (rev 
10235)
+++ trunk/freenet/src/freenet/node/Version.java 2006-08-22 16:41:56 UTC (rev 
10236)
@@ -21,7 +21,7 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       private static final int buildNumber = 951;
+       private static final int buildNumber = 952;

        /** Oldest build of Fred we will talk to */
        private static final int oldLastGoodBuild = 944;


Reply via email to