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) |
| テーブルをひく. | |
| NtesukiRecord * | allocateWithMove (NtesukiRecord *record, const NtesukiMove &move) |
| NtesukiRecord * | find (const HashKey &key) |
| テーブルの大きさを変化させずに find する. | |
| const NtesukiRecord * | find (const HashKey &key) const |
| void | erase (const HashKey key) |
| 表に登録された要素を削除する. | |
| void | collectGarbage (unsigned int gc_size) |
| 表を整理する. | |
| NtesukiRecord * | findWithMove (NtesukiRecord *record, const NtesukiMove &move) |
| 与えられた | |
| NtesukiRecord * | findWithMoveConst (const NtesukiRecord *record, const NtesukiMove &move) |
| template<class F > | |
| void | forEachRecord (F &f) |
| テーブルに登録された各 record を F で処理する. | |
| template<class F > | |
| void | forEachRecordFromRoot (F &f) |
| テーブルを root node から順番に調べる. | |
| unsigned int | size () const |
| テーブルに登録された record の数. | |
| 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.
typedef hash_map<SignatureKey, NtesukiRecord::RecordList> osl::ntesuki::NtesukiTable::ntesuki_hash_map [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.
Definition at line 587 of file ntesukiTable.cc.
References depth, osl::ntesuki::NtesukiRecord::distance, and verbose.
| NtesukiRecord* osl::ntesuki::NtesukiTable::allocateRoot | ( | const HashKey & | key, |
| const PieceStand & | white_stand, | ||
| signed short | distance, | ||
| const NumEffectState * | root_state = NULL |
||
| ) | [inline] |
テーブルをひく.
もし要素が見つからなかった場合, テーブルの大きさを増やして良いのなら, 新しい要素を allocate する.
Definition at line 160 of file ntesukiTable.h.
References table.
| NtesukiRecord* osl::ntesuki::NtesukiTable::allocateWithMove | ( | NtesukiRecord * | record, |
| const NtesukiMove & | move | ||
| ) | [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.
| Table::const_iterator osl::ntesuki::NtesukiTable::begin | ( | ) | const [inline] |
Definition at line 146 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().
| unsigned int osl::ntesuki::NtesukiTable::capacity | ( | ) | const [inline] |
Definition at line 305 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::allocate().
| void osl::ntesuki::NtesukiTable::clear | ( | ) | [inline] |
Definition at line 141 of file ntesukiTable.h.
References table.
| void osl::ntesuki::NtesukiTable::collectGarbage | ( | unsigned int | gc_size | ) | [inline] |
表を整理する.
Definition at line 225 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::allocate().
| Table::const_iterator osl::ntesuki::NtesukiTable::end | ( | ) | const [inline] |
Definition at line 150 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().
| void osl::ntesuki::NtesukiTable::erase | ( | const HashKey | key | ) | [inline] |
表に登録された要素を削除する.
Definition at line 217 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().
| NtesukiRecord* osl::ntesuki::NtesukiTable::find | ( | const HashKey & | key | ) | [inline] |
テーブルの大きさを変化させずに find する.
Definition at line 204 of file ntesukiTable.h.
References table.
Referenced by osl::ntesuki::NtesukiTable::Table::allocate(), osl::ntesuki::NtesukiTable::Table::erase(), and osl::ntesuki::NtesukiTable::Table::find().
| const NtesukiRecord* osl::ntesuki::NtesukiTable::find | ( | const HashKey & | key | ) | const [inline] |
Definition at line 209 of file ntesukiTable.h.
References table.
| NtesukiRecord* osl::ntesuki::NtesukiTable::findWithMove | ( | NtesukiRecord * | record, |
| const NtesukiMove & | move | ||
| ) | [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().
| NtesukiRecord* osl::ntesuki::NtesukiTable::findWithMoveConst | ( | const NtesukiRecord * | record, |
| const NtesukiMove & | move | ||
| ) | [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().
| void osl::ntesuki::NtesukiTable::forEachRecord | ( | F & | f | ) | [inline] |
| void osl::ntesuki::NtesukiTable::forEachRecordFromRoot | ( | F & | f | ) | [inline] |
| bool osl::ntesuki::NtesukiTable::isVerbose | ( | ) | const |
Definition at line 626 of file ntesukiTable.cc.
References verbose.
| void osl::ntesuki::NtesukiTable::lockGC | ( | ) | [inline] |
Definition at line 310 of file ntesukiTable.h.
References table.
| unsigned int osl::ntesuki::NtesukiTable::size | ( | ) | const [inline] |
| void osl::ntesuki::NtesukiTable::unlockGC | ( | ) | [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.
boost::scoped_ptr<Table> osl::ntesuki::NtesukiTable::table [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().
bool osl::ntesuki::NtesukiTable::verbose [private] |
Definition at line 117 of file ntesukiTable.h.
Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().
1.7.6.1