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) { |
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() { |
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 |
|
} |