Random Events

R

Ray Batig

Happy Thanksgiving to all.

I am programming a simulation of a storage facility. It cycles through the
365 days in a year and calculates the change in inventories. I have 55
events which have to occur randomly through the year. Does anyone have an
idea how to do this. I figure somehow the Random number generator could be
used, however, I can't figure out how to tie it in.

Thanks in advance for your help!

Ray
 
T

Tom Ogilvy

myday = Int(rnd()*365 + 1)

would generate a uniformly distributed random number between 1 and 365
inclusive.
 
R

Ray Batig

Thanks Tom! Works fine!!

Ray
Tom Ogilvy said:
myday = Int(rnd()*365 + 1)

would generate a uniformly distributed random number between 1 and 365
inclusive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top