Skip to content
Snippets Groups Projects
Verified Commit 02a2ca68 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

compute the seeds directly by hashing

parent 7cd44214
No related branches found
No related tags found
No related merge requests found
Pipeline #5300 failed
use consts.nu
use ../../.nushell cargo "cargo bin"
use ../../.nushell error "error throw"
const VALID_HEX_CHARS = "abcdefABCDEF0123456789"
......@@ -81,19 +80,6 @@ export def main [
mkdir $output_dir
print $"data will be dumped to `($output_dir)`"
# compute a unique seed for that strategy and global seed
let seed = $s + $"($prng_seed)"
| hash sha256
| split chars
| last 2
| str join
| $"0x($in)"
| into int
# compute all the seeds for that strategy, one per scenario
let seeds = cargo bin rng ...[ -n $options.nb_scenarii --prng-seed $prng_seed ]
| lines
| into int
for i in 1..$options.nb_scenarii {
let output = [ $output_dir, $"($i)" ] | path join
......@@ -108,7 +94,7 @@ export def main [
--test-case recoding
--strategy $s
--environment $options.environment
--prng-seed ($seeds | get ($i - 1))
--prng-seed ([$prng_seed, $s, $i] | str join | hash sha256)
] out> $output
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment