Class DistEmpiricalDiscreteLong
java.lang.Object
nl.tudelft.simulation.jstats.distributions.Dist
nl.tudelft.simulation.jstats.distributions.DistDiscrete
nl.tudelft.simulation.jstats.distributions.DistEmpiricalDiscreteLong
- All Implemented Interfaces:
Serializable
A discrete empirical distribution as defined on page 326 of Law & Kelton, based on an EmpiricalDistribution object.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Peter Jacobs , Alexander Verbraeck
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDistEmpiricalDiscreteLong
(StreamInterface stream, DiscreteEmpiricalDistribution empiricalDistribution) constructs a new DistEmpirical distribution. -
Method Summary
Modifier and TypeMethodDescriptionlong
draw()
draws the next long from the stream.double
probability
(long observation) returns the probability of the observation in this particular distribution.
-
Constructor Details
-
DistEmpiricalDiscreteLong
public DistEmpiricalDiscreteLong(StreamInterface stream, DiscreteEmpiricalDistribution empiricalDistribution) constructs a new DistEmpirical distribution.- Parameters:
stream
- StreamInterface; the stream to useempiricalDistribution
- EmpiricalDistributionInterface; the cumulative distribution to use- Throws:
IllegalArgumentException
- when the empirical distribution has non-integer values
-
-
Method Details
-
draw
public long draw()draws the next long from the stream.- Specified by:
draw
in classDistDiscrete
- Returns:
- long
-
probability
public double probability(long observation) returns the probability of the observation in this particular distribution.- Specified by:
probability
in classDistDiscrete
- Parameters:
observation
- long; the discrete observation.- Returns:
- double the probability.
-