Thursday, February 17, 2005

Time control in computer chess part 2

I finally managed to get around the problem which I was encountering in the time controlled search. The problem was that most of the time , even when the search was going deeper it was giving a bad move (due to time restrictions) than a shallow search. So what I did was modify the algorithm to something like this:



search(-INF,+INF,4,&line);

best_move=line.argmove[0];

for(i=5;i<MAX_DEPTH;i++) {

search(-INF,+INF,i,&line);

if(!timefail) {

best_move=line.armove[0];

continue;

}

else {

return best_move;

}

}



With this the computer had a shallow best move before going deeper.

No comments: