gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] atari_atari cleanup patch


From: Gunnar Farneback
Subject: [gnugo-devel] atari_atari cleanup patch
Date: Tue, 01 Jan 2002 18:13:20 +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 removes some obsolete atari_atari code.

- atari_atari_try_combination() removed
- old method to generate atari_atari attack moves without patterns no
  longer supported

/Gunnar

Index: engine/combination.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/combination.c,v
retrieving revision 1.15
diff -u -r1.15 combination.c
--- engine/combination.c        1 Jan 2002 14:50:09 -0000       1.15
+++ engine/combination.c        1 Jan 2002 17:07:37 -0000
@@ -225,8 +225,6 @@
  * size of the smallest of the worms under attack.
  */
 
-#define USE_ATARI_ATARI_PATTERNS 1
-
 static int aa_status[BOARDMAX]; /* ALIVE, DEAD or CRITICAL */
 static int forbidden[BOARDMAX];
 static int vital_string[BOARDMAX]; /* May not sacrifice these stones. */
@@ -382,41 +380,6 @@
 }
 
 
-/* Ask the atari_atari code if after color plays at (apos)
- * and other plays at (bpos) there appears any combination
- * attack. Returns the size of the combination.
- */
-
-int
-atari_atari_try_combination(int color, int apos, int bpos)
-{
-  int other = OTHER_COLOR(color);
-  int aa_val = 0;
-  int save_verbose = verbose;
-
-  if (USE_ATARI_ATARI_PATTERNS)
-    return 0;
-  
-  if (aa_depth < 2)
-    return 0;
-  if (verbose > 0)
-    verbose--;
-  memset(forbidden, 0, sizeof(forbidden));
-
-  compute_aa_status(color, NULL, NULL);
-
-  if (trymove(apos, color, NULL, NO_MOVE, EMPTY, NO_MOVE)) {
-    if (trymove(bpos, other, NULL, NO_MOVE, EMPTY, NO_MOVE)) {
-      aa_val = do_atari_atari(color, NULL, NULL, apos, 0, 0);
-      popgo();
-    }
-    popgo();
-  }
-  verbose = save_verbose;
-  return aa_val;
-}
-
-
 /* ---------------------------------------------------------------- */
 /*                Helper functions for atari_atari.                 */
 /* ---------------------------------------------------------------- */
@@ -835,61 +798,7 @@
   
   aa_init_moves(attacks);
 
-  if (USE_ATARI_ATARI_PATTERNS)
-    atari_atari_attack_patterns(color, minsize, attacks);
-  else {
-    for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
-      if (board[pos] != other) 
-       continue;
-      
-      if (pos != find_origin(pos))
-       continue;
-      
-      if (minsize > 0 && countstones(pos) < minsize && !is_vital_string(pos))
-       continue;
-      
-      if (get_aa_status(pos) != ALIVE)
-       continue;
-      
-      /* Pick up general threat moves or simple ataris. */
-      if (stackp < aa_threat_depth) {
-       memset(threat_moves, 0, sizeof(threat_moves));
-       memset(threat_codes, 0, sizeof(threat_codes));
-       num_threat_moves = attack_threats(pos, MAX_THREAT_MOVES,
-                                         threat_moves, threat_codes);
-       if ((debug & DEBUG_ATARI_ATARI)
-           && num_threat_moves > 0) {
-         int i;
-         gprintf("Threats on %1m: ", pos);
-         for (i = 0; i < num_threat_moves; i++)
-           gprintf("%1m ", threat_moves[i]);
-         gprintf("\n");
-       }
-      }
-      else {
-       num_threat_moves = findlib(pos, 2, threat_moves);
-       if (num_threat_moves != 2)
-         continue;
-      }
-      
-      /* Add the threats on (pos) to the moves[] array, unless forbidden
-       * or assumed to be ineffective.
-       */
-      for (k = 0; k < num_threat_moves; k++) {
-       int move = threat_moves[k];
-       
-       if (aa_move_known(attacks, move, pos) || forbidden[move])
-         continue;
-       
-       if ((is_self_atari(move, color)
-            || !is_atari(move, color))
-           && !safe_move(move, color))
-         continue;
-
-       aa_add_move(attacks, move, pos);
-      }
-    }
-  }
+  atari_atari_attack_patterns(color, minsize, attacks);
 
   /* Sort the attack moves. */
   aa_sort_moves(attacks);
Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.63
diff -u -r1.63 liberty.h
--- engine/liberty.h    24 Dec 2001 00:53:30 -0000      1.63
+++ engine/liberty.h    1 Jan 2002 17:07:44 -0000
@@ -394,7 +394,6 @@
 int atari_atari_confirm_safety(int color, int tpos, int *move,
                               int minsize, int saved_dragons[BOARDMAX],
                               int saved_worms[BOARDMAX]);
