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

Set seed value using CLI #1618

Merged
merged 5 commits into from
Aug 24, 2022
Merged

Set seed value using CLI #1618

merged 5 commits into from
Aug 24, 2022

Conversation

adityapande-1995
Copy link
Contributor

@adityapande-1995 adityapande-1995 commented Jul 29, 2022

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

🎉 New feature

Closes #1467

Summary

This PR exposes a --seed argument to gz sim to set seed value for the random number generator.

Test it

Added a small test case that runs gz sim -s -v 4 --seed 5 --iterations 5 and checks for the output string "Setting seed value: 5" in stdout.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

Signed-off-by: Aditya <[email protected]>
@adityapande-1995 adityapande-1995 changed the base branch from ign-gazebo6 to main July 29, 2022 00:11
@adityapande-1995 adityapande-1995 self-assigned this Jul 29, 2022
@chapulina chapulina added 🌱 garden Ignition Garden enhancement New feature or request labels Jul 29, 2022
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

LGTM so far, just pending a test

src/cmd/cmdsim.rb.in Outdated Show resolved Hide resolved
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
@adityapande-1995 adityapande-1995 marked this pull request as ready for review August 4, 2022 20:22
@chapulina chapulina added 🌱 garden Ignition Garden and removed 🌱 garden Ignition Garden labels Aug 6, 2022
@chapulina
Copy link
Contributor

Removed the Garden label because we're past feature freeze ❄️ .

This PR can either be merged into main and backported to gz-sim7 after the stable release, or retargeted to gz-sim7 and merged after the stable release (i.e. October).

@adityapande-1995
Copy link
Contributor Author

adityapande-1995 commented Aug 24, 2022

The CI failures here seem unrelated to the changes made here.

@adityapande-1995 adityapande-1995 merged commit 24b1e54 into main Aug 24, 2022
@adityapande-1995 adityapande-1995 deleted the aditya/set_seed_value_cli branch August 24, 2022 15:51
azeey pushed a commit to azeey/gz-sim that referenced this pull request Sep 22, 2022
* expose --seed to CLI
Signed-off-by: Aditya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Expose random seed through CLI
3 participants