修改水平线效应判断改为根据是否剪枝来决定是否加深

This commit is contained in:
CalciteM 2019-07-07 17:08:08 +08:00
parent cc522bff7f
commit 115cc3ab3c
1 changed files with 2 additions and 5 deletions

View File

@ -480,7 +480,7 @@ int NineChessAi_ab::changeDepth(int originalDepth)
#ifdef GAME_PLACING_DYNAMIC_DEPTH
#ifdef DEAL_WITH_HORIZON_EFFECT
//int depthTable[] = { 2, 11, 11, 11, 11, 10, 9, 8, 8, 8, 7, 7, 1 };
int depthTable[] = { 2, 12, 12, 12, 12, 11, 10, 9, 9, 9, 8, 7, 1 };
int depthTable[] = { 2, 12, 12, 12, 12, 11, 10, 9, 9, 8, 8, 7, 1 };
#else
int depthTable[] = { 2, 12, 12, 12, 12, 11, 10, 9, 8, 8, 8, 7, 1 };
//int depthTable[] = { 2, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 1 };
@ -650,8 +650,6 @@ int NineChessAi_ab::alphaBetaPruning(int depth, int alpha, int beta, Node *node)
minMax = chessTemp.whosTurn() == NineChess::PLAYER1 ? -INF_VALUE : INF_VALUE;
int index = 0;
for (auto child : node->children) {
// 上下文入栈保存,以便后续撤销着法
contextStack.push(chessTemp.context);
@ -660,9 +658,8 @@ int NineChessAi_ab::alphaBetaPruning(int depth, int alpha, int beta, Node *node)
chessTemp.command(child->move);
#ifdef DEAL_WITH_HORIZON_EFFECT
index++;
// 克服“水平线效应”: 若遇到吃子,则搜索深度增加
if (index == 1 && child->move < 0) {
if (child->pruned == false && child->move < 0) {
epsilon = 1;
}
else {