Skip to content
Snippets Groups Projects
Commit 19cbc3e1 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 f4cbf057
Branches
No related merge requests found
......@@ -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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment