2 # This is autotest display tool, showing gathered information in
3 # a hopefully meaningful way.
5 # Usage: ./autotest-show [-e] [MASK]
6 # Use -e to display winrates in terms of Elo points.
15 [ -n "$mask" ] || mask
="*"
19 echo "Did you run autotest-gather?" >&2
26 pairing
() { pknown
="$pknown$(pairid "$@
") "; }
29 color_stale
="\033[33m"
35 # See README for explanation of flags.
37 if [ -s "r/$pairing.error" ] && [ "$(cat "r
/$pairing.error
")" -gt 0 ]; then
40 known
=1; [ "${pknown#* $pairing *}" != "$pknown" ] || known
=0
41 active
=1; ([ -s "r/$pairing.beacon" ] && [ "$(cat "r
/$pairing.beacon
")" -ge "$(($(date +%s) - 60*60*2))" ]) || active
=0
42 case $error$known$active in
43 001) status
="${color_stale}?";;
44 000) status
="${color_stale}/";;
45 011) status
="${color_fresh}.";;
46 010) status
="${color_fresh}${color_bad}!";;
47 1*0) status
="${color_bad}x";;
48 1*1) status
="${color_fresh}${color_bad}X";;
53 echo "400*l(10*$1/(1-$1))/l(10)" |
bc -l
58 refelo
=$
(prob2elo
$ref); wrelo
=$
(prob2elo
$winrate);
59 wrelo_d
=$
(prob2elo
"($winrate-$sd)"); wrelo_u
=$
(prob2elo
"($winrate+$sd)")
60 delo
=$
((${wrelo%.*}-${refelo%.*})); delo_u=$((${wrelo_u%.*}-${refelo%.*})); delo_d=$((${wrelo_d%.*}-${refelo%.*}))
61 stats
="$games\t$delo_d\t$delo\t$delo_u"
64 rm -f r
/*.summary.dat r
/*.html
66 if [ -n "$do_elo" ]; then
67 printf "S GAMES\tWR -/0/+ (S.D.)\t\tPAIRING\n"
69 printf "S GAMES\tWINRATE\tS.D.\tPAIRING\n"
71 for pairing
in $
( (echo "$pknown" |
tr ' ' '\n'; ls r
/*.dat |
sed 's#^r/##; s#\.dat$##') |
sort |
uniq); do
72 [ ! -s "r/$pairing.dat" ] ||
$twogtp_path -analyze "r/$pairing.dat"
73 pairing_status
"$pairing" # sets status
74 if [ -s "r/$pairing.summary.dat" ]; then
75 cat "r/${pairing}".summary.dat | cut
-f 1,7,8 |
tail -n +2 | \
76 while read games winrate sd
; do
77 if [ -n "$do_elo" ]; then
80 stats
="$games\t$winrate\t$sd"
82 printf "$status $stats\t$pairing$color_stop\n"
86 printf "$status 0\t-\t-\t$pairing$color_stop\n"