2013-08-02 07:55:04 +02:00
|
|
|
#! /bin/bash
|
2013-01-31 12:32:32 +01:00
|
|
|
# btan.sh
|
|
|
|
# Analyze bigtest run
|
2013-08-02 07:55:04 +02:00
|
|
|
# Has to be bash now we are using arrays
|
2013-01-31 12:32:32 +01:00
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# btan.sh <tag> < <fc-log-score-output>
|
|
|
|
#
|
2013-08-02 07:55:04 +02:00
|
|
|
nations="dutch english french spanish danish portuguese swedish russian"
|
|
|
|
|
2013-01-31 12:32:32 +01:00
|
|
|
if test "x$1" = "x" ; then name=Unknown ; else name="$1" ; fi
|
|
|
|
name=`date +%Y%m%d`-"$name"
|
2013-07-19 02:05:27 +02:00
|
|
|
if test "x$STATS" = "x" ; then
|
|
|
|
dpath=`dirname "$0"`
|
|
|
|
if test -x "${dpath}/stats.awk" ; then
|
|
|
|
STATS="${dpath}/stats.awk"
|
|
|
|
fi
|
|
|
|
fi
|
2013-02-13 04:19:12 +01:00
|
|
|
STATS=${STATS:-stats.awk} # Where is the stats awk script?
|
2013-01-31 12:32:32 +01:00
|
|
|
blockitstate=y
|
|
|
|
|
|
|
|
|
|
|
|
blockit () {
|
|
|
|
if test "$blockitstate" = "y" ; then
|
2013-08-21 12:56:53 +02:00
|
|
|
echo -n " "
|
2013-01-31 12:32:32 +01:00
|
|
|
blockitstate=n
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
blockitstate=y
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section () {
|
2015-05-16 04:58:09 +02:00
|
|
|
printf "%-16s" "$1"
|
2013-08-02 07:55:04 +02:00
|
|
|
}
|
|
|
|
|
2013-01-31 12:32:32 +01:00
|
|
|
statit () {
|
|
|
|
statitMEAN=0 ; statitSD=0
|
2013-02-12 02:10:12 +01:00
|
|
|
eval `$STATS | sed -n -e 's/^n=[^ ]* *mean=\([^ ]*\) *sd=\(.*\)$/statitMEAN="\1";statitSD="\2"/p' -`
|
2013-08-21 12:56:53 +02:00
|
|
|
printf "%9.3f ~ %8.3f" "$statitMEAN" "$statitSD"
|
2013-01-31 12:32:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tmp=`mktemp btan.XXXXXXXX`
|
|
|
|
trap "rm -f '$tmp'" 0
|
|
|
|
cat - > "$tmp"
|
2015-05-16 04:58:09 +02:00
|
|
|
runs=`sed -n -e 's/^run: .*colonies: n=\([0-9]*\) mean=\([\.0-9]*\) sd=\([\.0-9]*\), buildings: \([0-9]*\), euroExpense: \([0-9]*\), euroIncome: \([0-9]*\)$/NC="\1";MEAN="\2";SD="\3";NB="\4";EE="\5";EI="\6"/p' "$tmp"`
|
2013-01-31 12:32:32 +01:00
|
|
|
|
|
|
|
N=0
|
|
|
|
for r in $runs ; do N=`expr $N + 1`; done
|
|
|
|
echo "$name x $N"
|
|
|
|
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Builds"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count builds: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-03 00:57:08 +02:00
|
|
|
section "Building#"
|
|
|
|
(for r in $runs ; do eval $r ; echo $NB ; done) | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Colony#"
|
2013-01-31 12:32:32 +01:00
|
|
|
(for r in $runs ; do eval $r ; echo $NC ; done) | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "ColonySize"
|
2013-01-31 12:32:32 +01:00
|
|
|
(for r in $runs ; do eval $r ; echo $MEAN ; done) | statit
|
|
|
|
blockit
|
|
|
|
|
2014-06-17 12:10:06 +02:00
|
|
|
section "ColonyFalls"
|
|
|
|
sed -n -e 's/^Count colony-fall: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
|
|
|
section "SettlementFalls"
|
|
|
|
sed -n -e 's/^Count native-fall: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-05-16 04:58:09 +02:00
|
|
|
section "Cashins"
|
|
|
|
sed -n -e 's/^Count cashins: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-11-05 11:22:42 +01:00
|
|
|
section "CibolaFinds"
|
2014-06-17 12:10:06 +02:00
|
|
|
sed -n -e 's/^Count Cibola: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-05-11 10:08:39 +02:00
|
|
|
section "EuroExpense"
|
|
|
|
(for r in $runs ; do eval $r ; echo $EE ; done) | statit
|
|
|
|
blockit
|
|
|
|
|
|
|
|
section "EuroIncome"
|
|
|
|
(for r in $runs ; do eval $r ; echo $EI ; done) | statit
|
|
|
|
blockit
|
|
|
|
|
2015-11-05 11:22:42 +01:00
|
|
|
section "FountainFinds"
|
2014-06-17 12:10:06 +02:00
|
|
|
sed -n -e 's/^Count fountain: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Defences"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count defences: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-05-04 04:49:46 +02:00
|
|
|
section "FoundingFathers"
|
2015-03-19 23:10:06 +01:00
|
|
|
sed -n -e 's/^Count FF: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Missions"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count missions: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-11-05 11:22:42 +01:00
|
|
|
section "NativeDemands"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count demands: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-11-05 11:22:42 +01:00
|
|
|
section "NativeGifts"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count gifts: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Pioneerings"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count pioneerings: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Piracies"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count piracies: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Scoutings"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count scoutings: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Seek+Destroys"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count seek+dests: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Transports"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count transports: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-11-05 11:22:42 +01:00
|
|
|
section "TurnSpeed"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Average turn: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
section "Wishes"
|
2013-01-31 12:32:32 +01:00
|
|
|
sed -n -e 's/^Count wishes: *\(.*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
|
2015-05-14 12:06:07 +02:00
|
|
|
section ""
|
|
|
|
blockit
|
|
|
|
|
2013-08-02 07:55:04 +02:00
|
|
|
for n in $nations ; do
|
|
|
|
section "$n"
|
|
|
|
sed -n -e 's/^'"$n"' \([0-9]*\)$/\1/p' "$tmp" | statit
|
|
|
|
blockit
|
|
|
|
done
|
|
|
|
|
2013-01-31 12:32:32 +01:00
|
|
|
test "$blockitstate" = "y" || echo
|