HOWTO: Set random number seeds in starsim

The short answer:
seed1 = 123
seed2 = 456

RNDM [seed1] [seed2]

 

How to select seeds for the random number generator which will (almost certainly) be independent for any two jobs:

   SET  = "some number which is independent from run to run"

   TIME = $shell('date +%s')
   NANO = $shell('date +%N')
   TIME = [TIME] + 1000000*[SET]
    
   RNDM [TIME] [NANO]

Yes, you could just set seed1 = [SET]... but that will typically result in a seed which is a number on the order of 10 to 100 to 1000, depending on how many jobs you set.  With this method, [TIME] will take on a value equal to the number of seconds which have elapsed since 1/1/1970, and offset by approximately one day for each set.  [NANO] will be the number of nanoseconds in the current second... so the combination of the two seeds will be very unlikely to occur twice on two separate calls.

I will buy a beer for the first person who can calculate the probability of two runs submitted w/in one day of each other with SET on the order of 1 to 10 having seed1 = seed2.