23 (
to.
x() << 12 |
to.
y() << 8));
24 value = (bitFrom | bitTo |
27 static_cast<unsigned int>(m.
ptype()) << 24 |
28 static_cast<int>(m.
player()) << 28);
31 if ((
value & 0xff) == 0)
37 if (((
value >> 8) & 0xff) == 0)
44 return static_cast<Ptype>((
value >> 20) & 0xf);
47 return static_cast<Ptype>((
value >> 24) & 0xf);
55 operator int() {
return value; }
91 std::vector<OBMove>
moves(
int stateIndex);
94 void seek(
int offset);
106 std::ostream&
operator<<(std::ostream&,
const WMove& w);
107 std::istream&
operator>>(std::istream&, WMove& w);
118 struct WMoveSort :
public std::binary_function<WMove, WMove, bool>
210 const bool visit_zero =
true,
222 void seek(
int offset);
Ptype capturePtype() const
const Square from() const
bool isPieceStand() const
int y() const
将棋としてのY座標を返す.
static const Square STAND()
int x() const
将棋としてのX座標を返す.
SimpleStateよりcompactな局面の表現
static const int STATE_SIZE
static const int MOVE_SIZE
int blackWinCount(int stateIndex)
static const int HEADER_SIZE
SimpleState board(int stateIndex)
WMoveContainer moves(int stateIndex, const bool zero_include=true)
Return moves from the state of the stateIndex.
std::vector< WMove > WMoveContainer
CompactBoard compactBoard(int stateIndex)
static const int BOARD_SIZE
int stateIndex(const SimpleState &state, const bool visit_zero=true, const Player player=BLACK)
As traversing the 'tree', find a state index of the state.
int whiteWinCount(int stateIndex)
std::vector< int > parents(const int stateIndex)
As traversing the 'tree', return all state indices of the state's parents.
int stateIndex(const std::vector< Move > &moves)
As traversing the 'tree', find a state index of the state reached by applying the moves from the init...
int winCount(int stateIndex)
std::vector< OBMove > moves(int stateIndex)
int loseCount(int stateIndex)
bool operator==(const CompactBoard &, const CompactBoard &)
局面を比較する.
std::ostream & operator<<(std::ostream &os, const CompactBoard &c)
std::istream & operator>>(std::istream &os, CompactBoard &c)
bool operator()(const WMove &l, const WMove &r) const
bool operator()(const WMove &l, const WMove &r) const
WMoveのWeightとMoveによるsort.
bool operator()(const WMove &l, const WMove &r) const
void setWeight(const int w)