A table to hold ntesukiRecord. More...
#include <ntesukiTable.h>
Classes | |
struct | HashPathEncoding |
class | Table |
Public Types | |
typedef NtesukiRecord | record_t |
typedef hash_set< PathEncoding, HashPathEncoding > | PathSet |
Public Member Functions | |
NtesukiTable (unsigned int capacity, unsigned int default_gc_size=0, bool verbose=false) | |
~NtesukiTable () | |
void | clear () |
Table::const_iterator | begin () const |
Table::const_iterator | end () const |
NtesukiRecord * | allocateRoot (const HashKey &key, const PieceStand &white_stand, signed short distance, const NumEffectState *root_state=NULL) |
テーブルをひく. More... | |
NtesukiRecord * | allocateWithMove (NtesukiRecord *record, const NtesukiMove &move) |
NtesukiRecord * | find (const HashKey &key) |
テーブルの大きさを変化させずに find する. More... | |
const NtesukiRecord * | find (const HashKey &key) const |
void | erase (const HashKey key) |
表に登録された要素を削除する. More... | |
void | collectGarbage (unsigned int gc_size) |
表を整理する. More... | |
NtesukiRecord * | findWithMove (NtesukiRecord *record, const NtesukiMove &move) |
与えられた More... | |
NtesukiRecord * | findWithMoveConst (const NtesukiRecord *record, const NtesukiMove &move) |
template<class F > | |
void | forEachRecord (F &f) |
テーブルに登録された各 record を F で処理する. More... | |
template<class F > | |
void | forEachRecordFromRoot (F &f) |
テーブルを root node から順番に調べる. More... | |
unsigned int | size () const |
テーブルに登録された record の数. More... | |
unsigned int | capacity () const |
void | lockGC () |
void | unlockGC () |
bool | isVerbose () const |
Public Attributes | |
std::vector< int > | depths |
Private Types | |
typedef hash_map< SignatureKey, NtesukiRecord::RecordList > | ntesuki_hash_map |
Private Attributes | |
boost::scoped_ptr< Table > | table |
bool | verbose |
A table to hold ntesukiRecord.
Definition at line 52 of file ntesukiTable.h.
|
private |
Definition at line 55 of file ntesukiTable.h.
typedef hash_set<PathEncoding, HashPathEncoding> osl::ntesuki::NtesukiTable::PathSet |
Definition at line 129 of file ntesukiTable.h.
Definition at line 120 of file ntesukiTable.h.
osl::ntesuki::NtesukiTable::NtesukiTable | ( | unsigned int | capacity, |
unsigned int | default_gc_size = 0 , |
||
bool | verbose = false |
||
) |
capacity | 表に保持する最大局面 |
Definition at line 578 of file ntesukiTable.cc.
osl::ntesuki::NtesukiTable::~NtesukiTable | ( | ) |
Definition at line 587 of file ntesukiTable.cc.
References depth, osl::ntesuki::NtesukiRecord::distance, and verbose.
|
inline |
テーブルをひく.
もし要素が見つからなかった場合, テーブルの大きさを増やして良いのなら, 新しい要素を allocate する.
Definition at line 160 of file ntesukiTable.h.
References table.
|
inline |
Definition at line 173 of file ntesukiTable.h.
References osl::PieceStand::add(), osl::Move::capturePtype(), osl::ntesuki::NtesukiRecord::checkNewParent(), osl::ntesuki::NtesukiRecord::distance, osl::ntesuki::NtesukiMove::getMove(), osl::Move::isDrop(), osl::ntesuki::NtesukiMove::isPass(), osl::ntesuki::NtesukiRecord::key, osl::eval::min(), osl::Move::player(), osl::Move::ptype(), osl::PTYPE_EMPTY, osl::PieceStand::sub(), table, osl::unpromote(), and osl::ntesuki::NtesukiRecord::white_stand.
|
inline |
Definition at line 146 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().
|
inline |
Definition at line 305 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::allocate().
|
inline |
Definition at line 141 of file ntesukiTable.h.
References table.
|
inline |
表を整理する.
Definition at line 225 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::allocate().
|
inline |
Definition at line 150 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().
|
inline |
表に登録された要素を削除する.
Definition at line 217 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().
|
inline |
テーブルの大きさを変化させずに find する.
Definition at line 204 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::allocate().
|
inline |
Definition at line 209 of file ntesukiTable.h.
References table.
|
inline |
与えられた
move | に格納されている手を返そうとする. なかったらテーブルから引く. |
Definition at line 234 of file ntesukiTable.h.
References osl::ntesuki::NtesukiRecord::checkNewParent(), osl::ntesuki::NtesukiMove::getMove(), osl::ntesuki::NtesukiRecord::getPieceStandSlow(), osl::ntesuki::NtesukiMove::isDrop(), osl::ntesuki::NtesukiMove::isNormal(), osl::ntesuki::NtesukiRecord::key, osl::Move::player(), osl::Move::ptype(), table, and osl::unpromote().
|
inline |
Definition at line 260 of file ntesukiTable.h.
References osl::ntesuki::NtesukiMove::getMove(), osl::ntesuki::NtesukiRecord::getPieceStandSlow(), osl::ntesuki::NtesukiMove::isDrop(), osl::ntesuki::NtesukiMove::isNormal(), osl::ntesuki::NtesukiRecord::key, osl::Move::player(), osl::Move::ptype(), table, and osl::unpromote().
|
inline |
|
inline |
bool osl::ntesuki::NtesukiTable::isVerbose | ( | ) | const |
Definition at line 626 of file ntesukiTable.cc.
References verbose.
|
inline |
Definition at line 310 of file ntesukiTable.h.
References table.
|
inline |
|
inline |
Definition at line 315 of file ntesukiTable.h.
References table.
std::vector<int> osl::ntesuki::NtesukiTable::depths |
Definition at line 131 of file ntesukiTable.h.
|
private |
Definition at line 116 of file ntesukiTable.h.
Referenced by allocateRoot(), allocateWithMove(), begin(), capacity(), clear(), collectGarbage(), end(), erase(), find(), findWithMove(), findWithMoveConst(), forEachRecord(), forEachRecordFromRoot(), lockGC(), RecordPrinter::operator()(), RecordPrinter2::operator()(), size(), and unlockGC().
|
private |
Definition at line 117 of file ntesukiTable.h.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().