Random number generator

10 views
Skip to first unread message

Mahdi Ben Jelloul

unread,
Aug 31, 2021, 5:06:43 AM8/31/21
to liam2-users
Dear liam2 users,

I need to be enlightened about the random number generator behaviour.

In my simulation I do have a global parameter that triggers csv files writing.
To mimic "if", I use while in the following way: 

globals:
  - SAVE_SOME_FILES: True

...

trigger: SAVE_SOME_FILES
while trigger:
  - save_my_files()
  - trigger: False 
   
 
In the rest of the code I do some random draws using various distributions, align etc.
To ensure reproducibility, I set a random seed in the main console file. 
But the results differ when the program is run with SAVE_SOME_FILES set to true or false.

Is that the way it should be ?
What are the operations affecting the random number generator ?

Thank you !

Mahdi Ben Jelloul

Gaëtan de Menten

unread,
Sep 16, 2021, 5:14:18 AM9/16/21
to liam2...@googlegroups.com

Hi Mahdi,

 

Except from the seed command, only functions which generate/uses random numbers affects subsequent random numbers “draws”, so my guess is that you have something using random numbers in your save_my_file() function or any code called from there.

 

Hope it helps,

Gaëtan

--
You received this message because you are subscribed to the Google Groups "liam2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liam2-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/liam2-users/CA%2BAkwScyni5WNf_uF8%3Dp98O%3DNZ8PcsawZH%3DjDXbqEsnTyjcLHQ%40mail.gmail.com.



Disclaimer: This e-mail may contain confidential information which is intended only for the use of the recipient(s) named above.
If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
Please note that e-mail messages cannot be considered as official information from the Federal Planning Bureau.

Mahdi Ben Jelloul

unread,
Sep 16, 2021, 10:49:40 AM9/16/21
to liam2-users
Reply all
Reply to author
Forward
0 new messages