A solved state. More...
#include <DfsData.hpp>
Public Member Functions | |
DfsData () | |
Contructs state with default values. | |
DfsData (bool w, int nstates, int nmoves, HexPoint bmove) | |
Initializes state to given values. | |
TransTableStateConcept | |
bool | Initialized () const |
Returns true if this state is not the same as that built by the default constructor. | |
bool | ReplaceWith (const DfsData &other) const |
If true, then this will give up its TT slot to other. | |
PositionDBStateConcept. | |
int | PackedSize () const |
byte * | Pack () const |
void | Unpack (const byte *t) |
void | Rotate (const ConstBoard &brd) |
void | Mirror (const ConstBoard &brd) |
Public Attributes | |
bool | m_win |
True if player to move wins. | |
int | m_flags |
Flags. | |
int | m_numStates |
Number of states in proof-tree of this result. | |
int | m_numMoves |
Number of moves losing player can delay until winning player has a winning virtual connection. | |
HexPoint | m_bestMove |
Best move in this state. |
A solved state.
Stored in a TT or DB. Matches TransTableStateConcept. Do not forget to update DFS_DB_VERSION if this class changes in a way that invalidiates old databases.
Definition at line 21 of file DfsData.hpp.
DfsData::DfsData | ( | ) | [inline] |
Contructs state with default values.
Definition at line 80 of file DfsData.hpp.
DfsData::DfsData | ( | bool | w, | |
int | nstates, | |||
int | nmoves, | |||
HexPoint | bmove | |||
) | [inline] |
Initializes state to given values.
Definition at line 89 of file DfsData.hpp.
bool DfsData::Initialized | ( | ) | const [inline] |
Returns true if this state is not the same as that built by the default constructor.
Definition at line 98 of file DfsData.hpp.
References INVALID_POINT, and m_bestMove.
void DfsData::Mirror | ( | const ConstBoard & | brd | ) |
Definition at line 73 of file DfsData.cpp.
References INVALID_POINT, and m_bestMove.
byte * DfsData::Pack | ( | ) | const |
Definition at line 24 of file DfsData.cpp.
References byte, m_bestMove, m_flags, m_numMoves, m_numStates, m_win, and MiscUtil::WordToBytes().
int DfsData::PackedSize | ( | ) | const |
Definition at line 14 of file DfsData.cpp.
References m_bestMove, m_flags, m_numMoves, m_numStates, and m_win.
bool DfsData::ReplaceWith | ( | const DfsData & | other | ) | const [inline] |
If true, then this will give up its TT slot to other.
Definition at line 103 of file DfsData.hpp.
References UNUSED().
void DfsData::Rotate | ( | const ConstBoard & | brd | ) |
Definition at line 67 of file DfsData.cpp.
References INVALID_POINT, and m_bestMove.
void DfsData::Unpack | ( | const byte * | t | ) |
Definition at line 48 of file DfsData.cpp.
References MiscUtil::BytesToWord(), m_bestMove, m_flags, m_numMoves, m_numStates, and m_win.
Best move in this state.
Very important in winning states, not so important in losing states. That is, in winning states this move *must* be a winning move, in losing states this move is "most blocking", but the definition is fuzzy.
Definition at line 41 of file DfsData.hpp.
Referenced by Initialized(), Mirror(), Pack(), PackedSize(), Rotate(), and Unpack().
int DfsData::m_flags |
Number of moves losing player can delay until winning player has a winning virtual connection.
Definition at line 34 of file DfsData.hpp.
Referenced by DfsSolver::HandleTerminalNode(), DfsSolver::OrderMoves(), Pack(), PackedSize(), DfsSolver::Solve(), DfsSolver::SolveDecomposition(), DfsSolver::SolveState(), and Unpack().
Number of states in proof-tree of this result.
Definition at line 30 of file DfsData.hpp.
Referenced by DfsSolver::HandleTerminalNode(), DfsSolver::OrderMoves(), Pack(), PackedSize(), DfsSolver::SolveState(), and Unpack().
bool DfsData::m_win |
True if player to move wins.
Definition at line 24 of file DfsData.hpp.
Referenced by DfsSolver::HandleLeafNode(), DfsSolver::HandleTerminalNode(), DfsSolver::OrderMoves(), Pack(), PackedSize(), DfsSolver::Solve(), DfsSolver::SolveDecomposition(), DfsSolver::SolveState(), DfsSolver::StoreState(), and Unpack().