From: keithv on
This isn't a tcl question per se but I'm am writing
it in tcl and this is a knowledgeable newsgroup,
so here goes:

Part of a simulation I'm writing requires an event
to occur on the average of say every 10 seconds.
I'm currently using
set when [expr {5 + 10*rand()}]

But I'd prefer a better distribution around 10
(normal, Poissonian, etc).

Does anybody know an easy way of getting
more realistic distributions? I vaguely recall
from college a method using logs but I've
forgotten the details.

Thanks,
Keith
From: Will Duquette on
On Feb 1, 12:34 pm, keithv <kvet...(a)gmail.com> wrote:
> This isn't a tcl question per se but I'm am writing
> it in tcl and this is a knowledgeable newsgroup,
> so here goes:
>
> Part of a simulation I'm writing requires an event
> to occur on the average of say every 10 seconds.
> I'm currently using
>     set when [expr {5 + 10*rand()}]
>
> But I'd prefer a better distribution around 10
> (normal, Poissonian, etc).
>
> Does anybody know an easy way of getting
> more realistic distributions? I vaguely recall
> from college a method using logs but I've
> forgotten the details.
>
> Thanks,
> Keith

Tcllib has a collection of random number distributions in
simulation::.

Will