gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] owl.c question


From: Arend Bayer
Subject: [gnugo-devel] owl.c question
Date: Sun, 17 Feb 2002 21:28:07 +0100 (CET)

I am trying to rewrite the owl callback structure in order to save
unnecessary pattern checks. (I can save 5% reading nodes for owl.tst, hope
to get a little more in "real life". This works by strictly avoiding all
unnecessary pattern checks.)
I found the following code in owl_shapes_callback which does not get
used at the moment (gg_assert(0) is inserted by me), as there does not
seem to be any pattern in owl*.db that has such a helper:

  /* and work out the value of this move */
  if (pattern->helper) {
    /* ask helper function to consider the move */
    gg_assert(0);
    DEBUG(DEBUG_HELPER, "  asking helper to consider '%s'+%d at %1m\n",
          pattern->name, ll, move);
    tval = pattern->helper(pattern, ll, move, color);
    
    if (tval > 0) {
      DEBUG(DEBUG_HELPER, "helper likes pattern '%s' value %d at %1m\n",
            pattern->name, tval, move);
    }
    else {
      DEBUG(DEBUG_HELPER, "  helper does not like pattern '%s' at %1m\n",
            pattern->name, move);
      return;  /* pattern matcher does not like it */
    }
  }
  else { /* no helper */
    tval = (int) pattern->value;
  }

Is this code outdated and can get removed, or should it be kept to enable
writing such helpers in future?

Arend





reply via email to

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