gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] readconnect patch


From: Gunnar Farneback
Subject: [gnugo-devel] readconnect patch
Date: Thu, 15 Jan 2004 22:13:23 +0100
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)

This patch to readconnect causes at least two moves (unless only one
is available) to be tested if the first one is a ko capture. This
avoids getting unnecessary ko results.

The only effect on regressions is that nicklas2:2103 now passes,
because it no longer thinks that F6 and A5 can be disconnected by
capturing ko at B5.

- find_connection_moves() revised

/Gunnar

Index: engine/readconnect.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/readconnect.c,v
retrieving revision 1.61
diff -u -r1.61 readconnect.c
--- engine/readconnect.c        12 Jan 2004 12:37:05 -0000      1.61
+++ engine/readconnect.c        14 Jan 2004 23:12:46 -0000
@@ -2232,6 +2232,7 @@
   int i, j;
   SGFTree *save_sgf_dumptree = sgf_dumptree;
   int save_count_variations = count_variations;
+  float distance_limit;
 
   /* We turn off the sgf traces here to avoid cluttering them up with
    * tactical reading moves.
@@ -2496,8 +2497,13 @@
   /* Filter out moves with distance at least 1.5 more than the best
    * move, or with distance higher than the cutoff specified.
    */
+  if (num_moves <= 1 || !is_ko(moves[0], color_to_move, NULL))
+    distance_limit = distances[0] + 1.5;
+  else
+    distance_limit = distances[1] + 1.5;
+
   for (r = 0; r < num_moves; r++)
-    if (distances[r] > distances[0] + 1.5
+    if (distances[r] > distance_limit
        || distances[r] > cutoff)
       break;
   num_moves = r;




reply via email to

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