1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.gscg.experiment;
15
16 import nl.tudelft.simulation.jstats.distributions.DistTriangular;
17 import nl.tudelft.simulation.jstats.streams.StreamInterface;
18
19 /***
20 * The discrete Triangular distribution <br>
21 *
22 * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
23 * Delft, the Netherlands. All rights reserved.
24 *
25 * See for project information <a href="http://www.simulation.tudelft.nl/">
26 * www.simulation.tudelft.nl </a>.
27 *
28 * The source code and binary code of this software is proprietary information
29 * of Delft University of Technology.
30 *
31 * @author <a
32 * href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
33 * Verbraeck </a>
34 * @version $Revision: 1.1 $ $Date: 2005/06/16 12:34:00 $
35 * @since 1.0.0
36 */
37 public class DistTriangularDiscrete extends DistTriangular
38 {
39 /*** the serial version uid */
40 private static final long serialVersionUID = 11L;
41
42 /*** the stream */
43 private StreamInterface stream = null;
44
45 /*** a */
46 private double a = Double.NaN;
47
48 /*** b */
49 private double b = Double.NaN;
50
51 /*** c */
52 private double c = Double.NaN;
53
54 /***
55 * @param stream the stream
56 * @param a long a
57 * @param b long b
58 * @param c long c
59 */
60 public DistTriangularDiscrete(final StreamInterface stream, final double a,
61 final double b, final double c)
62 {
63 super(stream, a, b, c);
64 this.stream = stream;
65 this.a = a;
66 this.b = b;
67 this.c = c;
68 }
69
70 /***
71 * @return Returns the a.
72 */
73 public double getA()
74 {
75 return this.a;
76 }
77
78 /***
79 * @return Returns the b.
80 */
81 public double getB()
82 {
83 return this.b;
84 }
85
86 /***
87 * @return Returns c.
88 */
89 public double getC()
90 {
91 return this.c;
92 }
93
94 /***
95 * @return Returns the stream.
96 */
97 public StreamInterface getStream()
98 {
99 return this.stream;
100 }
101
102 /***
103 * @see nl.tudelft.simulation.jstats.distributions.DistTriangular#draw()
104 */
105 public double draw()
106 {
107 return Math.floor(super.draw());
108 }
109 }