Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Commit

Permalink
- makebook2021.cppがコンパイル通らなくなっていたのを修正。
Browse files Browse the repository at this point in the history
  - Position::long_key → hash_key の影響。
  • Loading branch information
yaneurao committed Apr 24, 2022
1 parent 9273f04 commit 54d4a92
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions source/book/makebook2021.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ namespace MakeBook2021
// Nodeを新規に生成して、そのNode*を返す。
Node* create_node(Position& pos)
{
auto key = pos.long_key();
auto key = pos.hash_key();
auto r = hashkey_to_node.emplace(key, Node());
auto& node = r.first->second;
return &node;
Expand All @@ -286,7 +286,7 @@ namespace MakeBook2021
// Nodeを削除する。
void remove_node(Position& pos)
{
auto key = pos.long_key();
auto key = pos.hash_key();
hashkey_to_node.erase(key);
}

Expand All @@ -306,7 +306,7 @@ namespace MakeBook2021
// 指定された局面の情報を表示させてみる。(デバッグ用)
void dump(Position& pos)
{
auto key = pos.long_key();
auto key = pos.hash_key();

auto* node = probe(key);
if (node == nullptr)
Expand Down Expand Up @@ -334,7 +334,7 @@ namespace MakeBook2021
if (ply >= MAX_PLY)
return;

auto key = pos.long_key();
auto key = pos.hash_key();

auto* node = probe(key);
if (node == nullptr)
Expand Down Expand Up @@ -430,7 +430,7 @@ namespace MakeBook2021
// このnodeから1手進めて、次の局面のbestを広い、ponderを確定させる。
StateInfo si;
pos.set(sfen, &si, Threads.main());
HASH_KEY next_key = pos.long_key_after(pos.to_move(move));
HASH_KEY next_key = pos.hash_key_after(pos.to_move(move));
auto it = hashkey_to_node.find(next_key);
if (it != hashkey_to_node.end())
ponder = it->second.best_move;
Expand Down Expand Up @@ -824,7 +824,7 @@ namespace MakeBook2021 {
BookTools::feed_position_string(pos, root_sfen, si);

// Node is not found in Book DB , skipped.
if (pm.probe(pos.long_key()) == nullptr)
if (pm.probe(pos.hash_key()) == nullptr)
continue;

sync_cout << "[Step 1] set root , root sfen = " << root_sfen << sync_endl;
Expand Down Expand Up @@ -861,7 +861,7 @@ namespace MakeBook2021 {
auto append_to_kif_hash = [&](Position& pos) {
if (append_to_kif)
{
HASH_KEY key = pos.long_key();
HASH_KEY key = pos.hash_key();
if (kif_hash.find(key) == kif_hash.end())
kif_hash.emplace(key);
}
Expand Down Expand Up @@ -981,7 +981,7 @@ namespace MakeBook2021 {
pos.set(rootSfen, &si, Threads.main());

// RootNode
Node* node = pm.probe(pos.long_key());
Node* node = pm.probe(pos.hash_key());
if (node == nullptr)
{
// これが存在しない時は、生成しなくてはならない。
Expand All @@ -995,7 +995,7 @@ namespace MakeBook2021 {
ValueDepth search_start(Position& pos, Value alpha, Value beta)
{
// RootNode
Node* node = pm.probe(pos.long_key());
Node* node = pm.probe(pos.hash_key());

// → 存在は保証されている。
ASSERT_LV3(node != nullptr);
Expand Down Expand Up @@ -1160,7 +1160,7 @@ namespace MakeBook2021 {
size_t search_pv_index2 = search_pv.size();

// 指し手mで進めた時のhash key。
const HASH_KEY key_next = pos.long_key_after(m);
const HASH_KEY key_next = pos.hash_key_after(m);

Node* next_node = pm.probe(key_next);

Expand Down Expand Up @@ -1370,7 +1370,7 @@ namespace MakeBook2021 {
position_cmd(pos, is, states);

// すでにあるのでskip
Node* n = pm.probe(pos.long_key());
Node* n = pm.probe(pos.hash_key());

// すでに思考したあとの局面であった。
already_exists = (n != nullptr);
Expand Down

0 comments on commit 54d4a92

Please sign in to comment.