Class DistDiscreteConstant
java.lang.Object
nl.tudelft.simulation.jstats.distributions.Dist
nl.tudelft.simulation.jstats.distributions.DistDiscrete
nl.tudelft.simulation.jstats.distributions.DistDiscreteConstant
The Constant distribution. This distribution maskers a constant discrete value.
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
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDistDiscreteConstant(StreamInterface stream, long constant) creates a new discrete constant distribution. -
Method Summary
Modifier and TypeMethodDescriptionlongdraw()draws the next long from the stream.longReturn the constant.doubleprobability(long observation) returns the probability of the observation in this particular distribution.toString()
-
Constructor Details
-
DistDiscreteConstant
creates a new discrete constant distribution.- Parameters:
stream- the random number streamconstant- the value for this distribution
-
-
Method Details
-
draw
public long draw()Description copied from class:DistDiscretedraws the next long from the stream.- Specified by:
drawin classDistDiscrete- Returns:
- long
-
probability
public double probability(long observation) Description copied from class:DistDiscretereturns the probability of the observation in this particular distribution.- Specified by:
probabilityin classDistDiscrete- Parameters:
observation- the discrete observation.- Returns:
- double the probability.
-
getConstant
public long getConstant()Return the constant.- Returns:
- the constant
-
toString
-