1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.jstats.distributions;
11
12 import nl.tudelft.simulation.jstats.streams.StreamInterface;
13
14 /***
15 * The discrete distribution. For more information on this distribution see <a
16 * href="http://mathworld.wolfram.com/DiscreteDistribution.html">
17 * http://mathworld.wolfram.com/DiscreteDistribution.html </a>
18 * <p>
19 * (c) copyright 2002-2004 <a href="http://www.simulation.tudelft.nl">Delft
20 * University of Technology </a>, the Netherlands. <br>
21 * See for project information <a href="http://www.simulation.tudelft.nl">
22 * www.simulation.tudelft.nl </a> <br>
23 * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
24 * License (GPL) </a>, no warranty <br>
25 *
26 * @author <a href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">
27 * Alexander Verbraeck </a> <br>
28 * <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm"> Peter
29 * Jacobs </a>
30 * @version 1.7 2004-03-22
31 * @since 1.2
32 */
33 public abstract class DistDiscrete extends Dist
34 {
35 /***
36 * constructs a new disctete distribution
37 *
38 * @param stream the numberstream
39 */
40 public DistDiscrete(final StreamInterface stream)
41 {
42 super(stream);
43 }
44
45 /***
46 * draws the next long from the stream.
47 *
48 * @return long
49 */
50 public abstract long draw();
51
52 /***
53 * returns the propbability of the observation in this particular
54 * distribution.
55 *
56 * @param observation the discrete observation.
57 * @return double the probability.
58 */
59 public abstract double probability(final int observation);
60 }