Skip to content
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

Merged
merged 4 commits into from
Nov 16, 2023

Conversation

Gamenot
Copy link
Collaborator

@Gamenot Gamenot commented Nov 16, 2023

Closes #2108

@@ -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)
Copy link
Member

@Adaickalavan Adaickalavan Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Does the use of random.randint() here have any determinism issues between diferent runs?
  2. If different seeds are required, can we fix them as derived_seed = global_seed + loop_iteration_number?
  3. Instead of binary inputs to random.randint(), consider using integer inputs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. random.randint() does not cause determinism issues because it is pseudo-random.
  2. That could also work.
  3. 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,
Copy link
Member

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().

Copy link
Collaborator Author

@Gamenot Gamenot Nov 16, 2023

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.

@Gamenot Gamenot merged commit dfe0645 into master Nov 16, 2023
26 checks passed
@Gamenot Gamenot deleted the tucker/bugfix-vary_random_route branch November 16, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Help Request] Randomize scenario
2 participants