hash: 增加 CLEAR_HASH_MAP 宏用于走子之前不清空哈希表 (暂不启用)
This commit is contained in:
parent
1e3365ec03
commit
3b797bcee7
|
@ -70,7 +70,9 @@ void AiThread::setAi(const NineChess &chess)
|
|||
|
||||
#ifdef HASH_MAP_ENABLE
|
||||
// 新下一盘前清除哈希表 (注意可能同时存在每步之前清除)
|
||||
#ifdef CLEAR_HASH_MAP
|
||||
ai_ab.clearHashMap();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mutex.unlock();
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#define IDS_SUPPORT
|
||||
|
||||
#define HASH_MAP_ENABLE
|
||||
//#define CLEAR_HASH_MAP
|
||||
|
||||
#define MEMORY_POOL
|
||||
|
||||
|
|
|
@ -669,7 +669,9 @@ int NineChessAi_ab::alphaBetaPruning(int depth)
|
|||
// 深化迭代
|
||||
for (int i = 2; i < d; i += 2) {
|
||||
#ifdef HASH_MAP_ENABLE
|
||||
#ifdef CLEAR_HASH_MAP
|
||||
clearHashMap(); // 每次走子前清空哈希表
|
||||
#endif
|
||||
#endif
|
||||
alphaBetaPruning(i, -INF_VALUE, INF_VALUE, rootNode);
|
||||
}
|
||||
|
@ -678,7 +680,9 @@ int NineChessAi_ab::alphaBetaPruning(int depth)
|
|||
#endif /* IDS_SUPPORT */
|
||||
|
||||
#ifdef HASH_MAP_ENABLE
|
||||
#ifdef CLEAR_HASH_MAP
|
||||
clearHashMap(); // 每次走子前清空哈希表
|
||||
#endif
|
||||
#endif
|
||||
|
||||
value = alphaBetaPruning(d, -INF_VALUE /* alpha */, INF_VALUE /* beta */, rootNode);
|
||||
|
|
Loading…
Reference in New Issue