Author: Andrew Platt
Date: 16:43:55 09/18/04
Go up one level in this thread
On September 18, 2004 at 15:45:57, Sune Fischer wrote:
>On September 18, 2004 at 15:22:35, Uri Blass wrote:
>
>>I do not wait with the pv copying and it is one of the things that I may change
>>in the future but I do not understand why waiting is a problem.
>
>Waiting is not "a problem", it just means that you can't reset the length of the
>PV when you enter a new node. You would be deleting information that has not yet
>been copied up the tree.
Perhaps your logic works differently but that's not the case in a standard AB
implementation. If your logic looks like this:
Score = -AlphaBeta (..., Ply + 1);
then you are always starting a new ply and you aren't losing any information. In
fact, if you don't do this you have a problem because you have information
relating to a *previous* move in the PV. Resetting the PV at this ply won't
cause the information already backed up from the previously tried moves.
My routine looks something like this
AlphaBeta ()
{
// Try to get a cutoff with a null move
if (TryNullMove ())
{
return Score;
}
// Try to get a hash table cutoff
if (HashTableCutoff ())
{
return Score;
}
// We're going to search moves. Reset this ply in the triangular array
PV [Ply] [Ply] = Ply;
while (GetMove ())
{
MakeMove ();
Score = -AlphaBeta (..., Ply + 1);
UnmakeMove ();
if (Score > Alpha)
{
if (Score >= Beta)
{
return Score;
}
// Update the Principal variation now we have a better move
UpdatePV ();
}
}
return Score;
}
Make sure you reset the PV if you cutoff, etc. too.
Andy.
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.