From f291ebb82c8526872876dafa1a42f49fb85bedaa Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 18 Nov 2011 04:18:15 +0100 Subject: [PATCH] Autobook Walk: Start simulation by the opponent's move This way, the tree always measures the performance of _us_ playing the move. --- tools/autobook/walk.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/autobook/walk.sh b/tools/autobook/walk.sh index 97dd693..7d4cd7a 100755 --- a/tools/autobook/walk.sh +++ b/tools/autobook/walk.sh @@ -56,13 +56,16 @@ echo " *** Sequence: $seq" echo "(;FF[4]GM[1]CA[UTF-8]RU[Chinese]SZ[9]HA[0]KM[7.5]PW[white]PB[black]$seq)" >"$SEQDIR/a.sgf" rm -f "$SEQDIR"/r* -if [ $((RANDOM%2)) = 1 ]; then - black="$pachi" - white="$opponent" -else - black="$opponent" - white="$pachi" -fi +# last move has been... - we want to simulate this being _our_ move yet, +# i.e. start the simulation with the opponent to play +case $color in + B) + black="$pachi" + white="$opponent";; + W) + black="$opponent" + white="$pachi";; +esac $twogtp_path -black "$black" -white "$white" -auto -verbose -size 9 -komi 7.5 -sgffile "$SEQDIR/r" -games 1 -openings "$SEQDIR" wincolor=$(cat "$SEQDIR"/r-0.sgf | sed -ne 's/.*RE\[\(.\).*/\1/p') case $wincolor in -- 2.11.4.GIT