[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] arend_1_18.1: next attempt to bring order to move_reas
From: |
Gunnar Farneback |
Subject: |
Re: [gnugo-devel] arend_1_18.1: next attempt to bring order to move_reasons (supercedes arend_1_17.1) |
Date: |
Mon, 17 Dec 2001 20:49:36 +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) |
Arend wrote:
> This is an extended and corrected version of arend_1_17.1. There is
> actually more new added code than deleted old one, but I still believe
> it makes the main functions estimate_territorial_value and
> estimate_strategical_value more readable. I think what my patch does is
> most quickly summarized by (discard_rules) reproduced below.
This looks okay to me if it passes the regressions. A few comments for
later improvements:
> +struct discard_rule {
> + int reason_type[40];
> + discard_condition_fn_ptr condition;
> + int flags;
> + char trace_message[160];
Both array sizes should be symbolic constants. For the first we
already have the symbol MAX_REASONS.
> +/* Interprets the object of a reason and returns its position.
> + * If the object is a pair (of worms or dragons), the position of the first
> + * object is returned. (This is only used for trace outputs.) Returns
> + * -1 if move does not point to a location.
The usual convention is to return NO_MOVE in the last case.
> +/* Bitmap values for move_reason.status */
> +#define ACTIVE 0
> +#define TERRITORY_REDUNDANT 1
> +#define STRATEGICALLY_REDUNDANT 2
> +#define REDUNDANT 3
> +#define SECONDARY 4
It seems safer to have
#define REDUNDANT (TERRITORY_REDUNDANT | STRATEGICALLY_REDUNDANT)
/Gunnar