Closed lesquoyb closed 2 months ago
when it's fixed, uncomment the test on random operators in Lists.experiment
I do not understand why you want to set the default rng name (with gama.pref_rng_name <- "threaded";
) instead of the simulation/experiment one specific one with string rng <- "java";
for instance. rng
does not work ?
Oh right, I didn't know rng
existed, I just thought I could manipulate the one linked to the rng set in preferences.
I'll check if everything works properly with that method then
Is your request related to a problem? Please describe. Currently it is not possible to create reliable unit tests for operators using randomness. Sure the results are reproducible if gama is setup with the same generator, but when writing unit tests you cannot know the settings of the machine that is going to execute it, so you have to force your random generator explicitly in the code. The problem is that this doesn't seem to be taken into account. Take for example this model:
with my generator being set to
java
by default I get consistently the value 3 and array [7,3,4], withmersenne
the value 2 and [2,8,5] and withthreaded
, 9 and [2,5,4]. So far so good, everything works. But imagine I have a default rng set tojava
and I want to force the test to execute withthreaded
for example, I will try to add the line:before setting the seed. I tried a few places, in the init of the experiment, the global, in the setup and even directly in the test, but I always end up having the same result as with the rng set in the parameters window. If I write the value of
pref_rng_name
during the execution of the test I can seethreaded
, but If I look in the experiment parameter it's stilljava
(or whatever I set in the parameters).Describe the improvement you'd like Setting the
pref_rng_name
changes the rng in the simulation. Or if it's not possible, then this variable shouldn't be settable.