diff --git a/gamewindow.ui b/gamewindow.ui
index 48d19d09..cdd18bfa 100644
--- a/gamewindow.ui
+++ b/gamewindow.ui
@@ -319,6 +319,7 @@
算法(&A)
+
@@ -1235,6 +1236,17 @@
迭代加深(&I)
+
+
+ true
+
+
+ true
+
+
+ 深度延伸(&D)
+
+
diff --git a/include/config.h b/include/config.h
index 72403f51..382fd48d 100644
--- a/include/config.h
+++ b/include/config.h
@@ -78,12 +78,6 @@
#define SORT_MOVE_WITH_HUMAN_KNOWLEDGES
-//#define DEAL_WITH_HORIZON_EFFECT
-
-#ifdef DEAL_WITH_HORIZON_EFFECT
-#define HORIZON_EFFECT_ONLY_ONE_MOVE
-#endif
-
//#define IDS_WINDOW
//#define IDS_DEBUG
//#define IDS_ADD_VALUE
diff --git a/src/ai/search.cpp b/src/ai/search.cpp
index d6a24f24..4ff1bee8 100644
--- a/src/ai/search.cpp
+++ b/src/ai/search.cpp
@@ -863,17 +863,11 @@ value_t AIAlgorithm::search(depth_t depth, value_t alpha, value_t beta, Node *no
doMove(node->children[i]->move);
-#ifdef DEAL_WITH_HORIZON_EFFECT
- if (false
-#ifdef HORIZON_EFFECT_ONLY_ONE_MOVE
- || nchild == 1
-#endif // HORIZON_EFFECT_ONLY_ONE_MOVE
- ) {
+ if (gameOptions.getDepthExtension() == true && nchild == 1) {
epsilon = 1;
} else {
epsilon = 0;
}
-#endif // DEAL_WITH_HORIZON_EFFECT
#ifdef DEEPER_IF_ONLY_ONE_LEGAL_MOVE
if (node->childrenSize == 1) {
diff --git a/src/game/option.cpp b/src/game/option.cpp
index 7310523f..a8c8a559 100644
--- a/src/game/option.cpp
+++ b/src/game/option.cpp
@@ -88,3 +88,15 @@ bool Options::getIDSEnabled()
{
return IDSEnabled;
}
+
+// DepthExtension
+
+void Options::setDepthExtension(bool enabled)
+{
+ depthExtension = enabled;
+}
+
+bool Options::getDepthExtension()
+{
+ return depthExtension;
+}
diff --git a/src/game/option.h b/src/game/option.h
index 71ef695f..78351974 100644
--- a/src/game/option.h
+++ b/src/game/option.h
@@ -43,6 +43,10 @@ public:
void setIDSEnabled(bool enabled);
bool getIDSEnabled();
+ // DepthExtension
+ void setDepthExtension(bool enabled);
+ bool getDepthExtension();
+
protected:
private:
@@ -67,6 +71,9 @@ private:
// Alpha-Beta 搜索时是否迭代加深
bool IDSEnabled { false };
+
+ // DepthExtension
+ bool depthExtension {true};
};
extern Options gameOptions;
diff --git a/src/ui/qt/gamecontroller.cpp b/src/ui/qt/gamecontroller.cpp
index c9ecedf6..30c7de80 100644
--- a/src/ui/qt/gamecontroller.cpp
+++ b/src/ui/qt/gamecontroller.cpp
@@ -437,6 +437,12 @@ void GameController::setIDS(bool enabled)
gameOptions.setIDSEnabled(enabled);
}
+// DepthExtension
+void GameController::setDepthExtension(bool enabled)
+{
+ gameOptions.setDepthExtension(enabled);
+}
+
// 上下翻转
void GameController::flip()
{
diff --git a/src/ui/qt/gamecontroller.h b/src/ui/qt/gamecontroller.h
index c4220eb3..40ea68f6 100644
--- a/src/ui/qt/gamecontroller.h
+++ b/src/ui/qt/gamecontroller.h
@@ -180,6 +180,9 @@ public slots:
// Alpha-Beta 搜索时是否迭代加深
void setIDS(bool enabled);
+ // DepthExtension
+ void setDepthExtension(bool enabled);
+
// 上下翻转
void flip();
diff --git a/src/ui/qt/gamewindow.cpp b/src/ui/qt/gamewindow.cpp
index d8b65dff..55597713 100644
--- a/src/ui/qt/gamewindow.cpp
+++ b/src/ui/qt/gamewindow.cpp
@@ -245,6 +245,10 @@ void MillGameWindow::initialize()
connect(ui.actionIDS_I, SIGNAL(toggled(bool)),
gameController, SLOT(setIDS(bool)));
+ // DepthExtension
+ connect(ui.actionDepthExtension_D, SIGNAL(toggled(bool)),
+ gameController, SLOT(setDepthExtension(bool)));
+
// 视图上下翻转
connect(ui.actionFlip_F, &QAction::triggered,
gameController, &GameController::flip);