gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] influence patch


From: Gunnar Farneback
Subject: [gnugo-devel] influence patch
Date: Sat, 21 Sep 2002 22:01:53 +0200
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

It seems we are currently systematically undervaluing moves actually
taking stones off the board. This includes, but is not limited to, ko
captures. More precisely a captured stone counts for two points (in
most cases) when evaluating territory, but when the move takes stones
off the board, only one point is counted.

The appended patch corrects this. I haven't run the regressions yet.

/Gunnar

Index: engine/influence.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/influence.c,v
retrieving revision 1.60
diff -u -r1.60 influence.c
--- engine/influence.c  10 Sep 2002 15:05:42 -0000      1.60
+++ engine/influence.c  21 Sep 2002 19:47:40 -0000
@@ -1345,10 +1345,15 @@
            && (q->non_territory[i][j] & BLACK))
          q->territory_value[i][j] = 0.0;
        
-       /* Dead stone, add one to the territory value. */
-       if (BOARD(i, j) == BLACK)
+       /* Dead stone, add one to the territory value.
+        *
+        * We also want to include stones which were captured by the
+        * last move when computing move influence. Therefore we look
+        * at worm[POS(i, j)].color instead of just BOARD(i, j).
+        */
+       if (worm[POS(i, j)].color == BLACK)
          q->territory_value[i][j] += 1.0;
-       else if (BOARD(i, j) == WHITE)
+       else if (worm[POS(i, j)].color == WHITE)
          q->territory_value[i][j] -= 1.0;
       }
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]