Skip to content

Instantly share code, notes, and snippets.

@cogmission
Created January 13, 2015 21:55
Show Gist options
  • Save cogmission/3e3fab710f06052aff6f to your computer and use it in GitHub Desktop.
Save cogmission/3e3fab710f06052aff6f to your computer and use it in GitHub Desktop.
Seed as -1 issue
public void initEncoder(double resolution, int w, int n, Double offset,
long seed) {
// MersenneTwister says it is better to pass an int seed even though it
// accepts long??
rng = seed == -1 ? new MersenneTwister() : new MersenneTwister(seed);
initializeBucketMap(getMaxBuckets(), getOffset());
if (getName() == null || getName().isEmpty()) {
setName("[" + getResolution() + "]");
}
if (getVerbosity() > 0)
System.out.println(dump());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment