Class DistDiscreteConstant
- java.lang.Object
-
- nl.tudelft.simulation.jstats.distributions.Dist
-
- nl.tudelft.simulation.jstats.distributions.DistDiscrete
-
- nl.tudelft.simulation.jstats.distributions.DistDiscreteConstant
-
- All Implemented Interfaces:
Serializable
public class DistDiscreteConstant extends DistDiscrete
The Constant distribution. This distribution maskers a constant discrete value.Copyright (c) 2002-2023 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DistDiscreteConstant(StreamInterface stream, long constant)creates a new discrete constant distribution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdraw()draws the next long from the stream.longgetConstant()Return the constant.doubleprobability(long observation)returns the probability of the observation in this particular distribution.StringtoString()
-
-
-
Constructor Detail
-
DistDiscreteConstant
public DistDiscreteConstant(StreamInterface stream, long constant)
creates a new discrete constant distribution.- Parameters:
stream- StreamInterface; the random number streamconstant- long; the value for this distribution
-
-
Method Detail
-
draw
public long draw()
draws the next long from the stream.- Specified by:
drawin classDistDiscrete- Returns:
- long
-
probability
public double probability(long observation)
returns the probability of the observation in this particular distribution.- Specified by:
probabilityin classDistDiscrete- Parameters:
observation- long; the discrete observation.- Returns:
- double the probability.
-
getConstant
public long getConstant()
Return the constant.- Returns:
- double; the constant
-
-