StateとWMoveを保持する. [詳細]
#include <openingBook.h>
Public 型 | |
typedef vector< WMove > | WMoveContainer |
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.h の 194 行で定義されています。
typedef vector<WMove> osl::record::opening::WeightedBook::WMoveContainer |
openingBook.h の 201 行で定義されています。
osl::record::opening::WeightedBook::WeightedBook | ( | const char * | filename | ) |
openingBook.cc の 100 行で定義されています。
参照先 ifs, nMoves, nStates, osl::record::readInt(), と startState.
osl::record::opening::WeightedBook::~WeightedBook | ( | ) |
openingBook.cc の 120 行で定義されています。
int osl::record::opening::WeightedBook::getBlackWinCount | ( | int | stateIndex | ) |
openingBook.cc の 178 行で定義されています。
参照先 HEADER_SIZE, ifs, osl::record::readInt(), seek(), と STATE_SIZE.
参照元 show_moves(), と showInfoOfState().
osl::SimpleState osl::record::opening::WeightedBook::getBoard | ( | int | stateIndex | ) |
openingBook.cc の 161 行で定義されています。
参照先 getCompactBoard(), と osl::record::CompactBoard::getState().
参照元 doMain(), dump(), main(), showInfoOfState(), store(), と validate().
osl::record::CompactBoard osl::record::opening::WeightedBook::getCompactBoard | ( | int | stateIndex | ) |
openingBook.cc の 151 行で定義されています。
参照先 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.cc の 131 行で定義されています。
参照先 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.
openingBook.cc の 302 行で定義されています。
参照先 getMoves(), getStartState(), osl::record::opening::WMove::getStateIndex(), getTotalState(), と moves.
参照元 doMain().
int osl::record::opening::WeightedBook::getStartState | ( | ) | const [inline] |
openingBook.h の 216 行で定義されています。
参照先 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 |
openingBook.cc の 281 行で定義されています。
参照先 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 |
openingBook.cc の 226 行で定義されています。
参照先 getCompactBoard(), getMoves(), getStartState(), osl::record::opening::WMove::getStateIndex(), getTotalState(), osl::record::CompactBoard::getTurn(), と moves.
参照元 doMain().
int osl::record::opening::WeightedBook::getTotalState | ( | ) | const [inline] |
openingBook.h の 215 行で定義されています。
参照先 nStates.
参照元 doMain(), getParents(), getStateIndex(), main(), と store().
int osl::record::opening::WeightedBook::getWhiteWinCount | ( | int | stateIndex | ) |
openingBook.cc の 168 行で定義されています。
参照先 HEADER_SIZE, ifs, osl::record::readInt(), seek(), と STATE_SIZE.
参照元 show_moves(), と showInfoOfState().
void osl::record::opening::WeightedBook::seek | ( | int | offset | ) | [private] |
openingBook.cc の 125 行で定義されています。
参照先 ifs.
参照元 getBlackWinCount(), getCompactBoard(), getMoves(), と getWhiteWinCount().
void osl::record::opening::WeightedBook::validate | ( | ) |
const int osl::record::opening::WeightedBook::BOARD_SIZE = 41 * 4 [static, private] |
openingBook.h の 252 行で定義されています。
参照元 getCompactBoard().
const int osl::record::opening::WeightedBook::HEADER_SIZE = 16 [static, private] |
openingBook.h の 249 行で定義されています。
参照元 getBlackWinCount(), getCompactBoard(), getMoves(), と getWhiteWinCount().
std::ifstream osl::record::opening::WeightedBook::ifs [private] |
openingBook.h の 199 行で定義されています。
参照元 getBlackWinCount(), getCompactBoard(), getMoves(), getWhiteWinCount(), seek(), と WeightedBook().
const int osl::record::opening::WeightedBook::MOVE_SIZE = 12 [static, private] |
openingBook.h の 251 行で定義されています。
参照元 getCompactBoard(), と getMoves().
int osl::record::opening::WeightedBook::nMoves [private] |
openingBook.h の 197 行で定義されています。
参照元 getCompactBoard(), と WeightedBook().
int osl::record::opening::WeightedBook::nStates [private] |
openingBook.h の 196 行で定義されています。
参照元 getCompactBoard(), getMoves(), getTotalState(), validate(), と WeightedBook().
int osl::record::opening::WeightedBook::startState [private] |
openingBook.h の 198 行で定義されています。
参照元 getStartState(), validate(), と WeightedBook().
const int osl::record::opening::WeightedBook::STATE_SIZE = 16 [static, private] |
openingBook.h の 250 行で定義されています。
参照元 getBlackWinCount(), getCompactBoard(), getMoves(), と getWhiteWinCount().