refactor: 置换表数据结构转移到 tt 模块
This commit is contained in:
parent
6360e1ff20
commit
7236e32986
|
@ -24,6 +24,7 @@ INCLUDEPATH += src/ui/qt
|
|||
SOURCES += \
|
||||
src/ai/evaluate.cpp \
|
||||
src/ai/movegen.cpp \
|
||||
src/ai/tt.cpp \
|
||||
src/game/board.cpp \
|
||||
src/game/millgame.cpp \
|
||||
src/game/rule.cpp \
|
||||
|
@ -45,6 +46,7 @@ HEADERS += \
|
|||
include/version.h.template \
|
||||
src/ai/evaluate.h \
|
||||
src/ai/movegen.h \
|
||||
src/ai/tt.h \
|
||||
src/base/HashNode.h \
|
||||
src/base/debug.h \
|
||||
src/base/hashMap.h \
|
||||
|
|
|
@ -28,15 +28,11 @@
|
|||
#include "evaluate.h"
|
||||
#include "movegen.h"
|
||||
#include "hashmap.h"
|
||||
#include "tt.h"
|
||||
#include "types.h"
|
||||
|
||||
using namespace CTSL;
|
||||
|
||||
#ifdef TRANSPOSITION_TABLE_ENABLE
|
||||
static constexpr int TRANSPOSITION_TABLE_SIZE = 0x2000000; // 8-128M:102s, 4-64M:93s 2-32M:91s 1-16M: 冲突
|
||||
HashMap<hash_t, MillGameAi_ab::HashValue> transpositionTable(TRANSPOSITION_TABLE_SIZE);
|
||||
#endif // TRANSPOSITION_TABLE_ENABLE
|
||||
|
||||
#ifdef BOOK_LEARNING
|
||||
static constexpr int bookHashsize = 0x1000000; // 16M
|
||||
HashMap<hash_t, MillGameAi_ab::HashValue> bookHashMap(bookHashsize);
|
||||
|
|
|
@ -260,9 +260,7 @@ private:
|
|||
char cmdline[64] {};
|
||||
};
|
||||
|
||||
#ifdef TRANSPOSITION_TABLE_ENABLE
|
||||
extern HashMap<hash_t, MillGameAi_ab::HashValue> transpositionTable;
|
||||
#endif /* TRANSPOSITION_TABLE_ENABLE */
|
||||
#include "tt.h"
|
||||
|
||||
#ifdef THREEFOLD_REPETITION
|
||||
extern vector<hash_t> positions;
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
#include "tt.h"
|
||||
|
||||
#ifdef TRANSPOSITION_TABLE_ENABLE
|
||||
static constexpr int TRANSPOSITION_TABLE_SIZE = 0x2000000; // 8-128M:102s, 4-64M:93s 2-32M:91s 1-16M: 冲突
|
||||
HashMap<hash_t, MillGameAi_ab::HashValue> transpositionTable(TRANSPOSITION_TABLE_SIZE);
|
||||
#endif // TRANSPOSITION_TABLE_ENABLE
|
||||
|
|
12
src/ai/tt.h
12
src/ai/tt.h
|
@ -1,5 +1,17 @@
|
|||
#ifndef TT_H
|
||||
#define TT_H
|
||||
|
||||
#include "config.h"
|
||||
#include "types.h"
|
||||
#include "millgame.h"
|
||||
#include "search.h"
|
||||
#include "hashmap.h"
|
||||
|
||||
using namespace CTSL;
|
||||
|
||||
#ifdef TRANSPOSITION_TABLE_ENABLE
|
||||
extern HashMap<hash_t, MillGameAi_ab::HashValue> transpositionTable;
|
||||
#endif /* TRANSPOSITION_TABLE_ENABLE */
|
||||
|
||||
#endif /* TT_H */
|
||||
|
||||
|
|
Loading…
Reference in New Issue