Last change
on this file since 25 was
25,
checked in by gnappo, 14 years ago
|
Piccola modifica al generatore pseudo casuale da cui è possibile farsi restituire il seme. Aggiunta di alcuni script per analizzare l'output e creazione struttura directory provvisioria per l'output.
|
File size:
580 bytes
|
Line | |
---|
1 | package weka.clusterers.forMetisMQI; |
---|
2 | |
---|
3 | public class Random extends java.util.Random { |
---|
4 | |
---|
5 | private static final long serialVersionUID = 1L; |
---|
6 | |
---|
7 | private static Random instance = null; |
---|
8 | |
---|
9 | private long seed = 1234567890; |
---|
10 | |
---|
11 | /** |
---|
12 | * Return an instance of a random generator with a random seed. |
---|
13 | * @return |
---|
14 | */ |
---|
15 | public static Random instance() { |
---|
16 | if(instance == null) { |
---|
17 | instance = new Random(/*new java.util.Random().nextLong()*/1234567890); |
---|
18 | } |
---|
19 | return instance; |
---|
20 | } |
---|
21 | |
---|
22 | public long getSeed() { |
---|
23 | return seed; |
---|
24 | } |
---|
25 | |
---|
26 | private Random(long seed) { |
---|
27 | super(seed); |
---|
28 | this.seed = seed; |
---|
29 | } |
---|
30 | |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.