comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Randomu seed initialization
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Randomu seed initialization [message #68611 is a reply to message #68610] Thu, 12 November 2009 12:32 Go to previous messageGo to previous message
Matt[2] is currently offline  Matt[2]
Messages: 69
Registered: March 2007
Member
Jeremy Bailin <astroconst@gmail.com> writes:

> If I had to speculate, I'd say that the variable that you're passing
> as the seed isn't undefined like you think it is. Have you tried doing
> a "help, seed" right before the randomu call?

If I was going to speculate, I would guess the undefined seed gets set
to the same value internally every time. Thereby starting the same
string of pseudo-random numbers.

I usually use:
seed = long(systime(/seconds) )

To initialize my seed. It's not perfect, but it's a start.


Also remember from the docs: "Each independent random number sequence
should maintain its own state variable. To maintain a state over
repeated calls to a procedure, the seed variable may be stored in a
COMMON block."


Matt

--
Matthew Savoie - Scientific Programmer
National Snow and Ice Data Center
(303) 735-0785 http://nsidc.org
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how smooth surface
Next Topic: Randomu() behavior - BAD!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:33:59 PDT 2025

Total time taken to generate the page: 1.36231 seconds