geometric()
Returns integral numbers according to a geometric distribution.
Synopsis
geometric(mean)
Description
This function returns a variate of a geometric distribution.
This distribution is described at the link
http://www.cplusplus.com/reference/random/geometric_distribution/, and
produces random positive random integers where each value represents
the number of unsuccessful trials before a first success in a sequence of trials,
each with a probability of success equal to the given mean
.
The function returns a single value for the current agent that is consistent with the distribution. Over a large number of agents, the returned values will collectively represent the specified distribution.
Parameters
mean
A numeric expression representing the mean value for the distribution.
Returns
Returns an integral number consistent with a geometric distribution.
Examples
The following state will make entering agents collectively wait with a geometric distribution of individual hourly wait times.
state Test {
wait(geometric(1 / 0.3))
next(Excluded)
}
The following uses the same distribution to produce daily rather than hourly wait times.
state Test {
wait(24 * geometric(1 / 0.3))
next(Excluded)
}
See Also
bernoulli(), binomial(), cauchy(), chi_squared(), extreme_value(), fisher_f(), gamma(), gompertz(), lognormal(), negative_binomial(), normal(), poisson(), student_t(), uniform(), weibull()