生成合法着法前先给 children 数组扩容到48

i7 CPU 上,自对战再提速 18%,耗时由 109s 缩短到 90s
This commit is contained in:
CalciteM Team 2019-07-13 11:01:25 +08:00
parent bf26f291a1
commit 30d458a76a
1 changed files with 2 additions and 0 deletions

View File

@ -149,6 +149,8 @@ void NineChessAi_ab::generateLegalMoves(Node *node)
const int MOVE_PRIORITY_TABLE_SIZE = NineChess::N_RINGS * NineChess::N_SEATS;
int pos = 0;
node->children.reserve(48);
#ifdef MOVE_PRIORITY_TABLE_SUPPORT
#ifdef RANDOM_MOVE