Spaces:
Runtime error
Runtime error
File size: 805 Bytes
55cc64a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import random
def next_seed(args):
if args.seed_behavior == 'iter':
if args.seed_internal % args.seed_iter_N == 0:
args.seed += 1
args.seed_internal += 1
elif args.seed_behavior == 'ladder':
if args.seed_internal == 0:
args.seed += 2
args.seed_internal = 1
else:
args.seed -= 1
args.seed_internal = 0
elif args.seed_behavior == 'alternate':
if args.seed_internal == 0:
args.seed += 1
args.seed_internal = 1
else:
args.seed -= 1
args.seed_internal = 0
elif args.seed_behavior == 'fixed':
pass # always keep seed the same
else:
args.seed = random.randint(0, 2**32 - 1)
return args.seed |