クラス osl::record::opening::WeightedBook

StateとWMoveを保持する. [詳細]

#include <openingBook.h>

すべてのメンバ一覧

Public 型

typedef vector< WMoveWMoveContainer

Public メソッド

 WeightedBook (const char *filename)
 ~WeightedBook ()
WMoveContainer getMoves (int stateIndex, const bool zero_include=true)
 Return moves from the state of the stateIndex.
int getWhiteWinCount (int stateIndex)
int getBlackWinCount (int stateIndex)
osl::record::CompactBoard getCompactBoard (int stateIndex)
SimpleState getBoard (int stateIndex)
int getTotalState () const
int getStartState () const
void validate ()
std::vector< int > getParents (const int stateIndex)
 As traversing the 'tree', return all state indices of the state's parents.
int getStateIndex (const SimpleState &state, const bool visit_zero=true, const Player player=BLACK)
 As traversing the 'tree', find a state index of the state.
int getStateIndex (const vector< Move > &moves)
 As traversing the 'tree', find a state index of the state reached by applying the moves from the initial state.

Private メソッド

void seek (int offset)

Private 変数

int nStates
int nMoves
int startState
std::ifstream ifs

Static Private 変数

static const int HEADER_SIZE = 16
static const int STATE_SIZE = 16
static const int MOVE_SIZE = 12
static const int BOARD_SIZE = 41 * 4

説明

StateとWMoveを保持する.

Stateはvector<WMove>を保持する WMoveはMoveとそのMoveを採用した時のStateのindexと手番から見た Moveの重み(0-1000)をもつ ファイル形式 version番号 - 4byte state数 - 4byte move数 - 4byte 開始state index - 4byte State - 16byte * state数 + WMoveの開始index + WMoveの数 + 先手の勝数 + 後手の勝数 WMove - 12byte * WMove数 + Move (4byte) + Stateのindex + Weight CompactBoard形式の盤面 - 164byte * state数

openingBook.h194 行で定義されています。


型定義

openingBook.h201 行で定義されています。


コンストラクタとデストラクタ

osl::record::opening::WeightedBook::WeightedBook ( const char *  filename  ) 

openingBook.cc100 行で定義されています。

参照先 ifs, nMoves, nStates, osl::record::readInt(), と startState.

osl::record::opening::WeightedBook::~WeightedBook (  ) 

openingBook.cc120 行で定義されています。


関数

int osl::record::opening::WeightedBook::getBlackWinCount ( int  stateIndex  ) 

openingBook.cc178 行で定義されています。

参照先 HEADER_SIZE, ifs, osl::record::readInt(), seek(), と STATE_SIZE.

参照元 show_moves(), と showInfoOfState().

osl::SimpleState osl::record::opening::WeightedBook::getBoard ( int  stateIndex  ) 

openingBook.cc161 行で定義されています。

参照先 getCompactBoard(), と osl::record::CompactBoard::getState().

参照元 doMain(), dump(), main(), showInfoOfState(), store(), と validate().

osl::record::CompactBoard osl::record::opening::WeightedBook::getCompactBoard ( int  stateIndex  ) 

openingBook.cc151 行で定義されています。

参照先 BOARD_SIZE, HEADER_SIZE, ifs, MOVE_SIZE, nMoves, nStates, seek(), と STATE_SIZE.

参照元 getBoard(), と getStateIndex().

osl::record::opening::WeightedBook::WMoveContainer osl::record::opening::WeightedBook::getMoves ( int  stateIndex,
const bool  zero_include = true 
)

Return moves from the state of the stateIndex.

If the zero_include is true, all of the moves are returned. Otherwise, the moves that have some weights (i.e. non-zero value) are returned.

openingBook.cc131 行で定義されています。

参照先 HEADER_SIZE, ifs, MOVE_SIZE, moves, nStates, osl::record::readInt(), seek(), と STATE_SIZE.

参照元 doMain(), getParents(), getStateIndex(), increment(), is_same_node(), main(), make_history(), osl::game_playing::DeterminateWeightTracer::selectMove(), osl::game_playing::WeightTracer::selectMove(), show_moves(), showInfoOfState(), store(), osl::game_playing::WeightTracer::update(), と validate().

