即便超时时发生 Error 也返回首个招法

This commit is contained in:
CalciteM Team 2019-07-06 01:49:25 +08:00
parent 2c0ad67e23
commit 7afa962ed9
1 changed files with 9 additions and 6 deletions

View File

@ -703,17 +703,20 @@ const char* NineChessAi_ab::bestMove()
}
}
bestMovesSize = bestMoves.size();
if (bestMovesSize == 0) {
qDebug() << "Not any child value is equal to root value";
for (auto child : rootNode->children) {
bestMoves.push_back(child);
}
}
qDebug() << "Evaluated: " << evaluatedNodeCount << "/" << nodeCount << " = "
<< evaluatedNodeCount * 100 / nodeCount << "%";
nodeCount = 0;
evaluatedNodeCount = 0;
bestMovesSize = bestMoves.size();
if (bestMovesSize == 0) {
return "error!";
}
#ifdef RANDOM_BEST_MOVE
time_t time0 = time(0);