Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Node counting. Do I update at A, B, C, D or E ?

Author: Matthias Gemuh

Date: 12:24:21 05/13/03

Go up one level in this thread


On May 13, 2003 at 13:15:30, Mikael Bäckman wrote:

>Hi,
>
>I'm trying to reduce qsearch tree size in my engine. I've had many odd looking
>results (from 10% to 99%), some of which I've tracked down to bugs in
>nodecounting (maybe!).
>
>Where is the proper place to update the node counts? A, B, C, D or E?
>
>In the below code, A and B is of course replaced with "nodes++" and C, D, E with
>"qnodes++";
>
>And of course the code is incorrect, only the placement of A, B, C, D and E
>matters here.
>
>
>int alphaBeta(int alpha, int beta, int depth)
>{
>	/* A */
>	if (depth < 0) {
>		score = qsearch();
>		return score;
>	}
>	/* B */
>	nMoves = genAllMoves();
>	while (i < nMoves) {
>		makeMove(move[i]);
>		score = alphaBeta(-beta, -alpha, depth - 1);
>		unMakeMove(move[i++]);
>	}
>}
>
>
>int qsearch(int alpha, int beta)
>{
>	/* C */
>	score = evaluate();
>	if (score > alpha) {
>		if (score > beta) return score;
>		alpha = score;
>	}
>	/* D */
>	nMoves = genAllCaptureMoves();
>	while (i < nMoves) {
>		makeMove(move[i]);
>		/* E */
>		score = qsearch(-beta, -alpha);
>		unMakeMove(move[i++]);
>	}
>}
>
>
>
>Thanks,
>
>Mikael



I do A+C and get C/(A+C) = 50% (approx.), but my engine is very weak.

/Matthias.






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.