ai: search: 解决因 IDS 导致的有时根节点所有子结点都剪枝了的问题

默认不启用, 因为自对弈时长会由44s增长到84s.
This commit is contained in:
Calcitem 2019-10-15 01:52:24 +08:00
parent 5ec79bd146
commit faab2b59aa
2 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,7 @@
#define IDS_SUPPORT
//#define CLEAR_PRUNED_FLAG_BEFORE_SEARCH
//define DEEPER_IF_ONLY_ONE_LEGAL_MOVE
#define TRANSPOSITION_TABLE_ENABLE

View File

@ -668,6 +668,12 @@ value_t AIAlgorithm::search(depth_t depth, value_t alpha, value_t beta, Node *no
assert(node->childrenSize != 0);
#ifdef CLEAR_PRUNED_FLAG_BEFORE_SEARCH
#ifdef SORT_CONSIDER_PRUNED
node->pruned = false;
#endif // SORT_CONSIDER_PRUNED
#endif // CLEAR_PRUNED_FLAG_BEFORE_SEARCH
int nchild = node->childrenSize;
for (int i = 0; i < nchild; i++) {
doMove(node->children[i]->move);