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

Use random seed when set to 0 or -1. #10

Closed
sbates130272 opened this issue Oct 1, 2021 · 1 comment · Fixed by #11
Closed

Use random seed when set to 0 or -1. #10

sbates130272 opened this issue Oct 1, 2021 · 1 comment · Fixed by #11

Comments

@sbates130272
Copy link
Contributor

It is standard practice to generate a random seed from the current time when a specific seed is not set. This means simulations are truly random and don't repeat over and over again.

Update the code to use a seed from the current time if the input seed is (e.g. 0). Also record that seed in the output file for regeneration purposes. If input seed is >0 then use that.

Also update README to reflect this change.

sbates130272 added a commit to sbates130272/bp_osd that referenced this issue Oct 7, 2021
It is useful to be able to seed the RNG with a seed that is based on
the current time. This ensures different simulations generate
different results. However simulating with a known seed is also
useful.

This commit will use an input seed if that seed is >0. Otherwise it
will generate a seed based on the current system time. In all cases
the seed used is written to the output file.

Fixes quantumgizmos#10.
@sbates130272
Copy link
Contributor Author

@quantumgizmos I have pushed a branch to my fork of this repo and will open a PR you can review.

sbates130272 added a commit to sbates130272/bp_osd that referenced this issue Oct 7, 2021
It is useful to be able to seed the RNG with a seed that is based on
the current time. This ensures different simulations generate
different results. However simulating with a known seed is also
useful.

This commit will use an input seed if that seed is >0. Otherwise it
will generate a seed based on the current system time. In all cases
the seed used is written to the output file.

Fixes quantumgizmos#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 a pull request may close this issue.

1 participant