The range equivalent of dice, each element of which is the result of the roll of a random die with relative probabilities stored in the range proportions. Each successive value of front reflects the index in proportions that was chosen. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Provides an infinite range of random numbers distributed according to the normal (Gaussian) distribution with mean mu and standard deviation sigma. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Provides an infinite sequence of random numbers uniformly distributed in the interval [0, 1). If no RNG is specified, uniformDistribution will use the default generator rndGen.
Provides an infinite sequence of random numbers uniformly distributed between a and b. The boundaries parameter controls the shape of the interval (open vs. closed on either side). Valid values for boundaries are "[]", "$(LPAREN)]", "[$(RPAREN)", and "()". The default interval is closed to the left and open to the right. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Generates an infinite sequence of uniformly-distributed numbers in the range [T.min, T.max] for any integral type T. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Generates an infinite sequence of uniformly selected members of enum E. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Rolls a random die with relative probabilities stored in proportions. Returns the index in proportions that was chosen.
The range equivalent of dice, each element of which is the result of the roll of a random die with relative probabilities stored in the range proportions. Each successive value of front reflects the index in proportions that was chosen. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Returns a floating-point number drawn from a normal (Gaussian) distribution with mean mu and standard deviation sigma. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Provides an infinite range of random numbers distributed according to the normal (Gaussian) distribution with mean mu and standard deviation sigma. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Generates a number between a and b. The boundaries parameter controls the shape of the interval (open vs. closed on either side). Valid values for boundaries are "[]", "$(LPAREN)]", "[$(RPAREN)", and "()". The default interval is closed to the left and open to the right. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Generates a uniformly-distributed number in the range [T.min, T.max] for any integral type T. If no random number generator is passed, uses the default rndGen.
Returns a uniformly selected member of enum E. If no random number generator is passed, uses the default rndGen.
Generates a uniformly-distributed floating point number of type T in the range [0, 1). If no random number generator is specified, the default RNG rndGen will be used as the source of randomness.
Provides an infinite sequence of random numbers uniformly distributed in the interval [0, 1). If no RNG is specified, uniformDistribution will use the default generator rndGen.
Provides an infinite sequence of random numbers uniformly distributed between a and b. The boundaries parameter controls the shape of the interval (open vs. closed on either side). Valid values for boundaries are "[]", "$(LPAREN)]", "[$(RPAREN)", and "()". The default interval is closed to the left and open to the right. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Generates an infinite sequence of uniformly-distributed numbers in the range [T.min, T.max] for any integral type T. If no random number generator is specified, the default rndGen will be used as the source of randomness.
Generates an infinite sequence of uniformly selected members of enum E. If no random number generator is specified, the default rndGen will be used as the source of randomness.
See Source File
$(HAPSRC hap/random/_distribution.d)
© 2008-2011 Andrei Alexandrescu, 2013 Chris Cain, 2013 Andrej Mitrović, 2013-2014 Joseph Rushton Wakeling
Implements algorithms for generating random numbers drawn from different statistical distributions. Where possible, each random distribution is provided in two different forms:
Typical reasons for rejecting a function implementation include the function needing to hold state between calls to achieve adequate performance, or the function needing to allocate memory with each call.
As with random number generators, the random distribution range objects implemented here are final classes in order to ensure reference semantics. They also assume reference type semantics on the part of the RNGs that they wrap: user-supplied value-type RNGs may produce unexpected and incorrect behaviour when combined with these objects.
Note: hap._random._distribution.dice uses a different algorithm to its std.random counterpart and so will produce different results.