op_dist_exponential()
Abstract
Returns a random value from an exponential distribution having a specified mean.
Syntax
op_dist_exponential (mean)
| Argument | Type | Description |
|---|---|---|
mean |
double |
mean of the distribution |
Return Type
double
Generated exponential random value.
This value is between 0.0, inclusive and an unspecified upper limit, with the mean provided characterizing the distribution.
Example
/* Schedule self interrupt for the next send time. */
op_intrpt_schedule_self (op_sim_time() + op_dist_exponential(0.5), 0);
Details
The random number stream used by this KP is generated by calls to the BSD random() procedure, and is shared by all Dist package KPs and by the generator modules. The random number stream is dependent on an initial seed, which can be altered via the simulation environment attribute “seed” (see Chapter 1 “Executing a Discrete Event Simulation” on page 1 for more information). Simulation results are repeatable if the simulation inputs are identical, including the same random seed.
op_dist_load() does not need to be called before using this function.
Purpose
Provides a mechanism to generate a random number based on an exponential distribution with a specified mean.
Errors
- No errors are trapped.
Reference
- Use the KPs op_intrpt_schedule_self(), op_intrpt_schedule_remote(), or op_intrpt_schedule_call() to respectively schedule self interrupts, remote interrupts, or procedure interrupts
- Use the KP op_dist_uniform() to obtain a uniformly distributed random value