-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow random routes to vary across traffic groups. #2112
Conversation
smarts/sstudio/genscenario.py
Outdated
@@ -243,11 +246,12 @@ def gen_scenario( | |||
): | |||
with timeit("traffic", logger.info): | |||
for name, traffic in scenario.traffic.items(): | |||
derived_seed = random.randint(-0b111111111111111, 0b111111111111111) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does the use of
random.randint()
here have any determinism issues between diferent runs? - If different seeds are required, can we fix them as
derived_seed = global_seed + loop_iteration_number
? - Instead of binary inputs to
random.randint()
, consider using integer inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random.randint()
does not cause determinism issues because it is pseudo-random.- That could also work.
- If I take suggestion 2 this point would be already handled.
gen_traffic( | ||
scenario=scenario_dir, | ||
traffic=traffic, | ||
name=name, | ||
seed=seed, | ||
seed=derived_seed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should wrap the seed here (at the point where it is introduced) instead of later where it is used in generator.plan_and_save()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree, if we wrap over the integer at this level then the implementation will affect how we use this method. Which is a big no in my opinion.
Closes #2108