ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/TSPExchangerTest.java
(Generate patch)

Comparing jsr166/src/test/loops/TSPExchangerTest.java (file contents):
Revision 1.7 by jsr166, Thu Oct 29 23:11:03 2009 UTC vs.
Revision 1.8 by jsr166, Mon Nov 2 23:42:46 2009 UTC

# Line 300 | Line 300 | public class TSPExchangerTest {
300           */
301          void printSnapshot(double secs) {
302              int xs = totalExchanges();
303 <            long rate = (xs == 0)? 0L : (long)((secs * 1000000000.0) / xs);
303 >            long rate = (xs == 0) ? 0L : (long)((secs * 1000000000.0) / xs);
304              Chromosome bestc = subpops[0].chromosomes[0];
305              Chromosome worstc = bestc;
306              for (int k = 0; k < subpops.length; ++k) {
# Line 579 | Line 579 | public class TSPExchangerTest {
579          public int compareTo(Object x) { // to enable sorting
580              int xf = ((Chromosome)x).fitness;
581              int f = fitness;
582 <            return ((f == xf)? 0 :((f < xf)? -1 : 1));
582 >            return ((f == xf) ? 0 :((f < xf) ? -1 : 1));
583          }
584  
585          void recalcFitness() {
# Line 665 | Line 665 | public class TSPExchangerTest {
665                      double dy = (double)yPts[i] - (double)yPts[j];
666                      double dd = Math.hypot(dx, dy) / 2.0;
667                      long ld = Math.round(dd);
668 <                    distances[i][j] = (ld >= Integer.MAX_VALUE)?
668 >                    distances[i][j] = (ld >= Integer.MAX_VALUE) ?
669                          Integer.MAX_VALUE : (int)ld;
670                  }
671              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines