Class DistEmpiricalDiscreteLong


public class DistEmpiricalDiscreteLong extends DistDiscrete
A discrete empirical distribution as defined on page 326 of Law & Kelton, based on an EmpiricalDistribution object.

Copyright (c) 2002-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information DSOL Manual. The DSOL project is distributed under a three-clause BSD-style license, which can be found at DSOL License.

Author:
Peter Jacobs , Alexander Verbraeck
  • Constructor Details

    • DistEmpiricalDiscreteLong

      public DistEmpiricalDiscreteLong(StreamInterface stream, DiscreteEmpiricalDistribution empiricalDistribution)
      constructs a new DistEmpirical distribution.
      Parameters:
      stream - the stream to use
      empiricalDistribution - the cumulative distribution to use
      Throws:
      IllegalArgumentException - when the empirical distribution has non-integer values
  • Method Details

    • draw

      public long draw()
      Description copied from class: DistDiscrete
      draws the next long from the stream.
      Specified by:
      draw in class DistDiscrete
      Returns:
      long
    • probability

      public double probability(long observation)
      Description copied from class: DistDiscrete
      returns the probability of the observation in this particular distribution.
      Specified by:
      probability in class DistDiscrete
      Parameters:
      observation - the discrete observation.
      Returns:
      double the probability.