Skip to content

Rand

STEVAN Antoine requested to merge rand into main
  • add --prng-seed: u8 to fix the random number generator seed

example

by running the following snippet, we get

  • first.123.png and second.123.png with --prng-seed 123 which are the same
  • first.111.png and second.111.png with --prng-seed 111 which are the same
  • first.111.png and first.123.png are different
use ./scripts/inbreeding

const OPTS = {
    nb_bytes: (10 * 1_024),
    k: 10,
    n: 20,
    nb_scenarii: 10,
    nb_measurements: 10,
    measurement_schedule: 1,
    measurement_schedule_start: 0,
    max_t: 50,
    strategies: [
        "single:1",
        "double:0.5:1:2",
        "single:2"
        "double:0.5:2:3",
        "single:3"
        "single:5"
        "single:10",
    ],
    environment: "random-fixed:0.5:1",
}

inbreeding build

inbreeding run --options $OPTS --prng-seed 123 --output /tmp/first.123.nuon
inbreeding plot /tmp/first.123.nuon --options { k: $OPTS.k } --save /tmp/first.123.png

inbreeding run --options $OPTS --prng-seed 123 --output /tmp/second.123.nuon
inbreeding plot /tmp/second.123.nuon --options { k: $OPTS.k } --save /tmp/second.123.png

inbreeding run --options $OPTS --prng-seed 111 --output /tmp/first.111.nuon
inbreeding plot /tmp/first.111.nuon --options { k: $OPTS.k } --save /tmp/first.111.png

inbreeding run --options $OPTS --prng-seed 111 --output /tmp/second.111.nuon
inbreeding plot /tmp/second.111.nuon --options { k: $OPTS.k } --save /tmp/second.111.png
seed first second
123 first.123 second.123
111 first.111 second.111
Edited by STEVAN Antoine

Merge request reports