diff --git a/scripts/inbreeding/run.nu b/scripts/inbreeding/run.nu index 6f1ef806b4a572232744e01765a02e3135237e79..b5504c6457ca5023c620da5356218c24b36e9c0b 100644 --- a/scripts/inbreeding/run.nu +++ b/scripts/inbreeding/run.nu @@ -8,6 +8,7 @@ export def main [ k: int, n: int, nb_measurements: int, + nb_scenarii: int, measurement_schedule: int, max_t: int, strategies: list<string>, @@ -30,17 +31,24 @@ export def main [ } $options.strategies | each {|s| - let diversity = ^$BIN ...[ - $options.nb_bytes, - -k $options.k - -n $options.n - --nb-measurements $options.nb_measurements - --measurement-schedule $options.measurement_schedule - -t $options.max_t - --test-case recoding - --strategy $s - --environment $options.environment - ] | lines | into float + let res = 1..$options.nb_scenarii | each { + ^$BIN ...[ + $options.nb_bytes, + -k $options.k + -n $options.n + --nb-measurements $options.nb_measurements + --measurement-schedule $options.measurement_schedule + -t $options.max_t + --test-case recoding + --strategy $s + --environment $options.environment + ] | lines | into float + } + + let diversity = $res + | skip 1 + | reduce --fold $res.0 {|it, acc| $acc | zip $it | each { flatten }} + | each { math avg } { strategy: $s,