1 |
|
/* |
2 |
|
* Written by Doug Lea and Bill Scherer with assistance from members |
3 |
|
* of JCP JSR-166 Expert Group and released to the public domain, as |
4 |
< |
* explained at http://creativecommons.org/licenses/publicdomain |
4 |
> |
* explained at http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.*; |
672 |
|
} |
673 |
|
|
674 |
|
/** |
675 |
< |
* Returns the cached distance between a pair of cities |
675 |
> |
* Returns the cached distance between a pair of cities. |
676 |
|
*/ |
677 |
|
int distanceBetween(int i, int j) { |
678 |
|
return distances[i][j]; |
682 |
|
static final double PSCALE = (double) 0x80000000L; |
683 |
|
|
684 |
|
/** |
685 |
< |
* Return distance for points scaled in [0,1). This simplifies |
685 |
> |
* Returns distance for points scaled in [0,1). This simplifies |
686 |
|
* checking results. The expected optimal TSP for random |
687 |
|
* points is believed to be around 0.76 * sqrt(N). For papers |
688 |
|
* discussing this, see |
705 |
|
|
706 |
|
int seed; |
707 |
|
RNG(int seed) { this.seed = seed; } |
708 |
< |
RNG() { this.seed = seedGenerator.nextInt() | 1; } |
708 |
> |
RNG() { this.seed = seedGenerator.nextInt() | 1; } |
709 |
|
|
710 |
|
int next() { |
711 |
|
int x = seed; |