Commands for building/inspecting virtual connections. More...
#include <DfpnCommands.hpp>
Public Member Functions | |
DfpnCommands (Game &game, HexEnvironment &env, DfpnSolver &solver, boost::scoped_ptr< DfpnHashTable > &hashTable, boost::scoped_ptr< DfpnDB > &db, DfpnStates &positions) | |
void | Register (GtpEngine &engine) |
Private Member Functions | |
void | Register (GtpEngine &engine, const std::string &command, GtpCallback< DfpnCommands >::Method method) |
void | CmdParam (HtpCommand &cmd) |
void | CmdParamSolverDB (HtpCommand &cmd) |
void | CmdSolveState (HtpCommand &cmd) |
Solves the current state with dfpn using the current hashtable. | |
void | CmdFindWinning (HtpCommand &cmd) |
Finds all winning moves in the current state with dfpn, using the current hashtable. | |
void | CmdClearTT (HtpCommand &cmd) |
Clears the current dfpn hashtable. | |
void | CmdGetState (HtpCommand &cmd) |
Displays information about the current state from the hashtable. | |
void | CmdGetBounds (HtpCommand &cmd) |
Displays bounds of every empty cell in current state. | |
void | CmdGetWork (HtpCommand &cmd) |
Displays work of every empty cell in current state. | |
void | CmdGetPV (HtpCommand &cmd) |
Displays PV from current position. | |
void | CmdOpenDB (HtpCommand &cmd) |
Opens a database. | |
void | CmdCloseDB (HtpCommand &cmd) |
Closes an open database. | |
void | CmdDBStat (HtpCommand &cmd) |
Prints database statistics. | |
void | CmdEvaluationInfo (HtpCommand &cmd) |
Private Attributes | |
Game & | m_game |
HexEnvironment & | m_env |
DfpnSolver & | m_solver |
boost::scoped_ptr < DfpnHashTable > & | m_tt |
boost::scoped_ptr< DfpnDB > & | m_db |
DfpnStates & | m_positions |
Commands for building/inspecting virtual connections.
Definition at line 21 of file DfpnCommands.hpp.
DfpnCommands::DfpnCommands | ( | Game & | game, | |
HexEnvironment & | env, | |||
DfpnSolver & | solver, | |||
boost::scoped_ptr< DfpnHashTable > & | hashTable, | |||
boost::scoped_ptr< DfpnDB > & | db, | |||
DfpnStates & | positions | |||
) |
Definition at line 14 of file DfpnCommands.cpp.
void DfpnCommands::CmdClearTT | ( | HtpCommand & | cmd | ) | [private] |
Clears the current dfpn hashtable.
Definition at line 191 of file DfpnCommands.cpp.
References m_tt, and UNUSED().
Referenced by Register().
void DfpnCommands::CmdCloseDB | ( | HtpCommand & | cmd | ) | [private] |
Closes an open database.
Definition at line 279 of file DfpnCommands.cpp.
References m_db.
Referenced by Register().
void DfpnCommands::CmdDBStat | ( | HtpCommand & | cmd | ) | [private] |
Prints database statistics.
Definition at line 288 of file DfpnCommands.cpp.
References m_db.
Referenced by Register().
void DfpnCommands::CmdEvaluationInfo | ( | HtpCommand & | cmd | ) | [private] |
Definition at line 296 of file DfpnCommands.cpp.
References DfpnSolver::EvaluationInfo(), and m_solver.
Referenced by Register().
void DfpnCommands::CmdFindWinning | ( | HtpCommand & | cmd | ) | [private] |
Finds all winning moves in the current state with dfpn, using the current hashtable.
Definition at line 161 of file DfpnCommands.cpp.
References Game::Board(), HtpUtil::ColorArg(), HexBoard::ComputeAll(), StoneBoard::GetEmpty(), HexBoard::GetPosition(), EndgameUtils::IsDeterminedState(), LogInfo(), m_env, m_game, m_positions, m_solver, EndgameUtils::MovesToConsider(), benzene_bitset< _Nb >::set(), DfpnSolver::StartSearch(), HexEnvironment::SyncBoard(), and HexPointUtil::ToString().
Referenced by Register().
void DfpnCommands::CmdGetBounds | ( | HtpCommand & | cmd | ) | [private] |
Displays bounds of every empty cell in current state.
Bounds are obtained from the current hashtable.
Definition at line 211 of file DfpnCommands.cpp.
References Game::Board(), HtpUtil::ColorArg(), DfpnBounds::delta, SolverDB< HASH, DB, DATA >::Get(), DfpnBounds::IsLosing(), DfpnBounds::IsWinning(), DfpnData::m_bounds, m_game, m_positions, and DfpnBounds::phi.
Referenced by Register().
void DfpnCommands::CmdGetPV | ( | HtpCommand & | cmd | ) | [private] |
Displays PV from current position.
Definition at line 252 of file DfpnCommands.cpp.
References Game::Board(), HtpUtil::ColorArg(), SolverDBUtil::GetVariation(), m_game, m_positions, and HexPointUtil::ToString().
Referenced by Register().
void DfpnCommands::CmdGetState | ( | HtpCommand & | cmd | ) | [private] |
Displays information about the current state from the hashtable.
Definition at line 199 of file DfpnCommands.cpp.
References Game::Board(), HtpUtil::ColorArg(), SolverDB< HASH, DB, DATA >::Get(), m_game, and m_positions.
Referenced by Register().
void DfpnCommands::CmdGetWork | ( | HtpCommand & | cmd | ) | [private] |
Displays work of every empty cell in current state.
Bounds are obtained from the current hashtable.
Definition at line 236 of file DfpnCommands.cpp.
References Game::Board(), HtpUtil::ColorArg(), SolverDB< HASH, DB, DATA >::Get(), m_game, m_positions, and DfpnData::m_work.
Referenced by Register().
void DfpnCommands::CmdOpenDB | ( | HtpCommand & | cmd | ) | [private] |
Opens a database.
Usage: "db-open [filename]"
Definition at line 265 of file DfpnCommands.cpp.
References m_db, and BenzeneException::what().
Referenced by Register().
void DfpnCommands::CmdParam | ( | HtpCommand & | cmd | ) | [private] |
Definition at line 83 of file DfpnCommands.cpp.
References m_solver, m_tt, DfpnSolver::SetTimelimit(), DfpnSolver::SetUseGuiFx(), DfpnSolver::SetWideningBase(), DfpnSolver::SetWideningFactor(), DfpnSolver::Timelimit(), DfpnSolver::UseGuiFx(), DfpnSolver::WideningBase(), and DfpnSolver::WideningFactor().
Referenced by Register().
void DfpnCommands::CmdParamSolverDB | ( | HtpCommand & | cmd | ) | [private] |
Definition at line 53 of file DfpnCommands.cpp.
References SolverDBParameters::m_maxStones, m_positions, SolverDBParameters::m_transStones, SolverDBParameters::m_useFlippedStates, SolverDBParameters::m_useProofTranspositions, and SolverDB< HASH, DB, DATA >::Parameters().
Referenced by Register().
void DfpnCommands::CmdSolveState | ( | HtpCommand & | cmd | ) | [private] |
Solves the current state with dfpn using the current hashtable.
Definition at line 138 of file DfpnCommands.cpp.
References Game::Board(), HtpUtil::ColorArg(), m_env, m_game, m_positions, m_solver, DfpnBounds::MAX_WORK, DfpnSolver::StartSearch(), HexEnvironment::SyncBoard(), and StoneBoard::WhoseTurn().
Referenced by Register().
void DfpnCommands::Register | ( | GtpEngine & | engine, | |
const std::string & | command, | |||
GtpCallback< DfpnCommands >::Method | method | |||
) | [private] |
Definition at line 45 of file DfpnCommands.cpp.
void DfpnCommands::Register | ( | GtpEngine & | engine | ) |
Definition at line 28 of file DfpnCommands.cpp.
References CmdClearTT(), CmdCloseDB(), CmdDBStat(), CmdEvaluationInfo(), CmdFindWinning(), CmdGetBounds(), CmdGetPV(), CmdGetState(), CmdGetWork(), CmdOpenDB(), CmdParam(), CmdParamSolverDB(), and CmdSolveState().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
boost::scoped_ptr<DfpnDB>& DfpnCommands::m_db [private] |
Definition at line 40 of file DfpnCommands.hpp.
Referenced by CmdCloseDB(), CmdDBStat(), and CmdOpenDB().
HexEnvironment& DfpnCommands::m_env [private] |
Definition at line 34 of file DfpnCommands.hpp.
Referenced by CmdFindWinning(), and CmdSolveState().
Game& DfpnCommands::m_game [private] |
Definition at line 32 of file DfpnCommands.hpp.
Referenced by CmdFindWinning(), CmdGetBounds(), CmdGetPV(), CmdGetState(), CmdGetWork(), and CmdSolveState().
DfpnStates& DfpnCommands::m_positions [private] |
Definition at line 42 of file DfpnCommands.hpp.
Referenced by CmdFindWinning(), CmdGetBounds(), CmdGetPV(), CmdGetState(), CmdGetWork(), CmdParamSolverDB(), and CmdSolveState().
DfpnSolver& DfpnCommands::m_solver [private] |
Definition at line 36 of file DfpnCommands.hpp.
Referenced by CmdEvaluationInfo(), CmdFindWinning(), CmdParam(), and CmdSolveState().
boost::scoped_ptr<DfpnHashTable>& DfpnCommands::m_tt [private] |
Definition at line 38 of file DfpnCommands.hpp.
Referenced by CmdClearTT(), and CmdParam().