gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] Missing initialization


From: Gunnar Farneback
Subject: [gnugo-devel] Missing initialization
Date: Fri, 05 Apr 2002 18:12:27 +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)

The field infl_followup_value in struct move_data is never
initialized. This has probably only a limited effect when playing one
game, but may cause strange move valuations when running multiple
games or regressions. To see the problem, run this gtp script

loadsgf ../regression/games/trevor/auto/c35.sgf 62
1 gg_genmove white
loadsgf ../regression/games/trevor/auto/c18.sgf 68
2 gg_genmove white
loadsgf ../regression/games/trevor/auto/c35.sgf 62
3 gg_genmove white

and notice how the results of 1 and 3 differ (N3 vs K12).

The appended patch solves the problem and also renames
infl_followup_value to influence_followup_value.

- infl_followup_value in struct move_data renamed to
  influence_followup_value and initialized

/Gunnar

Index: engine/move_reasons.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/move_reasons.c,v
retrieving revision 1.77
diff -u -r1.77 move_reasons.c
--- engine/move_reasons.c       31 Mar 2002 18:48:08 -0000      1.77
+++ engine/move_reasons.c       5 Apr 2002 10:36:25 -0000
@@ -136,6 +136,7 @@
       move[ii].maxneg_shape           = 0.0;
       move[ii].numneg_shape           = 0;
       move[ii].followup_value         = 0.0;
+      move[ii].influence_followup_value = 0.0;
       move[ii].reverse_followup_value = 0.0;
       move[ii].secondary_value        = 0.0;
       move[ii].min_value              = 0.0;
Index: engine/move_reasons.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/move_reasons.h,v
retrieving revision 1.15
diff -u -r1.15 move_reasons.h
--- engine/move_reasons.h       4 Mar 2002 06:49:08 -0000       1.15
+++ engine/move_reasons.h       5 Apr 2002 10:36:25 -0000
@@ -101,8 +101,8 @@
   int numneg_shape;        /* Number of negative contributions to shape */
 
   float followup_value;    /* Value of followup move (our sente). */
-  float infl_followup_value;  /* Followup value of move as reported by
-                                 experimental influence. */
+  float influence_followup_value;  /* Followup value of move as reported by
+                                      experimental influence. */
   float reverse_followup_value;        /* Value of opponents followup move
                                   (reverse sente). */
   float secondary_value;   /* Secondary move value. */
Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.23
diff -u -r1.23 value_moves.c
--- engine/value_moves.c        1 Apr 2002 21:36:04 -0000       1.23
+++ engine/value_moves.c        5 Apr 2002 10:36:25 -0000
@@ -1638,7 +1642,7 @@
   if (does_block && move[pos].move_safety) {
     if (experimental_influence)
       this_value = influence_delta_territory(pos, color, saved_stones,
-                                             &move[pos].infl_followup_value);
+                                             
&move[pos].influence_followup_value);
     else
       this_value = influence_delta_territory(pos, color, saved_stones, NULL);
     if (this_value != 0.0)
@@ -2181,9 +2196,9 @@
     float followup_value;
     if (experimental_influence) {
       followup_value = move[pos].followup_value
-                       + move[pos].infl_followup_value;
+                       + move[pos].influence_followup_value;
       TRACE("  %1m:   %f - total followup value, added %f as territorial 
followup\n",
-            pos, followup_value, move[pos].infl_followup_value);
+            pos, followup_value, move[pos].influence_followup_value);
     }
     else
       followup_value = move[pos].followup_value;



reply via email to

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