Skip to content
Snippets Groups Projects
Commit 84db8bfb authored by Martin Bauer's avatar Martin Bauer
Browse files

Fix RNG: use different key for each call

otherwise all random numbers drawn for one cell are equal
parent d19180a9
No related branches found
No related tags found
1 merge request!23Seeding of RNG
......@@ -118,8 +118,12 @@ class PhiloxFourFloats(CustomCodeNode):
def random_symbol(assignment_list, rng_node=PhiloxTwoDoubles, *args, **kwargs):
if 'keys' not in kwargs:
kwargs['keys'] = (0, 0)
while True:
node = rng_node(*args, **kwargs)
kwargs['keys'] = (kwargs['keys'][0] + 1, kwargs['keys'][1])
inserted = False
for symbol in node.result_symbols:
if not inserted:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment