1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

add static methods to create new instance

This commit is contained in:
oblonski 2015-04-24 19:54:12 +02:00
parent 4de30fdd2f
commit 7016f3baa3

View file

@ -24,6 +24,10 @@ public class RandomNumberGeneration {
private static Random random = new Random(DEFAULT_SEED);
public static Random newInstance(){
return new Random(DEFAULT_SEED);
}
public static Random getRandom() {
return random;
}
@ -33,6 +37,10 @@ public class RandomNumberGeneration {
}
public static void reset() {
reset(random);
}
public static void reset(Random random){
random.setSeed(DEFAULT_SEED);
}