[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Simulation libraries in Ruby?

mepython

1/29/2005 1:59:00 PM

I did some search to find availability of discrete event simulation
libraries in Ruby and comes out with nothing. I am sure it must be
somewhere in a cyberspace. Can somebody point to me.

If there is nothing available, I like to create one using coroutines
like what is created for python (http://si...).

2 Answers

Paul Sanchez

1/29/2005 11:04:00 PM

0

In article <1107007128.185460.68710@f14g2000cwb.googlegroups.com>,
"mepython" <a@agni.us> wrote:

> I did some search to find availability of discrete event simulation
> libraries in Ruby and comes out with nothing. I am sure it must be
> somewhere in a cyberspace. Can somebody point to me.
>
> If there is nothing available, I like to create one using coroutines
> like what is created for python (http://si...).

Depends on what you're looking for. There are several priority queue
implementations available for event list management. See Bruno Preiss's
Data Structures book online at <http://www.brpreiss.com/books/...,
for instance. He also has an example implementation of an M/M/1 queue.

With a decent priority queue and some basic random variate generation
algorithms such as can be found in Law & Kelton
(<http://tinyurl.com...) or DeVroye (freely downloadable at
<http://tinyurl.com...) it's pretty easy to implement event graph
(<http://tinyurl.com...) or listener event graph
(<http://tinyurl.com...) based models.

I don't know of anything which pulls all of the pieces together in Ruby,
though.

One problem which remains with using Ruby for discrete event simulation
is that the random number generator, although of good quality, is
implemented as a System method instead of as a class from which multiple
generator objects can be instantiated. This seriously limits its use in
designed experiments. That's the main reason why I haven't translated
any of my own work over from C or Java.

--paul

Joel VanderWerf

1/29/2005 11:35:00 PM

0

Paul Sanchez wrote:
> One problem which remains with using Ruby for discrete event simulation
> is that the random number generator, although of good quality, is
> implemented as a System method instead of as a class from which multiple
> generator objects can be instantiated. This seriously limits its use in
> designed experiments. That's the main reason why I haven't translated
> any of my own work over from C or Java.

Not standard, but available:

http://raa.ruby-lang.org/search.rhtml?sea...