Class DistUniform
java.lang.Object
nl.tudelft.simulation.jstats.distributions.Dist
nl.tudelft.simulation.jstats.distributions.DistContinuous
nl.tudelft.simulation.jstats.distributions.DistUniform
- All Implemented Interfaces:
Serializable
The Uniform distribution. For more information on this distribution see
https://mathworld.wolfram.com/UniformDistribution.html
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
ConstructorDescriptionDistUniform
(StreamInterface stream, double min, double max) constructs a new uniform distribution. -
Method Summary
Modifier and TypeMethodDescriptiondouble
draw()
draws the next stream value according to the probability of this this distribution.double
getMax()
Return the maximum value.double
getMin()
Return the minimum value.double
getProbabilityDensity
(double x) returns the probability density value of a value x.toString()
-
Constructor Details
-
DistUniform
constructs a new uniform distribution. min and max are real numbers with min less than max. min is a location parameter, max-min is a scale parameter.- Parameters:
stream
- StreamInterface; the random number streammin
- double; the minimum valuemax
- double; the maximum value
-
-
Method Details
-
draw
public double draw()draws the next stream value according to the probability of this this distribution.- Specified by:
draw
in classDistContinuous
- Returns:
- the next double value drawn.
-
getProbabilityDensity
public double getProbabilityDensity(double x) returns the probability density value of a value x.- Specified by:
getProbabilityDensity
in classDistContinuous
- Parameters:
x
- double; the value for which the density function needs to be calculated- Returns:
- double; the probability density for value x
-
getMin
public double getMin()Return the minimum value.- Returns:
- double; the minimum value
-
getMax
public double getMax()Return the maximum value.- Returns:
- double; the maximum value
-
toString
-