Skip to content
Snippets Groups Projects
Forked from Dragoon / Komodo
Source project has a limited visibility.
STEVAN Antoine's avatar
STEVAN Antoine authored
- 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

```bash
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](/uploads/6b09bf94ca7019e200a47e1a53adc533/first.123.png) | ![second.123](/uploads/fa77c1be84d6279f71cbfe3064c83242/second.123.png) |
| 111  | ![first.111](/uploads/bd31a0832825ecbef48178b2e8689a6f/first.111.png) | ![second.111](/uploads/e1c00e0a6765e82388a3c7142847bbab/second.111.png) |
2b2783f3
History
Name Last commit Last update