source: xssim/trunk/src/eduni/simjava/distributions/DetailDistGenerator.java @ 104

Revision 104, 870 bytes checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package eduni.simjava.distributions;
2
3import cern.jet.random.AbstractDistribution;
4
5/**
6 *
7 * @author Marcin Krystek
8 *
9 */
10
11public class DetailDistGenerator extends AbstractSpecificGenerator {
12       
13        /**
14         * interval length
15         */
16        private double prcnt;
17       
18        public DetailDistGenerator(AbstractDistribution generator){
19                super(generator);
20                this.prcnt = 0;
21        }
22       
23        public DetailDistGenerator(AbstractDistribution generator, double prcnt){
24                super(generator);
25                this.prcnt = prcnt;
26        }
27
28        /**
29         * Returns percentage interval length.
30         * @return
31         */
32        public double getPrcnt(){
33                return prcnt;
34        }
35
36        public int compareTo(AbstractSpecificGenerator o) {
37                if(o instanceof DetailDistGenerator) {
38                       
39                        DetailDistGenerator ddg = (DetailDistGenerator) o;
40                        double anotherPrcnt = ddg.getPrcnt();
41                        return Double.compare(prcnt, anotherPrcnt);
42                       
43                } else {
44                        return -1;
45                }
46               
47        }
48       
49}
Note: See TracBrowser for help on using the repository browser.