Random Numbers fasters than the osax
Random Numbers fasters than the osax
- Subject: Random Numbers fasters than the osax
- From: email@hidden (Michael Sullivan)
- Date: Wed, 27 Mar 2002 14:07:25 -0500
- Organization: Society for the Incurably Pompous
I've just had the brilliant idea to write some ad hoc monte carlo sims
in applescript since I'm getting really comfortable with it. For the
kind of accuracy I'm looking for, it has the potential to be plenty fast
enough, except for one thing. I need to generate a lot of random
numbers -- that's an osax which takes about 10 times as long as a
vanilla instruction, making it *just* slow enough that a useful sim for
what I'm looking at might take an hour or two to run, instead of maybe
10 minutes.
That's not a huge deal, but I'm wondering if one of you math wiz folks
has a vanilla random number generator handy, or a suggestion on how to
build one. I can probably come up with decent hash functions by digging
through some of my old algorithms books, but the only good changing
number I can think to seed it with is ticks, which is another osax --
and to get real random numbers I'd need to reseed every time, no?
Am I missing some really cool trick to making this work fast, or do I
just have to live with either slow execution or coding it in C?
Michael
--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.