Author: Tony Werten
Date: 00:14:17 12/16/02
Go up one level in this thread
On December 15, 2002 at 16:12:30, Russell Reagan wrote:
>Most examples of search functions that I have seen involve returning the result
>by value, usually an int. I'd like to know how to go about arriving at a result
>that contains more information that a simple int can hold. For example, if I
>have a struct like this:
>
>typedef struct search_result_tag {
> // pv stuff
> move moves[MAX_MOVES];
> int num_moves;
> // evaluation stuff
> int overall_score;
> int material;
> int mobility;
> int king_safety;
> // search stuff
> int full_width_depth;
> int qsearch_depth;
> int time;
> // etc...
>} search_result;
>
>How do I pass that around correctly in a recursive search function? The only
>example remotely similar is Bruce Moreland's "Collecting the Principal
>Variation" (http://www.seanet.com/~brucemo/topics/pv.htm).
In XiniX I use a global array, wich is adressed by current depth. (root is zero
) So when I want to know if fe kingsafety changed, I just compare
struc[current_depth] with struc[current_depth-1] ( I only need it "backwards")
Tony
>
>In general I tend to get lost in the recursiveness of trying to figure this out.
>I'm also unsure about where to update some of these values during the search.
>For example, to determine qsearch_depth I was doing something like (on paper)
>"result->qsearch_depth++;" in the search function, but then I realized that was
>nothing more than node counting, not depth counting.
>
>So not only would I like a little help about how to pass this thing around
>correctly (do you keep passing the same pointer, or do you make copies, or
>something else?), but I'd also appreciate a little guidance as to determining
>when to update different things.
>
>Thanks,
>Russell
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.