CovertLab / wcEcoli

Whole Cell Model of E. coli
Other
18 stars 4 forks source link

Review the use and sharing of psuedo-random number generators #54

Open 1fish2 opened 6 years ago

1fish2 commented 6 years ago

... to ensure that the psuedo-random sequences are computed consistently, if feasible.

jmason42 commented 6 years ago

My 2 cents: From a theoretical perspective, model outcome should be the same regardless of process execution order, since those processes should be operating in parallel. This would require each process to have its own random number generator, which was the case in the past, but based on a conversation with Derek a while back, I believe this was changed to a single random number generator. Practically speaking, this should be fine, so long as execution order is always the same.

Regardless, this should be tested in the following fashions:

  1. A unit test on the base simulation object using mock processes.
  2. Unit tests on any process operations that utilizes random numbers, by isolating the random number generation to function calls, or by running single processes with a mock simulation. The latter would be fantastic for coverage but would probably require some refactoring to facilitate the use of mocks.
  3. Executing two full simulations with the same initial seed and validating that their output is identical.