gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] resign tweak


From: Arend Bayer
Subject: [gnugo-devel] resign tweak
Date: Tue, 11 Jan 2005 13:25:59 +0100 (CET)


This patch makes GNU Go resign
1. even if there are critical dragons around
2. even on board sizes smaller than 19.

No 1. is not dangerous with the recent switch to optimistic_score. It made
GNU Go resign at a silly moment when it was more than 50 points behind, but
had a single stone in atarii somewhere: GNU Go would resign exactly when it
had saved the single stone (or the opponent had captured it).

I haven't tested no. 2 but since being behind by more than 45 points seems
even more severe on a smaller board, it looks safe to me.

Comments?

Arend


Index: engine/genmove.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/genmove.c,v
retrieving revision 1.104
diff -u -p -r1.104 genmove.c
--- engine/genmove.c    6 Jan 2005 19:50:27 -0000       1.104
+++ engine/genmove.c    11 Jan 2005 12:20:34 -0000
@@ -111,6 +111,7 @@ examine_position(int how_much)
   int save_verbose = verbose;
 
   purge_persistent_caches();
+  start_timer(2);
   
   /* Don't print reading traces during make_worms and make_dragons unless 
    * the user really wants it (verbose == 3). 
@@ -119,9 +120,8 @@ examine_position(int how_much)
     --verbose;
 
   if (NEEDS_UPDATE(worms_examined)) {
-    start_timer(0);
     make_worms();
-    time_report(0, "  make worms", NO_MOVE, 1.0);
+    time_report(2, "  make worms", NO_MOVE, 1.0);
   }
 
   if (how_much == EXAMINE_WORMS) {
@@ -753,32 +753,22 @@ should_resign(int color, float optimisti
 {
   float status;
   int d;
-  /* We resign 19x19 games only, smaller board games are fast enough.
-   * We resign only if the margin is bigger than 45 pts and if we are
+  /* We resign only if the margin is bigger than 45 pts and if we are
    * behind (of course).
    *
-   * As an exception to this rule, we resign on any board size if
-   * it looks like all our dragons are dead and the generated move
-   * is a pass.
+   * We resign if it looks like all our dragons are dead and the
+   * generated move is a pass.
    */
   if (board_size > 2 && move == PASS_MOVE && !lively_dragon_exists(color))
     return 1;
   
   if (move == PASS_MOVE
-      || board_size < 19
       || optimistic_score > -45.0)
     return 0;
-  /* Check dragon statuses. If a friendly dragon is critical, we are
-   * possibly not that much behind after we save it. If some hostile
-   * dragon is at least weak, we possibly have a chance to come back
-   * if we can kill it.
+  /* If some hostile dragon is at least weak, we possibly have a chance
+   * to come back if we can kill it.
    */
   for (d = 0; d < number_of_dragons; d++) {
-    /* any friendly critical dragon ? */
-    if (board[dragon2[d].origin] == color
-       && DRAGON(d).status == CRITICAL)
-      return 0;
-    /* any weak opponent dragon ? */
     if (board[dragon2[d].origin] == OTHER_COLOR(color)
        && DRAGON(d).status != DEAD
        && DRAGON(d).effective_size >= 10




reply via email to

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