走棋阶段将深度调整为 10
This commit is contained in:
parent
115a8734d9
commit
bfa8f6d16e
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue