Skip to content
Snippets Groups Projects
Commit 8448ef57 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

dump inbreeding results raw (dragoon/komodo!115)

this will make `inbreeding run` dump all the data as-is to files on disk.
data will be arranged in the following way
- the `$CACHE` is `~/.cache/komodo/inbreeding/`
- each seed will have its own directory: `$CACHE/<seed>/`
- each strategy and environment will have their own directory: `$CACHE/<seed>/<date>/<env>/<strat>/`
- finally each recoding scenario will go to its own subdirectory: `$CACHE/<seed>/<date>/<env>/<strat>/<i>`

> :exclamation: **Important**  
> the plotting pipeline is broken for now but will be fixed in later MRs soon...
parent ac90901b
No related branches found
No related tags found
No related merge requests found
const BIN = "./target/release/examples/inbreeding" const BIN = "./target/release/examples/inbreeding"
const CACHE = ($nu.home-path | path join .cache komodo inbreeding)
export def main [ export def main [
--output: path = "./inbreeding.nuon",
--baseline,
--options: record< --options: record<
nb_bytes: int, nb_bytes: int,
k: int, k: int,
...@@ -23,24 +22,16 @@ export def main [ ...@@ -23,24 +22,16 @@ export def main [
} }
} }
if $baseline { let now = date now | format date "%s%f"
^$BIN ...[
$options.nb_bytes,
-k $options.k
-n $options.n
--nb-measurements $options.nb_measurements
--measurement-schedule $options.measurement_schedule
--measurement-schedule-start $options.measurement_schedule_start
-t $options.max_t
--test-case end-to-end
--prng-seed $prng_seed
] | lines | into float | save --force baseline.nuon
print "baseline saved to `baseline.nuon`" for s in $options.strategies {
} let output_dir = [ $CACHE, $"($prng_seed)", $now, $options.environment, $"($s)" ] | path join
mkdir $output_dir
print $"data will be dumped to `($output_dir)`"
for i in 1..$options.nb_scenarii {
let output = [ $output_dir, $"($i)" ] | path join
$options.strategies | each {|s|
let res = 1..$options.nb_scenarii | each {
^$BIN ...[ ^$BIN ...[
$options.nb_bytes, $options.nb_bytes,
-k $options.k -k $options.k
...@@ -53,26 +44,9 @@ export def main [ ...@@ -53,26 +44,9 @@ export def main [
--strategy $s --strategy $s
--environment $options.environment --environment $options.environment
--prng-seed $prng_seed --prng-seed $prng_seed
] ] out> $output
| lines
| parse "{t}, {diversity}"
| into float diversity
}
let diversity = $res
| flatten
| group-by t --to-table
| update items { get diversity | math avg }
| rename --column { group: "t", items: "diversity" }
| into int t # NOTE: $.t needs to be converted to int here because
# `group-by --to-table` converts the grouping key to
# string
{
strategy: $s,
diversity: $diversity,
} }
} | save --force $output
print $"results saved to `($output)`" print $"data has been dumped to `($output_dir)`"
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment