1 package nl.tudelft.simulation.jstats.distributions;
2
3 import nl.tudelft.simulation.jstats.streams.StreamInterface;
4
5 /**
6 * The discrete distribution. For more information on this distribution see
7 * <a href="https://mathworld.wolfram.com/DiscreteDistribution.html"> https://mathworld.wolfram.com/DiscreteDistribution.html
8 * </a>
9 * <p>
10 * Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
11 * for project information <a href="https://simulation.tudelft.nl/" target="_blank"> https://simulation.tudelft.nl</a>. The DSOL
12 * project is distributed under a three-clause BSD-style license, which can be found at
13 * <a href="https://https://simulation.tudelft.nl/dsol/docs/latest/license.html" target="_blank">
14 * https://https://simulation.tudelft.nl/dsol/docs/latest/license.html</a>.
15 * </p>
16 * @author <a href="https://www.linkedin.com/in/peterhmjacobs">Peter Jacobs </a>
17 * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
18 */
19 public abstract class DistDiscrete extends Dist
20 {
21 /** */
22 private static final long serialVersionUID = 1L;
23
24 /**
25 * constructs a new discrete distribution.
26 * @param stream StreamInterface; the random number stream
27 */
28 public DistDiscrete(final StreamInterface stream)
29 {
30 super(stream);
31 }
32
33 /**
34 * draws the next long from the stream.
35 * @return long
36 */
37 public abstract long draw();
38
39 /**
40 * returns the probability of the observation in this particular distribution.
41 * @param observation long; the discrete observation.
42 * @return double the probability.
43 */
44 public abstract double probability(long observation);
45 }