gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] influence cleanup step 1


From: Arend Bayer
Subject: [gnugo-devel] influence cleanup step 1
Date: Thu, 12 Dec 2002 09:54:05 +0100 (CET)

- use "territorial_influence" for pre-owl initial_influence
- safety values WEAKLY_ALIVE and WEAK removed
- use dragon2[].weakness or new field .weakness_pre_owl instead in most places
- use crude_dragon_weakness() to decide whether owl analysis is needed
- reduce value of prisoners when computing moyo_value

So here is the first step as explained earlier.

dragon2[].weakness is now computed twice, once before owl (and copied to
.weakness_pre_owl) and once afterwards. dragon2[].moyo_size,
.moyo_territorial_value and .weakness always hold the most up to date
result.

The reason we need .weakness_pre_owl is that the post-owl influence
computation and the compute_move_influence have to use the same value
here for consistency.

I suspect that the users of .crude_status should also be converted to
use .weakness instead.

Btw, when tuning the "owl call" decision I found some weirdly long owl
computations. For example in ninestones:120, owl runs out of nodes for
examining the big white dragon at R15, although it is obviously alife.
This should not take more than 20 nodes. (It would be worthwile to have
a way to create regression tests for this. S.th. like
"owl_attack_certain" s.t. the tests only passes if owl finds the dragon
alive wihtout running out of nodes.)
So yes we do badly need improved eye space analysis.

Arend


The breakage of a slightly earlier version of the patch (against CVS before
nando_3_13.2). One proper FAIL, a couple of good PASSes.

nngs1:33        PASS S10 [!S9]                  Probably lucky.
nngs1:34        FAIL N10 [!N10|N9|N11|O11|O10]  Only bad fail. Invasion
        penalty should be generalized to include this case.  (CVS passes
        this one very luckily.)
nngs1:35        PASS D13 [D13]
Good (O8 no longer considered weak).
nngs1:51        PASS L5 [!K18]                  Very good.
trevorc:1040    FAIL A8 [!A8]                   Accidentally passed before.
        (Improved version of this test below.)

global:35       FAIL B13 [M12]                  Fixed now.

13x13:7         PASS M7 [L7|M7|M6]              Good.
13x13:13        FAIL G7 [!G7]                   Improved.
        Much better than before (CVS play H8). Actual change is that F8 is
        no longer considered weak, which is obviously very good.

nngs3:400       PASS N13 [N13]
safety:3        PASS F13 [H15|H16|G14|F13|C17]  Good.
        (haven't investigated why)

Total nodes: 1328013655 2195144 5565216
This is a slight reduction of owl nodes but the actual patch should be
a little higher again. Change is below 1% anyway.


Index: engine/dragon.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v
retrieving revision 1.90
diff -u -p -r1.90 dragon.c
--- engine/dragon.c     20 Nov 2002 18:27:35 -0000      1.90
+++ engine/dragon.c     12 Dec 2002 08:21:09 -0000
@@ -64,8 +64,7 @@ static void connected_to_eye_recurse(int
 static int compute_crude_status(int pos);
 static void dragon_eye(int pos, struct eye_data[BOARDMAX]);
 static int compute_escape(int pos, int dragon_status_known);
-static void compute_surrounding_moyo_sizes(int opposite,
-                                          int dragon_status_known);
+static void compute_surrounding_moyo_sizes(int opposite);

 static int dragon2_initialized;
 static int lively_white_dragons;
@@ -107,7 +106,6 @@ make_dragons(int color, int stop_before_
   start_timer(2);
   dragon2_initialized = 0;
   initialize_dragon_data();
-  time_report(2, "  time to initialize dragons", NO_MOVE, 1.0);

   make_domains(black_eye, white_eye, 0);
   time_report(2, "  time to make domains", NO_MOVE, 1.0);
@@ -146,7 +144,6 @@ make_dragons(int color, int stop_before_
    * amalgamation of dragons.
    */
   initialize_supplementary_dragon_data();
-  time_report(2, "  time to initialize dragon2", NO_MOVE, 1.0);

   /* Find adjacent worms which can be easily captured: */

@@ -189,7 +186,6 @@ make_dragons(int color, int stop_before_
        }
       }
     }
-  time_report(2, "  time to find lunches", NO_MOVE, 1.0);

   /* Find topological half eyes and false eyes. */
   find_half_and_false_eyes(BLACK, black_eye, half_eye, NULL);
@@ -235,13 +231,11 @@ make_dragons(int color, int stop_before_
       propagate_eye(str, white_eye);
     }
   }
-  time_report(2, "  time to find eyes", NO_MOVE, 1.0);

   /* Try to determine whether topologically false and half eye points
    * contribute to territory even if the eye doesn't solidify.
    */
   analyze_false_eye_territory();
-  time_report(2, "  time to analyze false eye territory", NO_MOVE, 1.0);

   /* Now we compute the genus. */
   for (str = BOARDMIN; str < BOARDMAX; str++) {
@@ -278,13 +272,11 @@ make_dragons(int color, int stop_before_
                    &DRAGON2(dr).genus);
     }
   }
