[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[EnergyPlus_Support] Re: How to properly set the random seed for stochastic processes in EMS?
Hi Brent,
Thanks, that is exactly the kind of information I was looking for. I was using the range [0,2^32] previously, because i assumed that in order to explore a full range of random seeds, I needed to explore the full range of integers, and previously this max (2^32) worked without issue. I chose it because it is the maximum allowed (unsigned, 32-bit) integer in Matlab - which is the program I'm using to orchestrate the process.
Using the clock time is not an option because I run many simulations in parallel, and there is some chance that two will start simultaneously.
I confirmed that (2^31-1) works as a random seed, and (2^31) causes the same fortran error. I'm not sure a formal fix is required, other than perhaps noting this in the documentation.
If I can ask another question, would I be limiting the random number generator if I just used the integers 1,2,3,...,1000 as seeds? would this lead to somehow similar, or ordered sequences of random numbers? My assumption is yes, which is why i want to use seeds distributed across the entire range of possible integers.
Thanks again,
Ryan
--- In EnergyPlus_Support@xxxxxxxxxxxxxxx, "Griffith, Brent" <brent.griffith@...> wrote:
>
> Hi,
>
>
> 1. I think on many computer systems, the limit on the range of numbers for the seed comes out to be 0 to 2,147,483,647. (2^31-1) I'll file a bug report on this, since it shouldn't crash and should probably have used a larger integer model.
>
> 2. Behavior did change a lot for V8. Previously it was the only first couple of digits that really got used. Now the entire real is rounded to the nearest integer. Any values after a decimal are ignored.
>
> If you run each model in series, or at least staggered starts in real time, you can try the new "ActualTime" built-in variable. It reads the computer clock at start up to generate a unique seed value for each run.
>
> Brent
>
>
>
> From: EnergyPlus_Support@xxxxxxxxxxxxxxx [mailto:EnergyPlus_Support@xxxxxxxxxxxxxxx] On Behalf Of Ryan_Element
> Sent: Tuesday, June 04, 2013 7:11 PM
> To: EnergyPlus_Support@xxxxxxxxxxxxxxx
> Subject: [EnergyPlus_Support] How to properly set the random seed for stochastic processes in EMS?
>
>
>
> Greetings,
>
> I have a working energyplus model that uses the @SeedRandom object (function) in the EnergyManagementSystem.
>
> I understand that to ensure a repeatable sequence of numbers, the argument to the @SeedRandom field must be the same each time.
>
> My question is, what is the proper range of numbers that I can use to specify the random seed? 0-100? 1-1,000,000? And given the proper range, will every unique integer result in a unique sequence of random numbers? I ask for two reasons
>
> 1. large numbers (e.g. 3867681373) cause something deep in energyplus to break (Energyplus Version 8.0.0), resulting in a fortran runtime language error:
> --error snip--
> forrtl: error (140): floating inexact
> Image PC Routine Line Source
>
> Stack trace terminated abnormally.
> /Applications/EnergyPlus-8-0-0/runenergyplus: line 493: 78098 Abort trap: 6 "$ENERGYPLUS_DIR/bin/$PRG_N"
> --error snip--
>
> 2. In the past (Energyplus Version 7.0.0), I noticed that very large numbers that are close to one another (e.g. 3867681373 and 3867681374) result in the same sequence of random numbers in spite of being unique integers.
>
> The I/O reference provides this detail on the argument to @SeedRandom:
> The argument is rounded to the nearest whole number and then used to set the size and values of the seed for the number generator.
>
> Can anyone provide more information? I want to ensure that 1000 simulations get 1000 unique sequences of random numbers. And then I want to be able to repeat those 1000 simulations, and get the same results, so I need to explicitly set 1000 unique random seeds.
>
> Cheers,
> Ryan
>
------------------------------------
Primary EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx
The primary EnergyPlus web site is found at:
http://www.energyplus.gov
The group web site is:
http://groups.yahoo.com/group/EnergyPlus_Support/
Attachments are currently allowed but be mindful that not everyone has a high speed connection. Limit attachments to small files.
EnergyPlus Documentation is searchable. Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/EnergyPlus_Support/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/EnergyPlus_Support/join
(Yahoo! ID required)
<*> To change settings via email:
EnergyPlus_Support-digest@xxxxxxxxxxxxxxx
EnergyPlus_Support-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
EnergyPlus_Support-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/