View Javadoc
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-2025 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/dsol/manual/" target="_blank">DSOL Manual</a>. The DSOL
12   * project is distributed under a three-clause BSD-style license, which can be found at
13   * <a href="https://simulation.tudelft.nl/dsol/docs/latest/license.html" target="_blank">DSOL License</a>.
14   * </p>
15   * @author <a href="https://www.linkedin.com/in/peterhmjacobs">Peter Jacobs </a>
16   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
17   */
18  public abstract class DistDiscrete extends Dist
19  {
20      /**
21       * constructs a new discrete distribution.
22       * @param stream the random number stream
23       */
24      public DistDiscrete(final StreamInterface stream)
25      {
26          super(stream);
27      }
28  
29      /**
30       * draws the next long from the stream.
31       * @return long
32       */
33      public abstract long draw();
34  
35      /**
36       * returns the probability of the observation in this particular distribution.
37       * @param observation the discrete observation.
38       * @return double the probability.
39       */
40      public abstract double probability(long observation);
41  }