-int atari_atari_try_combination(int color, int apos, int bpos);
 
 int review_move_reasons(int *move, float *val, int color,
                        float pure_threat_value, float lower_bound);
Index: patterns/mkpat.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
retrieving revision 1.37
diff -u -r1.37 mkpat.c
--- patterns/mkpat.c    21 Dec 2001 16:04:05 -0000      1.37
+++ patterns/mkpat.c    1 Jan 2002 17:07:50 -0000
@@ -246,8 +246,6 @@
   {"squeeze_ko_helper",1,"squeeze_ko_helper(%s)"},
   {"backfill_helper", 3, "backfill_helper(%s, %s, %s)"},
   {"owl_threatens",   2, "owl_threatens_attack(%s,%s)"},
-  {"o_aa_attack",     2, "atari_atari_try_combination(color,%s,%s)"},
-  {"x_aa_attack",     2, 
"atari_atari_try_combination(OTHER_COLOR(color),%s,%s)"},
   {"replace",         2, "add_replacement_move(%s,%s)"},
   {"non_oterritory",  1, "influence_mark_non_territory(%s, color)"},
   {"non_xterritory",  1, "influence_mark_non_territory(%s, 
OTHER_COLOR(color))"}
Index: patterns/patterns.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.db,v
retrieving revision 1.41
diff -u -r1.41 patterns.db
--- patterns/patterns.db        30 Dec 2001 16:40:45 -0000      1.41
+++ patterns/patterns.db        1 Jan 2002 17:08:01 -0000
@@ -1402,28 +1402,6 @@
 ; x_somewhere(a,b,c,d)
 
 
-# Pattern EC7a
-# # gf Where does this pattern come from? It's completely unreasonable
-# #    to have a big fixed value without checking whether the X stones
-# #    can live, as can be seen in test case trevor:421.
-# #    Pattern removed. (3.1.11)
-# 
-# ?O.X      break connection in sente
-# X*..
-# ....
-# ----
-# 
-# :8,OBda,value(20)
-# 
-# ?O.X
-# A*..
-# ....
-# ----
-# 
-# ; oplay_attack(*,A)
-
-
-
 Pattern EC9
 # Probably redundant
 
@@ -10878,39 +10856,6 @@
 cb.
 
 ; xplay_attack(a,b,c,c) && !oplay_attack(*,a,b,c,c)
-
-
-Pattern CD103
-# gf Revised constraint. (3.1.13)
-
-?XOX?       capture something!
-.*X..
-?...?
-
-:|,sa,value(12)
-
-?XbX?
-.*Xa.
-?...?
-
-;!oplay_attack(*,b) && o_aa_attack(*,a) && o_aa_attack(a,*)
-
-
-Pattern CD103a
-# valued slightly more than CD103 because at least potentially this
-# pattern could be devastating. (See blunder14.sgf.)
-
-?OXO?       defend against the attack!
-.*O..
-?...?
-
-:|,d,value(15)
-
-?OXO?
-.*Oa.
-?...?
-
-; x_aa_attack(*,a) && x_aa_attack(a,*)
 
 
 Pattern CD104



reply via email to

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