走棋阶段将深度调整为 10

This commit is contained in:
CalciteM 2019-06-23 19:21:11 +08:00
parent 115a8734d9
commit bfa8f6d16e
2 changed files with 8 additions and 5 deletions

View File

@ -71,13 +71,9 @@ void AiThread::run()
emit calcStarted();
mutex.unlock();
// if ((chess_.getContext()) & (NineChess::GAME_MOVING)) {
// setAi(*chess_, 12, 99);
// }
ai_ab.alphaBetaPruning(aiDepth);
const char *str = ai_ab.bestMove();
qDebug() << "Depth:" << aiDepth << " Computer:" << str << "\n";
qDebug() << "Computer:" << str << "\n";
if (strcmp(str, "error!"))
emit command(str);
#ifdef DEBUG

View File

@ -246,6 +246,13 @@ int NineChessAi_ab::evaluate(Node *node)
int NineChessAi_ab::alphaBetaPruning(int depth)
{
// 走棋阶段将深度调整为 10
if ((chessTemp.context.stage) & (NineChess::GAME_MOVING)) {
depth = 10;
}
qDebug() << "Depth:" << depth;
return alphaBetaPruning(depth, -infinity, infinity, rootNode);
}