[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] territory values
From: |
Gunnar Farnebäck |
Subject: |
Re: [gnugo-devel] territory values |
Date: |
Mon, 17 Jan 2005 04:46:24 +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) |
Arend wrote:
> Hmm. I think N13 should be considered safe territory even before
> scoring. So I guess fixing the territory evaluation would be better, if
> possible?
I was sort of hoping that you would have a good idea how to approach
it. The patch below I think is good when scoring but I suppose it's
not appropriate otherwise.
> OTOH, the fate of W R17 or W R16 isn't _that_ clear...
Agreed. But I'd rather not have the scoring attempt such invasions,
even when instructed to finish the game before actually scoring.
/Gunnar
Index: engine/influence.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/influence.c,v
retrieving revision 1.107
diff -u -r1.107 influence.c
--- engine/influence.c 6 Jan 2005 19:50:27 -0000 1.107
+++ engine/influence.c 17 Jan 2005 03:38:37 -0000
@@ -1456,6 +1456,20 @@
/* If both side have small influence, we have to reduce this value.
* What we consider "small influence" depends on how central this
* intersection lies.
+ *
+ * The values of central on an 11x11 board become:
+ *
+ * 4 5 6 7 7 7 7 7 6 5 4
+ * 5 8 9 10 10 10 10 10 9 8 5
+ * 6 9 12 13 13 13 13 13 12 9 6
+ * 7 10 13 16 16 16 16 16 13 10 7
+ * 7 10 13 16 17 17 17 16 13 10 7
+ * 7 10 13 16 17 18 17 16 13 10 7
+ * 7 10 13 16 17 17 17 16 13 10 7
+ * 7 10 13 16 16 16 16 16 13 10 7
+ * 6 9 12 13 13 13 13 13 12 9 6
+ * 5 8 9 10 10 10 10 10 9 8 5
+ * 4 5 6 7 7 7 7 7 6 5 4
*/
dist_i = gg_min(I(ii), board_size - I(ii) - 1);
dist_j = gg_min(J(ii), board_size - J(ii) - 1);
@@ -1466,6 +1480,14 @@
central = (float) 2 * gg_min(dist_i, dist_j) + dist_i + dist_j;
ratio = gg_max(q->black_influence[ii], q->white_influence[ii])
/ gg_interpolate(&min_infl_for_territory, central);
+
+ /* Do not make this adjustment when scoring unless both
+ * players have non-zero influence.
+ */
+ if (doing_scoring && (q->black_influence[ii] == 0.0
+ || q->white_influence[ii] == 0.0))
+ ratio = 1.0;
+
first_guess[ii] *= gg_interpolate(&territory_correction, ratio);
/* Dead stone, upgrade to territory. Notice that this is not