gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Good news


From: Tanguy URVOY
Subject: Re: [gnugo-devel] Good news
Date: Sun, 02 Feb 2003 12:14:21 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01

Hello,

Arend Bayer wrote:
The biggest remaining challenge I see now is keeping track of what
exactly changed on the board between two matchpat() calls (and doing
this without making the code too ugly). Maybe s.th. like replacing
all trymove()'s in owl.c with a dfa_trymove().

Yes this is the point.

The actual matcher is already brutal:
the function dfa_prepare_for_match(int color)
scans the whole board to setup the color at
each call of matchpat().
I am not sure that the cost of detecting changes
during this operation would be so big.

dfa_trymove() is a better solution
to maintain the board difference
but it may be more complex to handle.

Maybe we should first implement a pattern matcher
with the following interface :

void
matchpat(matchpat_callback_fn_ptr callback, ... , int last_change);

An check it with a
brutal detection of last_change.



We need the following function:

/* Compute the row of pos2 if scanned from pos1 with spiral path. */
static int spiral_row(int pos1, int pos2);


I think I already wrote it a year before.
It may kreep somewhere in Gnugo dead code...




We also need a dfa_cache_entry type
(LL is the number of transformations)


typedef struct dfa_cache_entry
{
   int last_raw[LL];
   int patno[LL];
   int pat_list[LL][DFA_MAX_MATCHED];
} dfa_cache_entry_t;


An a big array of dfa cache entries pointers.

dfa_cache_entry_t *dfa_cache[COLOR][DFA_MAX_BOARD * DFA_MAX_BOARD * 16];

With a cache entry allocated for each 'ON BOARD' position.



I have to go back to my phd writting.
I will have no time to work on it
this week. If someone is interested ...

Tanguy


--
---------------------------------------
Tanguy Urvoy http://www.irisa.fr/galion
---------------------------------------







reply via email to

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