Changeset 25 for src/main/java/weka/clusterers/forMetisMQI/Random.java
- Timestamp:
- Oct 8, 2010, 10:28:38 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/Random.java
r6 r25 7 7 private static Random instance = null; 8 8 9 private long seed = 1234567890; 10 9 11 /** 10 * Return an instance of a random generator with a defaultseed.12 * Return an instance of a random generator with a random seed. 11 13 * @return 12 14 */ 13 15 public static Random instance() { 14 if(instance == null) 15 instance = new Random(); 16 if(instance == null) { 17 instance = new Random(/*new java.util.Random().nextLong()*/1234567890); 18 } 16 19 return instance; 17 20 } 18 21 19 private Random() { 20 super(1234567890); 22 public long getSeed() { 23 return seed; 24 } 25 26 private Random(long seed) { 27 super(seed); 28 this.seed = seed; 21 29 } 22 30
Note: See TracChangeset
for help on using the changeset viewer.