-  time_report(2, "  time to compute genus", NO_MOVE, 1.0);

   /* Compute the escape route measure. */
   for (str = BOARDMIN; str < BOARDMAX; str++)
     if (IS_STONE(board[str]) && dragon[str].origin == str)
       DRAGON2(str).escape_route = compute_escape(str, 0);
-  time_report(2, "  time to compute escape", NO_MOVE, 1.0);

   /* Update the segmentation of the initial influence before we
    * compute the surrounding moyo sizes. The reason for this is that
@@ -292,18 +284,11 @@ make_dragons(int color, int stop_before_
    * into account.
    */
   resegment_initial_influence();
-  time_report(2, "  resegment_initial_influence", NO_MOVE, 1.0);

-  /* Compute the surrounding moyo sizes. */
-  for (d = 0; d < number_of_dragons; d++)
-    dragon2[d].moyo_size_pre_owl = 2 * BOARDMAX;
-  /* Set moyo sizes according to initial_influence. */
-  compute_surrounding_moyo_sizes(0, 0);
-  /* Set moyo sizes according to initial_opposite_influence if
-   * this yields smaller results.
-   */
-  compute_surrounding_moyo_sizes(1, 0);
-  time_report(2, "  time to compute moyo sizes", NO_MOVE, 1.0);
+  /* Set dragon weaknesses according to initial_influence. */
+  compute_refined_dragon_weaknesses();
+  for (d = 0; d < number_of_dragons; d++)
+    dragon2[d].weakness_pre_owl = dragon2[d].weakness;

   /* Determine status: ALIVE, DEAD, CRITICAL or UNKNOWN */
   for (str = BOARDMIN; str < BOARDMAX; str++)
