Add the possibility to insert a seed for the random generation #33

Merged
meliurwen merged 7 commits from 12-feature-add-seed-for-random-generation into dev 3 years ago
meliurwen commented 3 years ago (Migrated from github.com)
Owner

Description

See the issue related, what is done in the commits and in the changelog below.

Merge into Dev Checklist

  • Tests for the new code
  • Acceptance Testing

Changelog

  • It is possible to seed the generation of a trajectory

(Optional) Extra info

None

## Description See the issue related, what is done in the commits and in the changelog below. ## Issues related * #12 ## Merge into Dev Checklist * [x] Tests for the new code * [x] Acceptance Testing ## Changelog * It is possible to seed the generation of a trajectory ## (Optional) Extra info None
AlessandroBregoli (Migrated from github.com) reviewed 3 years ago
AlessandroBregoli (Migrated from github.com) commented 3 years ago
Owner

Why also rand_core?
It should work also without it.

Why also rand_core? It should work also without it.
AlessandroBregoli (Migrated from github.com) commented 3 years ago
Owner

Seed must be an Option

Seed must be an Option<u64>
meliurwen (Migrated from github.com) reviewed 3 years ago
meliurwen (Migrated from github.com) commented 3 years ago
Owner

Yes and no, it was necessary for the function ChaCha8Rng::seed_from_u64.

Anyway, thank you for highlighting this!
With a closer look I've been able to get rid of this dependency by doing this in src/tools.rs and tests/params.rs:

- use rand_core::SeedableRng;
+ use rand_chacha::rand_core::SeedableRng;
Yes and no, it was necessary for the function `ChaCha8Rng::seed_from_u64`. Anyway, thank you for highlighting this! With a closer look I've been able to get rid of this dependency by doing this in `src/tools.rs` and `tests/params.rs`: ```diff - use rand_core::SeedableRng; + use rand_chacha::rand_core::SeedableRng; ```
meliurwen (Migrated from github.com) reviewed 3 years ago
meliurwen (Migrated from github.com) commented 3 years ago
Owner

Done

Done
AlessandroBregoli (Migrated from github.com) approved these changes 3 years ago
The pull request has been merged as 258d016155.
Sign in to join this conversation.
Loading…
There is no content yet.