template<typename RealType = double>
class Infinity::Engine::ExponentialDistribution< RealType >
Platform-independent exponential distribution.
Produces positive values according to the exponential distribution with rate parameter lambda. Models time between events in a Poisson process, making it fundamental for modeling waiting times and lifetimes.
The exponential distribution is the continuous analog of the geometric distribution and is the only continuous distribution with the memoryless property: the probability of an event occurring in the next time interval is independent of how much time has already elapsed.
- Template Parameters
-
| RealType | Floating point type (float or double) |
Example usage:
float wait_time = arrival_times(rng);
double total_time = 0.0;
for (int i = 0; i < 10; ++i) {
double interval = intervals(rng);
total_time += interval;
}
float time_to_failure = failure_time(rng);
Platform-independent exponential distribution.
Definition PRNGDistribution.hpp:1949
Pseudo-random number generator for procedural generation.
Definition PRNG.hpp:48
- Note
- All values are strictly positive.
-
Memoryless property: P(X > s+t | X > s) = P(X > t)
-
Mean = 1/lambda, Variance = 1/lambda²
-
Special case of Gamma(1, 1/lambda) distribution.
template<typename RealType = double>
template<typename Generator >
Generates the next random value using provided parameters.
Uses the inverse CDF method: X = -ln(1-U) / lambda where U ~ Uniform(0, 1) and X ~ Exponential(lambda).
The implementation avoids U = 0 or 1 to prevent numerical issues.
- Template Parameters
-
| Generator | The random number generator type (e.g., PRNG) |
- Parameters
-
| g | The random number generator |
| param | The distribution parameters to use for this generation |
- Returns
- A positive random value from Exponential(param.lambda())