From: keithv on 1 Feb 2010 15:34 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 1 Feb 2010 16:17 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
|
Pages: 1 Prev: Cannot acces to a DB v8.1.6.0 throug a dblink Next: ActiveState`s documentation question |