All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
osl::search::SimpleHashTable Class Reference

基本的な hash table. More...

#include <simpleHashTable.h>

Inheritance diagram for osl::search::SimpleHashTable:
Inheritance graph
[legend]
Collaboration diagram for osl::search::SimpleHashTable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SimpleHashTable (size_t capacity=100000, int minimum_record_limit=0, int verbose=0)
 ~SimpleHashTable ()
void setMinimumRecordLimit (int new_limit)
SimpleHashRecordallocate (const HashKey &key, int limit)
 表を探し,登録されてなければ新規エントリを登録する
int minimumRecordLimit () const
void setVerbose (int verbose=1)
int verboseLevel () const
bool isVerbose () const
bool isConsistent () const
int divSize () const
 lock contention を下げるために分割した大きさ
void getPV (const HashKey &, MoveVector &, size_t *quiesce_start=0) const
uint64_t memoryUse () const

Private Attributes

int minimum_limit
int verbose

Detailed Description

基本的な hash table.

とりあえず g++ (SGI STL) の hash_map を使って実装

機能:

ある程度基本的な機能を実装したら,自分で実装しなおすほうがbetter。 この hash_map では GCを実装することは困難と思われるため

find, allocate で ポインタを返すため,要素を追加しても,既存の要素の アドレスが変化しないデータ構造を用いる必要がある.

Definition at line 32 of file simpleHashTable.h.


Constructor & Destructor Documentation

osl::search::SimpleHashTable::SimpleHashTable ( size_t  capacity = 100000,
int  minimum_record_limit = 0,
int  verbose = 0 
) [explicit]
Parameters:
capacity表に保持する最大局面
minimumRecordLimitrecordUpperBound, recordLowerBound において limit がこれ未満のものは登録要求を無視する. 末端の静止探索も記録する場合はマイナスにする

Definition at line 15 of file simpleHashTable.cc.

Definition at line 28 of file simpleHashTable.cc.

References verbose.


Member Function Documentation

表を探し,登録されてなければ新規エントリを登録する

Returns:
テーブルがいっぱいだったりlimit が小さすぎると0。 そうでなければ内部で確保した場所へのポインタ (間違っても delete しないこと)
Exceptions:
TableFull

Definition at line 60 of file simpleHashTable.cc.

References osl::find().

Referenced by osl::game_playing::HistoryToTable::adjustDominance(), osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot(), osl::search::AlphaBeta2< EvalT >::findCheckmateInPV(), osl::search::AlphaBeta2< EvalT >::makeMove(), osl::search::qallocate(), qsearch(), osl::game_playing::HistoryToTable::setPV(), and osl::search::AlphaBeta2< EvalT >::setRoot().

lock contention を下げるために分割した大きさ

Reimplemented from osl::container::GeneralSimpleHashTable< SimpleHashRecord >.

Definition at line 80 of file simpleHashTable.cc.

void osl::search::SimpleHashTable::getPV ( const HashKey root,
MoveVector &  out,
size_t *  quiesce_start = 0 
) const

Definition at line 74 of file simpleHashTable.cc.

bool osl::search::SimpleHashTable::isVerbose ( ) const [inline]

Definition at line 22 of file simpleHashTable.cc.

Definition at line 53 of file simpleHashTable.cc.

Parameters:
new_limitrecordUpperBound, recordLowerBound において limit がこれ未満のものは登録要求を無視する

Definition at line 47 of file simpleHashTable.cc.

void osl::search::SimpleHashTable::setVerbose ( int  verbose = 1)

Definition at line 41 of file simpleHashTable.cc.

References verbose.


Member Data Documentation

Definition at line 35 of file simpleHashTable.h.

Definition at line 36 of file simpleHashTable.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines