[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] tuning patch
From: |
Gunnar Farneback |
Subject: |
[gnugo-devel] tuning patch |
Date: |
Tue, 08 Jan 2002 20:01:16 +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) |
Some more tuning.
- tuning
- influence tuning
- new function connect_and_cut_helper() in helpers.c
/Gunnar
Index: patterns/barriers.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/barriers.db,v
retrieving revision 1.15
diff -u -r1.15 barriers.db
--- patterns/barriers.db 8 Jan 2002 01:01:51 -0000 1.15
+++ patterns/barriers.db 8 Jan 2002 18:57:30 -0000
@@ -1451,6 +1451,40 @@
;lib(A)==2 && !attack(A) && !oplay_attack(b,c,d,d)
+Pattern Intrusion44
+# gf New pattern. (3.1.20)
+
+.XO
+!!o
+
+:8,B,value(30)
+
+cDO
+bae
+
+;safe_omove(a)
+;&& (o_somewhere(e) || oplay_attack(a,e,e))
+;&& !oplay_defend_both(a,b,c,b,D)
+
+
+Pattern Intrusion45
+# gf New pattern. (3.1.20)
+
+X.Oo
+.!X.
+....
+----
+
+:8,B,value(30)
+
+XbOo
+.aC.
+....
+----
+
+;safe_omove(a) && oplay_attack(a,b,C)
+
+
Pattern Nonterritory1
OxO
@@ -1894,30 +1928,64 @@
>non_xterritory(*);
>non_xterritory(a);
-
-Pattern Nonterritory23
-# tm New Pattern (3.1.20)
-
-O.
-
-:-,t
-
-Oa
-
->non_xterritory(a);
-
-
-Pattern Nonterritory24
-# tm New Pattern (3.1.20)
-
-X.
-
-:-,t
-
-Xa
-
->non_oterritory(a);
-
-
+
+Pattern Nonterritory23
+# tm New Pattern (3.1.20)
+
+O.
+
+:-,t
+
+Oa
+
+>non_xterritory(a);
+
+
+Pattern Nonterritory24
+# tm New Pattern (3.1.20)
+
+X.
+
+:-,t
+
+Xa
+
+>non_oterritory(a);
+
+
+Pattern Nonterritory25
+# gf New pattern. (3.1.20)
+
+|XO
+|..
+
+:8,t
+
+|AO
+|bc
+
+;lib(A)==2 && connect_and_cut_helper(A,b,c)
+
+>non_oterritory(b);
+>non_oterritory(c);
+
+
+Pattern Nonterritory26
+# gf New pattern. (3.1.20)
+
+?.X
+OX.
+?OX
+
+:8,t
+
+?aX
+OXb
+?OX
+
+;safe_omove(a)
+
+>non_xterritory(b);
+
# END OF FILE
Index: patterns/endgame.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/endgame.db,v
retrieving revision 1.21
diff -u -r1.21 endgame.db
--- patterns/endgame.db 5 Jan 2002 12:18:37 -0000 1.21
+++ patterns/endgame.db 8 Jan 2002 18:57:30 -0000
@@ -275,34 +275,36 @@
;proper_eye(a)
-Pattern EE103b
-
-?OX? max two points if really gote
-?.*.
-----
-
-:8,eOX,maxterri(2)
-
-?OX?
-?b*a
-----
-
-;proper_eye(a) && !oplay_attack(*,a,b,a)
-
-
-Pattern EE103c
-
-?OX? max one point if really gote
-O.*.
-----
-
-:8,eOX,maxterri(1)
-
-?OX?
-?b*a
-----
-
-;proper_eye(a) && !oplay_attack(*,a,b,a) && !oplay_attack(*,a,a)
+# Pattern EE103b
+# # gf Bad pattern, removed. (3.1.20)
+#
+# ?OX? max two points if really gote
+# ?.*.
+# ----
+#
+# :8,eOX,maxterri(2)
+#
+# ?OX?
+# ?b*a
+# ----
+#
+# ;proper_eye(a) && !oplay_attack(*,a,b,a)
+
+
+# Pattern EE103c
+# # gf Bad pattern, removed. (3.1.20)
+#
+# ?OX? max one point if really gote
+# O.*.
+# ----
+#
+# :8,eOX,maxterri(1)
+#
+# ?OX?
+# ?b*a
+# ----
+#
+# ;proper_eye(a) && !oplay_attack(*,a,b,a) && !oplay_attack(*,a,a)
Pattern EE104
@@ -1480,20 +1482,17 @@
Pattern CF1
-# This pattern is too general. One example is this position.
-# OXX
-# *.X
-# XXX
-
-?X Threaten to destroy another point.
-*.
-?X
+# gf Revised pattern. (3.1.20)
+
+?X? Threaten to destroy another point.
+*..
+?X?
:-,X,followup(1)
-?X
-*a
-?X
+?X?
+*a.
+?X?
;proper_eye(a)
Index: patterns/helpers.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/helpers.c,v
retrieving revision 1.23
diff -u -r1.23 helpers.c
--- patterns/helpers.c 4 Jan 2002 01:02:53 -0000 1.23
+++ patterns/helpers.c 8 Jan 2002 18:57:31 -0000
@@ -495,15 +495,9 @@
/* No value if opponent has no safe atari. */
findlib(str, 2, libs);
-#if 0
- if (is_self_atari(libs[0], OTHER_COLOR(board[str]))
- && is_self_atari(libs[1], OTHER_COLOR(board[str])))
- return;
-#else
if (!safe_move(libs[0], OTHER_COLOR(board[str]))
&& !safe_move(libs[1], OTHER_COLOR(board[str])))
return;
-#endif
TRACE("...reverse followup value %f\n", 2.0 * worm[str].effective_size);
add_reverse_followup_value(move, 2.0 * worm[str].effective_size);
@@ -629,6 +623,63 @@
return 1;
return 0;
+}
+
+
+/* Returns true if O needs to connect at c in the position below after
+ * O at b and X at d, because X can cut at c. In general d is the
+ * second liberty of A, which must have exactly two liberties.
+ *
+ * |.X |dX
+ * |XO |AO
+ * |XO |Ae
+ * |.. |bc
+ */
+
+int
+connect_and_cut_helper(int Apos, int bpos, int cpos)
+{
+ int dpos;
+ int epos = NO_MOVE;
+ int other = board[Apos];
+ int color = OTHER_COLOR(other);
+ int libs[2];
+ int liberties = findlib(Apos, 2, libs);
+ int result = 0;
+ int k;
+
+ gg_assert(IS_STONE(color));
+ gg_assert(liberties == 2);
+
+ if (libs[0] == bpos)
+ dpos = libs[1];
+ else
+ dpos = libs[0];
+
+ for (k = 0; k < 4; k++)
+ if (board[cpos + delta[k]] == color
+ && neighbor_of_string(cpos + delta[k], Apos)) {
+ epos = cpos + delta[k];
+ break;
+ }
+
+ gg_assert(epos != NO_MOVE);
+
+ if (TRYMOVE(bpos, color)) {
+ if (TRYMOVE(dpos, other)) {
+ if (TRYMOVE(cpos, other)) {
+ if (board[bpos] == EMPTY
+ || board[epos] == EMPTY
+ || !defend_both(bpos, epos))
+ result = 1;
+ popgo();
+ }
+ popgo();
+ }
+ popgo();
+ }
+
+ return result;
}
Index: patterns/mkpat.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
retrieving revision 1.39
diff -u -r1.39 mkpat.c
--- patterns/mkpat.c 8 Jan 2002 01:01:51 -0000 1.39
+++ patterns/mkpat.c 8 Jan 2002 18:57:31 -0000
@@ -245,6 +245,7 @@
{"finish_ko_helper",1, "finish_ko_helper(%s)"},
{"squeeze_ko_helper",1,"squeeze_ko_helper(%s)"},
{"backfill_helper", 3, "backfill_helper(%s, %s, %s)"},
+ {"connect_and_cut_helper", 3, "connect_and_cut_helper(%s, %s, %s)"},
{"owl_threatens", 2, "owl_threatens_attack(%s,%s)"},
{"replace", 2, "add_replacement_move(%s,%s)"},
{"non_oterritory", 1, "influence_mark_non_territory(%s, color)"},
Index: patterns/patterns.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.h,v
retrieving revision 1.16
diff -u -r1.16 patterns.h
--- patterns/patterns.h 15 Dec 2001 14:35:27 -0000 1.16
+++ patterns/patterns.h 8 Jan 2002 18:57:31 -0000
@@ -284,6 +284,7 @@
int squeeze_ko_helper(int apos);
int backfill_helper(int apos, int bpos, int cpos);
int owl_threatens_attack(int apos, int bpos);
+int connect_and_cut_helper(int Apos, int bpos, int cpos);
/* pattern arrays themselves */
Index: patterns/patterns2.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns2.db,v
retrieving revision 1.25
diff -u -r1.25 patterns2.db
--- patterns/patterns2.db 5 Jan 2002 12:18:37 -0000 1.25
+++ patterns/patterns2.db 8 Jan 2002 18:57:31 -0000
@@ -1752,6 +1752,7 @@
Pattern Shape29
+# gf Revised constraint. (3.1.20)
O.* Avoid setting up double threat.
?X?
@@ -1761,7 +1762,7 @@
ba*
?X?
-;!oplay_defend_both(*,a,*,b)
+;(!attack(b) || defend(b)) && !oplay_defend_both(*,a,*,b)
Pattern Shape30
@@ -2362,6 +2363,23 @@
;!proper_eye(a)
+Pattern Shape73b
+# gf New pattern. (3.1.20)
+# See strategy3:120. This pattern favors C7 to D8.
+
+?OO some more shape if opponent could atari to destroy eye
+O.*
+OoO
+
+:8,-,shape(1)
+
+?AA
+O.*
+OoO
+
+;lib(A)==2 && xlib(*)>1
+
+
Pattern Shape74
# gf New pattern. (3.1.14)
@@ -2678,6 +2696,7 @@
Pattern Sente13
+# gf Revised constraint. (3.1.20)
*O
@@ -2685,7 +2704,7 @@
*a
-;lib(a) == 2 && !attack(a) && olib(*) > 2 && safe_xmove(*) && safe_omove(*)
+;lib(a) == 2 && !attack(a) && safe_xmove(*) && safe_omove(*)
# Action adds a reverse followup value.
>defend_against_atari(a)