gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] connection reading patch


From: Gunnar Farnebäck
Subject: [gnugo-devel] connection reading patch
Date: Mon, 31 Oct 2005 23:10:38 +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 small patch tries to improve the connection reading by forcing it
to consider two moves when, although the first one looks much better,
the second move is still very promising.

The regression results are good, 12 PASSES and 5 FAILS. There is a
full analysis at http://trac.gnugo.org/gnugo/ticket/50 which shows
that the failures are accidental or insignificant while some of the
passes, in particular connection:122, are very important. The only
drawback is that it costs +1.5% reading nodes and 3.9% connection
nodes. In my opinion these improvements are well worth the cost.

/Gunnar

Index: engine/readconnect.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/readconnect.c,v
retrieving revision 1.88
diff -u -r1.88 readconnect.c
--- engine/readconnect.c        7 Dec 2004 04:50:02 -0000       1.88
+++ engine/readconnect.c        24 Apr 2005 23:00:50 -0000
@@ -2610,8 +2610,15 @@
   else
     distance_limit = distances[1] + FP(1.5);
 
+  /* Special case: If the second best move has a distance less than 1,
+   * include it if even if the best move has a very low distance.
+   */
+  if (distances[1] < FP(1.0)
+      && distances[1] > distance_limit)
+    distance_limit = distances[1];
+  
   for (r = 0; r < num_moves; r++) {
-    if (r > 0
+    if (r > 1
        && distances[r] > distances[r-1]
        && distances[r] - distances[r-1] > (8 - r) * FP(0.2))
       break;




reply via email to

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