gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] string connection bonus revision


From: Gunnar Farnebäck
Subject: [gnugo-devel] string connection bonus revision
Date: Sun, 13 Mar 2005 17:13:14 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/21.3 (sparc-sun-solaris2.9) MULE/5.0 (SAKAKI)

This patch revises the small bonus given for moves connecting strings,
with the aim to encourage capturing opponent stones when that is about
as solid as connecting or extending a string. Regression results:

kgs:40          PASS A6 [A6]
1 PASS
Total nodes: 1671873725 3158993 13114688 (-0.0045% 0% -0.0043%)

- move_connects_strings() revised

/Gunnar

Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.131
diff -u -r1.131 value_moves.c
--- engine/value_moves.c        13 Sep 2004 10:45:11 -0000      1.131
+++ engine/value_moves.c        22 Sep 2004 15:39:55 -0000
@@ -34,10 +34,14 @@
 
 /* Count how many distinct strings are (solidly) connected by the move
  * at (pos). Add a bonus for strings with few liberties. Also add
- * bonus for opponent strings put in atari or removed.
+ * bonus for opponent strings put in atari or removed and for own
+ * strings in atari adjacent to removed opponent strings.
+ *
+ * The parameter to_move should be set when color is the color to
+ * move. (This function is called for both colors.)
  */
 static int
-move_connects_strings(int pos, int color)
+move_connects_strings(int pos, int color, int to_move)
 {
   int ss[4];
   int strings = 0;
@@ -80,8 +84,11 @@
     else {
       if (countlib(ss[k]) <= 2)
        fewlibs++;
-      if (countlib(ss[k]) <= 1)
+      if (countlib(ss[k]) <= 1 && to_move) {
+       int dummy[MAXCHAIN];
        fewlibs++;
+       fewlibs += chainlinks2(ss[k], dummy, 1);
+      }
     }
   }
 
@@ -3054,8 +3063,8 @@
     /* Add a special shape bonus for moves which connect own strings
      * or cut opponent strings.
      */
-    c = (move_connects_strings(pos, color)
-        + move_connects_strings(pos, OTHER_COLOR(color)));
+    c = (move_connects_strings(pos, color, 1)
+        + move_connects_strings(pos, OTHER_COLOR(color), 0));
     if (c > 0) {
       float shape_factor2 = pow(1.02, (float) c) - 1;
       float base_value = gg_max(gg_min(tot_value, 5.0), 1.0);




reply via email to

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