临时调整 config.h 以后续调试 Hash 用
This commit is contained in:
parent
88fec0b8bf
commit
03294e1557
|
@ -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
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue