mcts: 每下一步前分段随机打乱着法表

和 alpha-beta 类似。
This commit is contained in:
Calcitem 2020-03-04 23:50:42 +08:00
parent 1e73efc556
commit 9014a4d949
1 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#include "mcts.h"
#include "position.h"
#include "search.h"
#include "movegen.h"
#ifdef MCTS_AI
@ -311,6 +312,9 @@ move_t AIAlgorithm::computeMove(Game game,
{
// Will support more players later.
assert(game.position->sideToMove == PLAYER_BLACK || game.position->sideToMove == PLAYER_WHITE);
// 分段随机打乱着法表
MoveList::shuffle();
Stack<move_t, MOVE_COUNT> moves;
game.generateMoves(moves);