@@ -311,7 +296,6 @@ make_dragons(int color, int stop_before_
       if (dragon[str].origin == str && board[str]) {
        dragon[str].crude_status = compute_crude_status(str);
       }
-  time_report(2, "  compute_crude_status", NO_MOVE, 1.0);

   /* We must update the dragon status at every intersection before we
    * call the owl code. This updates all fields.
@@ -324,7 +308,7 @@ make_dragons(int color, int stop_before_
     }

   find_neighbor_dragons();
-  time_report(2, "  find_neighbor_dragons", NO_MOVE, 1.0);
+  time_report(2, "  pre-owl dragon data", NO_MOVE, 1.0);

   if (stop_before_owl)
     return;
@@ -337,16 +321,18 @@ make_dragons(int color, int stop_before_
     if (ON_BOARD(str)) {
       int attack_point = NO_MOVE;
       int defense_point = NO_MOVE;
+      struct eyevalue no_eyes;
+      set_eyevalue(&no_eyes, 0, 0, 0, 0);

       if (board[str] == EMPTY
          || dragon[str].origin != str)
        continue;

       /* Some dragons can be ignored but be extra careful with big dragons. */
-      if (DRAGON2(str).escape_route > 25
-         || DRAGON2(str).moyo_size_pre_owl > 20
-         || (DRAGON2(str).moyo_size_pre_owl > 10
-             && DRAGON2(str).moyo_size_pre_owl > dragon[str].size)) {
+      if (crude_dragon_weakness(ALIVE, &no_eyes, 0,
+                               DRAGON2(str).moyo_territorial_value,
+                               DRAGON2(str).escape_route - 10)
+         < 0.00001 + gg_max(0.12, 0.32 - 0.01*dragon[str].effective_size)) {
        dragon[str].owl_status = UNCHECKED;
        dragon[str].owl_attack_point  = NO_MOVE;
        dragon[str].owl_defense_point = NO_MOVE;
@@ -487,11 +473,12 @@ make_dragons(int color, int stop_before_
     if (ON_BOARD(str)
        && board[str] != EMPTY
        && dragon[str].origin == str) {
-      /* Some dragons can be ignored but be extra careful with big dragons. */
-      if (DRAGON2(str).escape_route > 25
-         || DRAGON2(str).moyo_size_pre_owl > 20
-         || (DRAGON2(str).moyo_size_pre_owl > 10
-             && DRAGON2(str).moyo_size_pre_owl > dragon[str].size)) {
+      struct eyevalue no_eyes;
+      set_eyevalue(&no_eyes, 0, 0, 0, 0);
+      if (crude_dragon_weakness(ALIVE, &no_eyes, 0,
+                               DRAGON2(str).moyo_territorial_value,
+                               DRAGON2(str).escape_route - 10)
+         < 0.00001 + gg_max(0.12, 0.32 - 0.01*dragon[str].effective_size)) {
        dragon[str].owl_threat_status = UNCHECKED;
        dragon[str].owl_second_attack_point  = NO_MOVE;
        dragon[str].owl_second_defense_point = NO_MOVE;
@@ -555,7 +542,6 @@ make_dragons(int color, int stop_before_
     }
   }

-  time_report(2, "  surround status", NO_MOVE, 0.0);

   /* Compute the safety value. */
   for (d = 0; d < number_of_dragons; d++) {
@@ -579,27 +565,14 @@ make_dragons(int color, int stop_before_
       dragon2[d].safety = DEAD;
     else if (dragon[origin].owl_status == CRITICAL)
       dragon2[d].safety = CRITICAL;
-    else if (dragon[origin].owl_status == UNCHECKED
-            && true_genus < 4
-            && dragon2[d].moyo_size_pre_owl <= 10)
-      dragon2[d].safety = WEAK;
     else if (dragon_invincible(origin))
       dragon2[d].safety = INVINCIBLE;
-    else if (true_genus >= 6 || dragon2[d].moyo_size_pre_owl > 20)
+    else if (true_genus >= 6 || dragon2[d].moyo_size > 20)
       dragon2[d].safety = STRONGLY_ALIVE;
-    else if ((2 * true_genus + dragon2[d].moyo_size_pre_owl
-             + 2 * (dragon2[d].lunch != NO_MOVE) < 8
-             && dragon2[d].escape_route < 10)
-            || (dragon[origin].owl_threat_status == CAN_THREATEN_ATTACK)) {
-      if (DRAGON(d).owl_attack_certain)
-         dragon2[d].safety = WEAKLY_ALIVE;
-      else
-         dragon2[d].safety = WEAK;
-    }
     else
       dragon2[d].safety = ALIVE;
   }
-  time_report(2, "  compute dragon safety", NO_MOVE, 1.0);
+  time_report(2, "  post owl dragon data", NO_MOVE, 1.0);

   /* Resolve semeais. This may revise the safety and status fields. */
   if (experimental_semeai && level >= 8)
@@ -814,8 +787,7 @@ initialize_supplementary_dragon_data(voi
   for (d = 0; d < number_of_dragons; d++) {
     dragon2[d].neighbors               = 0;
     dragon2[d].hostile_neighbors       = 0;
-    dragon2[d].moyo_size_pre_owl       = -1;
-    dragon2[d].moyo_size_post_owl      = -1;
+    dragon2[d].moyo_size              = -1;
     dragon2[d].moyo_territorial_value  = 0.0;
     dragon2[d].safety                  = -1;
     dragon2[d].escape_route            = 0;
@@ -1411,7 +1383,7 @@ show_dragons(void)
     d2 = &(dragon2[dd->id]);

     if (dd->origin == pos) {
-      gprintf("%1m : %s dragon size %d (%f), genus %s, escape factor %d, crude 
status %s, status %s, moyo size pre owl %d, moyo size post owl %d, moyo 
territory value %f, safety %s, weakness %f",
+      gprintf("%1m : %s dragon size %d (%f), genus %s, escape factor %d, crude 
status %s, status %s, moyo size %d, moyo territory value %f, safety %s, 
weakness pre owl %f, weakness %f",
              pos,
              board[pos] == BLACK ? "B" : "W",
              dd->size,
@@ -1420,10 +1392,10 @@ show_dragons(void)
              d2->escape_route,
              snames[dd->crude_status],
              snames[dd->status],
-             d2->moyo_size_pre_owl,
-             d2->moyo_size_post_owl,
+             d2->moyo_size,
              d2->moyo_territorial_value,
              safety_names[d2->safety],
+             d2->weakness_pre_owl,
              d2->weakness);
       gprintf(", owl status %s\n", snames[dd->owl_status]);
       if (dd->owl_status == CRITICAL) {
@@ -1612,7 +1584,7 @@ compute_crude_status(int pos)
   if (lunch == NO_MOVE || worm[lunch].cutstone < 2) {
     if (true_genus < 3
        && DRAGON2(pos).escape_route == 0
-       && DRAGON2(pos).moyo_size_pre_owl < 5)
+       && DRAGON2(pos).moyo_size < 5)
       return DEAD;

     if (true_genus == 3
@@ -1849,7 +1821,7 @@ compute_escape(int pos, int dragon_statu
        escape_value[ii] = 6;
       else if (dragon[ii].crude_status == UNKNOWN
               && (DRAGON2(ii).escape_route > 5
-                  || DRAGON2(ii).moyo_size_pre_owl  > 5))
+                  || DRAGON2(ii).moyo_size  > 5))
        escape_value[ii] = 4;
     }
     else {
@@ -1867,8 +1839,6 @@ compute_escape(int pos, int dragon_statu
  * Sum up the surrounding moyo sizes for each dragon. Write this into
  * dragon2[].moyo if it is smaller than the current entry. If (opposite)
  * is true, we use initial_opposite_influence, otherwise initial_influence.
- * If dragons_known is false, then .moyo_size_pre_owl is set, otherwise
- * .moyo_size_post_owl and .moyo_territorial_value.
  *
  * Currently this is implemented differently depending on whether
  * experimental connections are used or not. The reason why this is
@@ -1879,7 +1849,7 @@ compute_escape(int pos, int dragon_statu
  * surrounding moyo which is closest to some worm of the dragon.
  */
 static void
-compute_surrounding_moyo_sizes(int opposite, int dragon_status_known)
+compute_surrounding_moyo_sizes(int opposite)
 {
   int pos;
   int d;
@@ -1909,16 +1879,10 @@ compute_surrounding_moyo_sizes(int oppos
        }
       }

-      if (!dragon_status_known) {
-       if (this_moyo_size < dragon2[d].moyo_size_pre_owl) {
-         dragon2[d].moyo_size_pre_owl = this_moyo_size;
-       }
+      if (this_moyo_size < dragon2[d].moyo_size) {
+       dragon2[d].moyo_size = this_moyo_size;
+       dragon2[d].moyo_territorial_value = this_moyo_value;
       }
-      else
-       if (this_moyo_size < dragon2[d].moyo_size_post_owl) {
-         dragon2[d].moyo_size_post_owl = this_moyo_size;
-         dragon2[d].moyo_territorial_value = this_moyo_value;
-       }
     }
   }
   else {
@@ -1948,7 +1912,7 @@ compute_surrounding_moyo_sizes(int oppos
          int dr = dragon[w].origin;

          moyo_sizes[dr] += 1.0 / number_close_white_worms[pos];
-         moyo_values[dr] += (territory_value[pos]
+         moyo_values[dr] += (gg_min(territory_value[pos], 1.0)
                              / number_close_white_worms[pos]);
        }
       }
@@ -1959,7 +1923,7 @@ compute_surrounding_moyo_sizes(int oppos
          int dr = dragon[w].origin;

          moyo_sizes[dr] += 1.0 / number_close_black_worms[pos];
-         moyo_values[dr] += (territory_value[pos]
+         moyo_values[dr] += (gg_min(territory_value[pos], 1.0)
                              / number_close_black_worms[pos]);
        }
       }
@@ -1969,12 +1933,8 @@ compute_surrounding_moyo_sizes(int oppos
       int this_moyo_size = (int) moyo_sizes[dragon2[d].origin];
       float this_moyo_value = moyo_values[dragon2[d].origin];

-      if (!dragon_status_known) {
-       if (this_moyo_size < dragon2[d].moyo_size_pre_owl)
-         dragon2[d].moyo_size_pre_owl = this_moyo_size;
-      }
-      else if (this_moyo_size < dragon2[d].moyo_size_post_owl) {
-       dragon2[d].moyo_size_post_owl = this_moyo_size;
+      if (this_moyo_size < dragon2[d].moyo_size) {
+       dragon2[d].moyo_size = this_moyo_size;
        dragon2[d].moyo_territorial_value = this_moyo_value;
       }
     }
@@ -2096,15 +2056,15 @@ compute_refined_dragon_weaknesses()

   /* Compute the surrounding moyo sizes. */
   for (d = 0; d < number_of_dragons; d++)
-    dragon2[d].moyo_size_post_owl = 2 * BOARDMAX;
+    dragon2[d].moyo_size = 2 * BOARDMAX;

   /* Set moyo sizes according to initial_influence. */
-  compute_surrounding_moyo_sizes(0, 1);
+  compute_surrounding_moyo_sizes(0);

   /* Set moyo sizes according to initial_opposite_influence if
    * this yields smaller results.
    */
-  compute_surrounding_moyo_sizes(1, 1);
+  compute_surrounding_moyo_sizes(1);

   for (d = 0; d < number_of_dragons; d++)
     dragon2[d].weakness = compute_dragon_weakness_value(d);
@@ -2277,8 +2237,7 @@ report_dragon(FILE *outfile, int pos)
   for (k = 0; k < d2->neighbors; k++)
     gfprintf(outfile, "%1m ", DRAGON(d2->adjacent[k]).origin);
   gfprintf(outfile, "\nhostile neighbors       %d\n", d2->hostile_neighbors);
-  gfprintf(outfile, "moyo size pre owl       %d\n", d2->moyo_size_pre_owl);
-  gfprintf(outfile, "moyo size post owl      %d\n", d2->moyo_size_post_owl);
+  gfprintf(outfile, "moyo size               %d\n", d2->moyo_size);
   gfprintf(outfile, "moyo territorial value  %f\n",
           d2->moyo_territorial_value);
   gfprintf(outfile, "safety                  %s\n",
Index: engine/genmove.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/genmove.c,v
retrieving revision 1.57
diff -u -p -r1.57 genmove.c
--- engine/genmove.c    30 Nov 2002 16:20:42 -0000      1.57
+++ engine/genmove.c    12 Dec 2002 08:21:12 -0000
@@ -737,7 +737,7 @@ revise_thrashing_dragon(int color, float
        && is_same_dragon(pos, thrashing_dragon))
       dragon[pos].status = UNKNOWN;

-  DRAGON2(thrashing_dragon).safety = WEAKLY_ALIVE;
+  DRAGON2(thrashing_dragon).safety = ALIVE;
   compute_initial_influence(color, 1);
   compute_refined_dragon_weaknesses();

Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.81
diff -u -p -r1.81 gnugo.h
--- engine/gnugo.h      8 Dec 2002 13:20:35 -0000       1.81
+++ engine/gnugo.h      12 Dec 2002 08:21:15 -0000
@@ -93,10 +93,8 @@ void init_gnugo(float memory);
 #define MAX_DRAGON_STATUS 4    /* used to size an array in matchpat.c */

 /* Dragon safety values. DEAD, ALIVE, and CRITICAL are reused. */
-#define INESSENTIAL     3
-#define TACTICALLY_DEAD 4
-#define WEAK            5
-#define WEAKLY_ALIVE    6
+#define INESSENTIAL     5
+#define TACTICALLY_DEAD 6
 #define ALIVE_IN_SEKI   7
 #define STRONGLY_ALIVE  8
 #define INVINCIBLE      9
Index: engine/influence.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/influence.c,v
retrieving revision 1.69
diff -u -p -r1.69 influence.c
--- engine/influence.c  6 Dec 2002 23:31:42 -0000       1.69
+++ engine/influence.c  12 Dec 2002 08:21:24 -0000
@@ -348,19 +348,6 @@ accumulate_influence(struct influence_da
  *
  */

-static float strength_map[10] = {
-  0.0,   /* DEAD            */
-  0.9,   /* ALIVE           */
-  0.5,   /* CRITICAL        */
-  0.0,   /* INESSENTIAL     */
-  0.0,   /* TACTICALLY DEAD */
-  0.7,   /* WEAK            */
-  0.8,   /* WEAKLY_ALIVE    */
-  0.6,   /* ALIVE IN SEKI   */
-  0.95,  /* STRONGLY ALIVE  */
-  1.0    /* INVINCIBLE      */
-};
-
 static void
 init_influence(struct influence_data *q, int color,
               char saved_stones[BOARDMAX])
@@ -477,15 +464,15 @@ init_influence(struct influence_data *q,
            if (color == BLACK && DRAGON2(ii).safety == CRITICAL)
              q->white_strength[ii] = 0.0;
            else
-             q->white_strength[ii] = (DEFAULT_STRENGTH
-                                        * strength_map[DRAGON2(ii).safety]);
+             q->white_strength[ii] = DEFAULT_STRENGTH
+                                     * (1.0 - 0.3 * 
DRAGON2(ii).weakness_pre_owl);
          }
          else if (q->p[ii] == BLACK) {
            if (color == WHITE && DRAGON2(ii).safety == CRITICAL)
              q->black_strength[ii] = 0.0;
            else
-             q->black_strength[ii] = (DEFAULT_STRENGTH
-                                        * strength_map[DRAGON2(ii).safety]);
+             q->black_strength[ii] = DEFAULT_STRENGTH
+                                     * (1.0 - 0.3 * 
DRAGON2(ii).weakness_pre_owl);
          }
        }
       }
@@ -1574,7 +1561,7 @@ compute_initial_influence(int color, int
   initial_influence.dragons_known = dragons_known;
   initial_influence.is_territorial_influence = dragons_known;
   initial_opposite_influence.dragons_known = dragons_known;
-  initial_opposite_influence.is_territorial_influence = dragons_known;
+  initial_opposite_influence.is_territorial_influence = 1;

   decrease_depth_values();

Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.140
diff -u -p -r1.140 liberty.h
--- engine/liberty.h    9 Dec 2002 23:04:16 -0000       1.140
+++ engine/liberty.h    12 Dec 2002 08:21:29 -0000
@@ -894,11 +894,11 @@ struct dragon_data2 {
   int adjacent[MAX_NEIGHBOR_DRAGONS]; /* adjacent dragons                    */
   int neighbors;                      /* number of adjacent dragons          */
   int hostile_neighbors;              /* neighbors of opposite color         */
-  int moyo_size_pre_owl;              /* size of surrounding influence moyo  */
-  int moyo_size_post_owl;             /* size of surrounding influence moyo, */
+  int moyo_size;                     /* size of surrounding influence moyo, */
   float moyo_territorial_value;       /* ...and its territorial value */
   int safety;                         /* a more detailed status estimate     */
   float weakness; /* A new (3.3.x) continuos estimate of the dragon's safety */
+  float weakness_pre_owl;     /* Dragon safety based on pre-owl computations */
   int escape_route; /* a measurement of likelihood of escape                 */
   struct eyevalue genus;    /* the number of eyes (approximately)            */
   int heye;     /* coordinates of a half eye                                 */
Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.127
diff -u -p -r1.127 owl.c
--- engine/owl.c        11 Dec 2002 02:51:30 -0000      1.127
+++ engine/owl.c        12 Dec 2002 08:21:58 -0000
@@ -4941,7 +4941,7 @@ compute_owl_escape_values(struct local_o
          owl->escape_values[pos] = 6;
        else if (dragon[pos].crude_status == UNKNOWN
                 && (DRAGON2(pos).escape_route > 5
-                    || DRAGON2(pos).moyo_size_pre_owl > 5))
+                    || DRAGON2(pos).moyo_size > 5))
          owl->escape_values[pos] = 4;
       }
       DEBUG(DEBUG_ESCAPE, "%o%d", owl->escape_values[pos]);
Index: engine/printutils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/printutils.c,v
retrieving revision 1.28
diff -u -p -r1.28 printutils.c
--- engine/printutils.c 4 Nov 2002 16:55:08 -0000       1.28
+++ engine/printutils.c 12 Dec 2002 08:21:59 -0000
@@ -379,10 +379,6 @@ safety_to_string(int status)
     return "INESSENTIAL";
   else if (status == TACTICALLY_DEAD)
     return "TACTICALLY_DEAD";
-  else if (status == WEAK)
-    return "WEAK";
-  else if (status == WEAKLY_ALIVE)
-    return "WEAKLY_ALIVE";
   else if (status == ALIVE_IN_SEKI)
     return "ALIVE_IN_SEKI";
   else if (status == STRONGLY_ALIVE)
Index: patterns/helpers.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/helpers.c,v
retrieving revision 1.40
diff -u -p -r1.40 helpers.c
--- patterns/helpers.c  6 Dec 2002 23:31:43 -0000       1.40
+++ patterns/helpers.c  12 Dec 2002 08:22:14 -0000
@@ -731,9 +731,7 @@ dragon_weak(int pos)
    */
   if (dragon[pos].id < 0 || dragon[pos].id >= number_of_dragons)
      return 1;
-  return DRAGON2(pos).safety != ALIVE
-         && DRAGON2(pos).safety != STRONGLY_ALIVE \
-        && DRAGON2(pos).safety != INVINCIBLE;
+  return (DRAGON2(pos).weakness > 0.40001);
 }


Index: patterns/owl_defendpats.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/owl_defendpats.db,v
retrieving revision 1.76
diff -u -p -r1.76 owl_defendpats.db
--- patterns/owl_defendpats.db  8 Dec 2002 14:39:30 -0000       1.76
+++ patterns/owl_defendpats.db  12 Dec 2002 08:22:24 -0000
@@ -488,22 +488,23 @@ Pattern D123

 Pattern D124
 # tm New Pattern (3.1.20) (see trevorb:660)
+# ab Revised constraint.

-X..   split off weak stones
-*OO
-.Xx
-...
----
+?X..   split off weak stones
+o*OO
+o.Xx
+o...
+----

 :8,-,value(81)

-X..
-*OO
-.ax
-...
----
+?X..
+a*OO
+?bcx
+?...
+----

-;weak(a)
+;oplay_attack(*,a,b,c) && !attack(c)


 #########################################################
Index: regression/trevorc.tst
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/trevorc.tst,v
retrieving revision 1.36
diff -u -p -r1.36 trevorc.tst
--- regression/trevorc.tst      21 Nov 2002 00:25:10 -0000      1.36
+++ regression/trevorc.tst      12 Dec 2002 08:22:27 -0000
@@ -591,8 +591,8 @@ loadsgf games/trevor/auto/c61.sgf 28


 loadsgf games/trevor/auto/c61.sgf 42
-1040 gg_genmove white
-#? [!A8]
+1040 restricted_genmove white A8 C8
+#? [C8]*


 loadsgf games/trevor/auto/c61.sgf 88




reply via email to

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