增加hashf 未完善

This commit is contained in:
CalciteM 2019-07-07 11:03:06 +08:00
parent 42f6b5d0d2
commit 15dd9b5891
2 changed files with 8 additions and 2 deletions

View File

@ -509,6 +509,9 @@ int NineChessAi_ab::alphaBetaPruning(int depth, int alpha, int beta, Node *node)
// 临时增加的深度,克服水平线效应用
int epsilon = 0;
// 哈希类型
enum HashType hashf = hashfALPHA;
#ifdef DEBUG_AB_TREE
node->depth = depth;
node->root = rootNode;
@ -682,7 +685,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, hashfEMPTY);
recordHash(hash, depth, node->value, hashf);
}
// 更新更深层数据
else {
@ -708,8 +711,11 @@ int NineChessAi_ab::recordHash(uint64_t hash, int16_t depth, int value, enum Has
hashMapMutex.lock();
HashValue hashValue;
hashValue.value = value;
hashValue.depth = depth;
hashValue.type = type;
if (hashmap.size() <= maxHashCount)
hashmap.insert({ hash, hashValue });

View File

@ -40,7 +40,7 @@ public:
{
int16_t value;
int16_t depth;
enum hashType type;
enum HashType type;
};
// 定义一个节点结构体