Author: Robert Hyatt
Date: 20:43:03 10/19/99
Go up one level in this thread
On October 19, 1999 at 21:09:06, Nicolas Carrasco wrote:
>Dear Guys,
>
>I am really frustated because I still can't save the games considered best move
>tree. Without doing that I can't continue because I planned to build the move
>ordering functions and I need that data.
>
>Can anyone explain me why on TSCP and FAILE they put this on the Alpha Beta
>algorim?
>while (moves_left)
>{
>if (make_move)
> {
>
> score = -AlphaBeta(-beta,-alpha,depth);
>
> if (score>alpha)
> {
> if (score>=beta)
> return score;
>
> alpha = score;
>
> for(j=ply+1;j<pv_length[ply+1];j++) ///////// This is what I don't
>understand!!!!!
> pv[ply][j]=pv[ply+1][j]; ///////// This is what I
>don't understand!!!!!
> pv_length[ply]=pv_length[ply+1]; ///////// This is what I don't
>understand!!!!!
> }
>}
>
>Reggie told me that this is called the "triangle PV theory", and he told me that
>he was going to e-mail me a message but he is very busy now and can't respond
>me.
>
>Thanks.
You need two pieces of code:
1. In Quiesce, where you call Evaluate and then decide that the score you
get back is > alpha and < beta, you do something like "alpha=value;"
add:
for (i=1;i<ply;i++) pv[ply][i]=current_move[i]; pvlen[ply]=ply-1;
now you have an array of moves (current_move[i] is the move actually played
at ply i in the _current search path_. You know exactly which moves were made
to lead to this position, and pvlen[ply] is the length of this pv.
Now, every time you back up the score (return alpha) you check to see if the
score you are returning is > original_alpha and < original_beta. If so, you
are backing up a real score. Back up the PV as well:
for (i=0;i<pvlen[ply];i++) pv[ply-1][i]=pv[ply][i];
pvlen[ply-1]=pvlen[ply];
that takes the current PV (all moves) and backs it up to the previous ply, but
_only_ when you are backing up a real (true) score and not a bound.
If that isn't clear, feel free to ask again... But the PV is handled in two
places.. in Quiesce you stuff the moves into it and in Search you back it up.
You can save 1/2 of the memory with the code I use in Crafty, but this is
easier to understand to start with...
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.