Produces a floating point value from an exponential distribution.
Declared in <absl/random/distributions.h>
template<
typename RealType,
typename URBG>
RealType
Exponential(
URBG&& urbg,
RealType lambda = 1);
absl::Exponential produces a floating point number representing the distance (time) between two consecutive events in a point process of events occurring continuously and independently at a constant average rate lambda. T must be a floating point type, but may be inferred from the type of lambda.
The mean of the distribution is 1/lambda.
See https://en.wikipedia.org/wiki/Exponential_distribution.
Example:
absl::BitGen bitgen; ... double call_length = absl::Exponential(bitgen, 7.0);
A random value drawn from the exponential distribution.
| Name | Description |
|---|---|
| urbg | The uniform random bit generator. |
| lambda | The constant average rate of events. |