From 03294e1557283ddfaec50b4582a656c5f538182d Mon Sep 17 00:00:00 2001 From: CalciteM Team Date: Sat, 13 Jul 2019 15:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=B0=83=E6=95=B4=20config.h?= =?UTF-8?q?=20=E4=BB=A5=E5=90=8E=E7=BB=AD=E8=B0=83=E8=AF=95=20Hash=20?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NineChess/src/config.h | 12 ++++++------ NineChess/src/ninechessai_ab.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/NineChess/src/config.h b/NineChess/src/config.h index 875543f3..d631cab8 100644 --- a/NineChess/src/config.h +++ b/NineChess/src/config.h @@ -1,15 +1,15 @@ #ifndef CONFIG_H #define CONFIG_H -//#define DEBUG +#define DEBUG -#define RANDOM_MOVE +//#define RANDOM_MOVE -#define DEAL_WITH_HORIZON_EFFECT +//#define DEAL_WITH_HORIZON_EFFECT //#define RANDOM_BEST_MOVE -//#define HASH_MAP_ENABLE +#define HASH_MAP_ENABLE //#define DONOT_DELETE_TREE @@ -27,7 +27,7 @@ //#define DONOT_PLAY_SOUND #ifdef DEBUG -#define GAME_PLACING_FIXED_DEPTH 4 +#define GAME_PLACING_FIXED_DEPTH 3 #endif #ifdef DEBUG @@ -48,7 +48,7 @@ #define DRAW_SEAT_NUMBER #endif -#define IDS_SUPPORT +//#define IDS_SUPPORT #define SAVE_CHESSBOOK_WHEN_ACTION_NEW_TRIGGERED diff --git a/NineChess/src/ninechessai_ab.cpp b/NineChess/src/ninechessai_ab.cpp index 2d2d2c34..461b57fd 100644 --- a/NineChess/src/ninechessai_ab.cpp +++ b/NineChess/src/ninechessai_ab.cpp @@ -625,12 +625,12 @@ int NineChessAi_ab::alphaBetaPruning(int depth, int alpha, int beta, Node *node) #ifdef HASH_MAP_ENABLE // 检索 hashmap - uint64_t hash = chessTemp.getHash(); - node->hash = hash; + uint64_t hashCheckCode = chessTemp.getHashCheckCode(); + node->hash = hashCheckCode; hashMapMutex.lock(); - auto iter = findHash(hash); + auto iter = findHash(hashCheckCode); if (node != rootNode && iter != hashmap.end() && @@ -673,7 +673,7 @@ int NineChessAi_ab::alphaBetaPruning(int depth, int alpha, int beta, Node *node) #ifdef HASH_MAP_ENABLE // 记录确切的哈希值 - recordHash(hash, depth, node->value, hashfEXACT); + recordHash(hashCheckCode, depth, node->value, hashfEXACT); #endif return node->value; @@ -698,7 +698,7 @@ int NineChessAi_ab::alphaBetaPruning(int depth, int alpha, int beta, Node *node) #ifdef HASH_MAP_ENABLE // 记录确切的哈希值 - recordHash(hash, depth, node->value, hashfEXACT); + recordHash(hashCheckCode, depth, node->value, hashfEXACT); #endif return node->value; @@ -796,7 +796,7 @@ int NineChessAi_ab::alphaBetaPruning(int depth, int alpha, int beta, Node *node) #ifdef HASH_MAP_ENABLE if (iter == hashmap.end()) { // 添加到hashmap - recordHash(hash, depth, node->value, hashf); + recordHash(hashCheckCode, depth, node->value, hashf); } // 更新更深层数据 else {