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:
parent
4de30fdd2f
commit
7016f3baa3
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue