重新启用随机排序
This commit is contained in:
parent
368a494426
commit
115a8734d9
|
@ -71,9 +71,13 @@ 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() << "Computer:" << str << "\n";
|
||||
qDebug() << "Depth:" << aiDepth << " Computer:" << str << "\n";
|
||||
if (strcmp(str, "error!"))
|
||||
emit command(str);
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -127,7 +127,7 @@ void NineChessAi_ab::buildChildren(Node *node)
|
|||
void NineChessAi_ab::sortChildren(Node *node)
|
||||
{
|
||||
// 这个函数对效率的影响很大,排序好的话,剪枝较早,节省时间,但不能在此函数耗费太多时间
|
||||
|
||||
#define AB_RANDOM_SORT_CHILDREN
|
||||
#ifdef AB_RANDOM_SORT_CHILDREN
|
||||
// 这里我用一个随机排序,使AI不至于每次走招相同
|
||||
srand((unsigned)time(0));
|
||||
|
|
Loading…
Reference in New Issue