std::vector< int > osl::record::opening::WeightedBook::getParents ( const int  stateIndex  ) 

As traversing the 'tree', return all state indices of the state's parents.

戻り値:
state indexes; empty if there is none.

openingBook.cc302 行で定義されています。

参照先 getMoves(), getStartState(), osl::record::opening::WMove::getStateIndex(), getTotalState(), と moves.

参照元 doMain().

int osl::record::opening::WeightedBook::getStartState (  )  const [inline]

openingBook.h216 行で定義されています。

参照先 startState.

参照元 doMain(), getParents(), getStateIndex(), increment(), main(), make_history(), と store().

int osl::record::opening::WeightedBook::getStateIndex ( const vector< Move > &  moves  ) 

As traversing the 'tree', find a state index of the state reached by applying the moves from the initial state.

Note that zero-weighted moves are visited.

引数:
moves to apply
戻り値:
state index; if it is not found, return -1.

openingBook.cc281 行で定義されています。

参照先 getMoves(), と getStartState().

int osl::record::opening::WeightedBook::getStateIndex ( const SimpleState &  state,
const bool  visit_zero = true,
const Player  player = BLACK 
)

As traversing the 'tree', find a state index of the state.

If the visit_zero is true zero-weighted moves are visited (in this case, player is ignored). Otherwise, the palyer's zero-weighted moves are not visited.

引数:
state to find
visit_zero 
player 
戻り値:
a state index of the state; if it is not found, return -1.

openingBook.cc226 行で定義されています。

参照先 getCompactBoard(), getMoves(), getStartState(), osl::record::opening::WMove::getStateIndex(), getTotalState(), osl::record::CompactBoard::getTurn(), と moves.

参照元 doMain().

int osl::record::opening::WeightedBook::getTotalState (  )  const [inline]

openingBook.h215 行で定義されています。

参照先 nStates.

参照元 doMain(), getParents(), getStateIndex(), main(), と store().

int osl::record::opening::WeightedBook::getWhiteWinCount ( int  stateIndex  ) 

openingBook.cc168 行で定義されています。

参照先 HEADER_SIZE, ifs, osl::record::readInt(), seek(), と STATE_SIZE.

参照元 show_moves(), と showInfoOfState().

void osl::record::opening::WeightedBook::seek ( int  offset  )  [private]

openingBook.cc125 行で定義されています。

参照先 ifs.

参照元 getBlackWinCount(), getCompactBoard(), getMoves(), と getWhiteWinCount().

void osl::record::opening::WeightedBook::validate (  ) 

変数

const int osl::record::opening::WeightedBook::BOARD_SIZE = 41 * 4 [static, private]

openingBook.h252 行で定義されています。

参照元 getCompactBoard().

const int osl::record::opening::WeightedBook::HEADER_SIZE = 16 [static, private]

openingBook.h249 行で定義されています。

参照元 getBlackWinCount(), getCompactBoard(), getMoves(), と getWhiteWinCount().

std::ifstream osl::record::opening::WeightedBook::ifs [private]

openingBook.h199 行で定義されています。

参照元 getBlackWinCount(), getCompactBoard(), getMoves(), getWhiteWinCount(), seek(), と WeightedBook().

const int osl::record::opening::WeightedBook::MOVE_SIZE = 12 [static, private]

openingBook.h251 行で定義されています。

参照元 getCompactBoard(), と getMoves().

openingBook.h197 行で定義されています。

参照元 getCompactBoard(), と WeightedBook().

openingBook.h196 行で定義されています。

参照元 getCompactBoard(), getMoves(), getTotalState(), validate(), と WeightedBook().

openingBook.h198 行で定義されています。

参照元 getStartState(), validate(), と WeightedBook().

const int osl::record::opening::WeightedBook::STATE_SIZE = 16 [static, private]

openingBook.h250 行で定義されています。

参照元 getBlackWinCount(), getCompactBoard(), getMoves(), と getWhiteWinCount().


このクラスの説明は次のファイルから生成されました:
 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 フレンド マクロ定義
Sun May 16 09:58:48 2010に生成されました。  doxygen 1.6.3