source: src/main/java/weka/clusterers/forMetisMQI/Random.java @ 25

Last change on this file since 25 was 25, checked in by gnappo, 15 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
RevLine 
[6]1package weka.clusterers.forMetisMQI;
2
3public class Random extends java.util.Random {
4
5        private static final long serialVersionUID = 1L;
6       
7        private static Random instance = null;
8       
[25]9        private long seed = 1234567890;
10       
[6]11        /**
[25]12         * Return an instance of a random generator with a random seed.
[6]13         * @return
14         */
15        public static Random instance() {
[25]16                if(instance == null) {
17                        instance = new Random(/*new java.util.Random().nextLong()*/1234567890);
18                }
[6]19                return instance;
20        }
21       
[25]22        public long getSeed() {
23                return seed;
[6]24        }
[25]25       
26        private Random(long seed) {
27                super(seed);
28                this.seed = seed;
29        }
[6]30
31}
Note: See TracBrowser for help on using the repository browser.