Htp engine for MoHex. More...
#include <MoHexEngine.hpp>
Public Member Functions | |
MoHexEngine (int boardsize, MoHexPlayer &player) | |
~MoHexEngine () | |
double | TimeForMove (HexColor color) |
Command Callbacks | |
void | MoHexParam (HtpCommand &cmd) |
void | MoHexPolicyParam (HtpCommand &cmd) |
void | SaveTree (HtpCommand &cmd) |
Saves the search tree from the previous search to the specified file. | |
void | SaveGames (HtpCommand &cmd) |
Saves games from last search to a SGF. | |
void | Values (HtpCommand &cmd) |
void | RaveValues (HtpCommand &cmd) |
void | Bounds (HtpCommand &cmd) |
Command Callbacks | |
void | CmdLicense (HtpCommand &cmd) |
Displays usage license. | |
void | CmdGetAbsorbGroup (HtpCommand &cmd) |
Returns the set of stones this stone is part of. | |
void | CmdHandbookAdd (HtpCommand &cmd) |
Pulls moves out of the game for given color and appends them to the given handbook file. | |
void | CmdComputeInferior (HtpCommand &cmd) |
Outputs inferior cell info for current state. | |
void | CmdComputeFillin (HtpCommand &cmd) |
Computes fillin for the given board. | |
void | CmdComputeVulnerable (HtpCommand &cmd) |
Computes vulnerable cells on the current board for the given color. | |
void | CmdComputeReversible (HtpCommand &cmd) |
Computes reversible cells on the current board for the given color. | |
void | CmdComputeDominated (HtpCommand &cmd) |
Computes dominated cells on the current board for the given color. | |
void | CmdComputeDominatedOnCell (HtpCommand &cmd) |
void | CmdFindCombDecomp (HtpCommand &cmd) |
Tries to find a combinatorial decomposition of the board state. | |
void | CmdFindSplitDecomp (HtpCommand &cmd) |
Tries to find a group that crowds both opponent edges. | |
void | CmdEncodePattern (HtpCommand &cmd) |
Outputs pattern in encoded form. | |
void | CmdParamDfpn (HtpCommand &cmd) |
void | CmdEvalTwoDist (HtpCommand &cmd) |
void | CmdEvalResist (HtpCommand &cmd) |
void | CmdEvalResistDelta (HtpCommand &cmd) |
void | CmdEvalInfluence (HtpCommand &cmd) |
void | CmdMiscDebug (HtpCommand &cmd) |
Command Callbacks | |
virtual void | CmdAllLegalMoves (HtpCommand &cmd) |
Returns a list of all legal moves on current board position. | |
virtual void | CmdBoardID (HtpCommand &) |
Outputs BoardID of current position. | |
virtual void | CmdClearBoard (HtpCommand &cmd) |
Starts a new game with the same board size. | |
virtual void | CmdExec (HtpCommand &cmd) |
Executes HTP commands contained in given file. | |
virtual void | CmdFinalScore (HtpCommand &cmd) |
Returns a string with what we think the outcome of the game is. | |
virtual void | CmdGenMove (HtpCommand &cmd) |
Generates a move and handles time remaining. | |
virtual void | CmdRegGenMove (HtpCommand &cmd) |
Generates a move, but does not play it. | |
virtual void | CmdLoadSgf (HtpCommand &cmd) |
Loads game or position from given sgf. | |
virtual void | CmdName (HtpCommand &) |
Returns program's name. | |
virtual void | CmdNewGame (HtpCommand &cmd) |
Starts new game with the given board size. | |
virtual void | CmdParamGame (HtpCommand &cmd) |
Displays/changes parameters relating to the current game. | |
virtual void | CmdPlay (HtpCommand &) |
Plays a move. | |
virtual void | CmdShowboard (HtpCommand &) |
Displays the board. | |
virtual void | CmdTimeLeft (HtpCommand &) |
Displays time left for both players or given player. | |
virtual void | CmdUndo (HtpCommand &cmd) |
Undo the last move. | |
virtual void | CmdVersion (HtpCommand &) |
Returns program's version. | |
Protected Member Functions | |
virtual void | NewGame (int width, int height) |
Creates a new game on a board with given dimensions. | |
void | ParamPlayer (BenzenePlayer *player, HtpCommand &cmd) |
void | BeforeHandleCommand () |
Clears SgAbortFlag(). | |
void | BeforeWritingResponse () |
Does nothing. | |
virtual void | Play (HexColor color, HexPoint move) |
Plays a move. | |
void | SetPosition (const SgNode *node) |
Protected Attributes | |
HexEnvironment | m_pe |
Player's environment. | |
HexEnvironment | m_se |
Solver's environment. | |
DfsSolver | m_dfsSolver |
DfpnSolver | m_dfpnSolver |
boost::scoped_ptr< DfsHashTable > | m_dfsHashTable |
boost::scoped_ptr< DfpnHashTable > | m_dfpnHashTable |
boost::scoped_ptr< DfsDB > | m_dfsDB |
boost::scoped_ptr< DfpnDB > | m_dfpnDB |
SolverDBParameters | m_dfsParam |
SolverDBParameters | m_dfpnParam |
SolverDB< DfsHashTable, DfsDB, DfsData > | m_dfsPositions |
SolverDB< DfpnHashTable, DfpnDB, DfpnData > | m_dfpnPositions |
HexEnvironmentCommands | m_playerEnvCommands |
HexEnvironmentCommands | m_solverEnvCommands |
VCCommands | m_vcCommands |
DfsCommands | m_dfsSolverCommands |
DfpnCommands | m_dfpnSolverCommands |
bool | m_useParallelSolver |
StoneBoard | m_board |
Game | m_game |
Private Member Functions | |
HexPoint | GenMove (HexColor color, bool useGameClock) |
Generates a move for color. | |
HexPoint | DoSearch (HexColor color, double maxTime) |
void | RegisterCmd (const std::string &name, GtpCallback< MoHexEngine >::Method method) |
Private Attributes | |
MoHexPlayer & | m_player |
boost::scoped_ptr< Book > | m_book |
BookCheck | m_bookCheck |
BookBuilderCommands< MoHexPlayer > | m_bookCommands |
Htp engine for MoHex.
Definition at line 19 of file MoHexEngine.hpp.
MoHexEngine::MoHexEngine | ( | int | boardsize, | |
MoHexPlayer & | player | |||
) |
Definition at line 52 of file MoHexEngine.cpp.
References Bounds(), m_bookCommands, MoHexParam(), MoHexPolicyParam(), RaveValues(), BookBuilderCommands< PLAYER >::Register(), RegisterCmd(), SaveGames(), SaveTree(), and Values().
MoHexEngine::~MoHexEngine | ( | ) |
Definition at line 69 of file MoHexEngine.cpp.
void HexHtpEngine::BeforeHandleCommand | ( | ) | [protected, inherited] |
Clears SgAbortFlag().
Definition at line 107 of file HexHtpEngine.cpp.
void HexHtpEngine::BeforeWritingResponse | ( | ) | [protected, inherited] |
Does nothing.
Definition at line 112 of file HexHtpEngine.cpp.
void MoHexEngine::Bounds | ( | HtpCommand & | cmd | ) |
Definition at line 340 of file MoHexEngine.cpp.
References m_player, and MoHexPlayer::Search().
Referenced by MoHexEngine().
void HexHtpEngine::CmdAllLegalMoves | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Returns a list of all legal moves on current board position.
Definition at line 281 of file HexHtpEngine.cpp.
References Game::Board(), StoneBoard::GetLegal(), and HexHtpEngine::m_game.
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdBoardID | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Outputs BoardID of current position.
Definition at line 236 of file HexHtpEngine.cpp.
References Game::Board(), StoneBoard::GetBoardIDString(), and HexHtpEngine::m_game.
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdClearBoard | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Starts a new game with the same board size.
Definition at line 169 of file HexHtpEngine.cpp.
References StoneBoard::Height(), HexHtpEngine::m_board, HexHtpEngine::NewGame(), and StoneBoard::Width().
Referenced by HexHtpEngine::HexHtpEngine().
void BenzeneHtpEngine::CmdComputeDominated | ( | HtpCommand & | cmd | ) | [inherited] |
Computes dominated cells on the current board for the given color.
Definition at line 289 of file BenzeneHtpEngine.cpp.
References Game::Board(), GroupBuilder::Build(), HtpUtil::ColorArg(), ICEngine::FindDominated(), StoneBoard::GetEmpty(), HexBoard::GetGroups(), HexBoard::GetPatternState(), HexBoard::GetPosition(), HexEnvironment::ice, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HexEnvironment::SyncBoard(), and PatternState::Update().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdComputeDominatedOnCell | ( | HtpCommand & | cmd | ) | [inherited] |
Definition at line 303 of file BenzeneHtpEngine.cpp.
References Game::Board(), HtpUtil::ColorArg(), EMPTY, ICEngine::FindDominatedOnCell(), StoneBoard::GetColor(), HexBoard::GetPatternState(), HexEnvironment::ice, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HtpUtil::MoveArg(), HexEnvironment::SyncBoard(), and PatternState::Update().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdComputeFillin | ( | HtpCommand & | cmd | ) | [inherited] |
Computes fillin for the given board.
Color argument affects order for computing vulnerable/presimplicial pairs.
Definition at line 244 of file BenzeneHtpEngine.cpp.
References Game::Board(), GroupBuilder::Build(), HtpUtil::ColorArg(), ICEngine::ComputeFillin(), HexBoard::GetGroups(), HexBoard::GetPatternState(), HexBoard::GetPosition(), HexEnvironment::ice, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HexEnvironment::SyncBoard(), and PatternState::Update().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdComputeInferior | ( | HtpCommand & | cmd | ) | [inherited] |
Outputs inferior cell info for current state.
Usage: "compute-inferior [color]"
Definition at line 228 of file BenzeneHtpEngine.cpp.
References Game::Board(), GroupBuilder::Build(), HtpUtil::ColorArg(), ICEngine::ComputeInferiorCells(), HexBoard::GetGroups(), HexBoard::GetPatternState(), HexBoard::GetPosition(), HexEnvironment::ice, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HexEnvironment::SyncBoard(), and PatternState::Update().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdComputeReversible | ( | HtpCommand & | cmd | ) | [inherited] |
Computes reversible cells on the current board for the given color.
Definition at line 274 of file BenzeneHtpEngine.cpp.
References Game::Board(), GroupBuilder::Build(), HtpUtil::ColorArg(), ICEngine::FindReversible(), StoneBoard::GetEmpty(), HexBoard::GetGroups(), HexBoard::GetPatternState(), HexBoard::GetPosition(), HexEnvironment::ice, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HexEnvironment::SyncBoard(), and PatternState::Update().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdComputeVulnerable | ( | HtpCommand & | cmd | ) | [inherited] |
Computes vulnerable cells on the current board for the given color.
Definition at line 259 of file BenzeneHtpEngine.cpp.
References Game::Board(), GroupBuilder::Build(), HtpUtil::ColorArg(), ICEngine::FindVulnerable(), StoneBoard::GetEmpty(), HexBoard::GetGroups(), HexBoard::GetPatternState(), HexBoard::GetPosition(), HexEnvironment::ice, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HexEnvironment::SyncBoard(), and PatternState::Update().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdEncodePattern | ( | HtpCommand & | cmd | ) | [inherited] |
Outputs pattern in encoded form.
Takes a list of cells, the first cell being the center of the pattern (that is not actually in the pattern). FIXME: clean this up!
Definition at line 363 of file BenzeneHtpEngine.cpp.
References Game::Board(), HexPointUtil::DeltaX(), HexPointUtil::DeltaY(), HexAssert, LogInfo(), HexHtpEngine::m_game, Pattern::MAX_EXTENSION, HtpUtil::MoveArg(), NUM_DIRECTIONS, Pattern::NUM_SLICES, and HexPointUtil::pointToCoords().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdEvalInfluence | ( | HtpCommand & | cmd | ) | [inherited] |
Definition at line 530 of file BenzeneHtpEngine.cpp.
References BLACK, Game::Board(), HtpUtil::ColorArg(), HexBoard::ComputeAll(), VCSetUtil::ConnectedTo(), HexBoard::Cons(), HexBoard::Const(), benzene_bitset< _Nb >::count(), EAST, VC::FULL, StoneBoard::GetEmpty(), HexBoard::GetGroups(), HexBoard::GetPosition(), HexAssert, ConstBoard::Interior(), StoneBoard::IsOccupied(), HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, NORTH, SOUTH, HexEnvironment::SyncBoard(), benzene_bitset< _Nb >::test(), WEST, and WHITE.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdEvalResist | ( | HtpCommand & | cmd | ) | [inherited] |
Definition at line 484 of file BenzeneHtpEngine.cpp.
References BLACK, HexEnvironment::brd, HtpUtil::ColorArg(), HexBoard::Const(), EVAL_INFINITY, Resistance::Evaluate(), HexBoard::GetPosition(), HexEval, ConstBoard::Interior(), StoneBoard::IsOccupied(), BenzeneHtpEngine::m_pe, Resistance::Resist(), Resistance::Score(), and WHITE.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdEvalResistDelta | ( | HtpCommand & | cmd | ) | [inherited] |
Definition at line 507 of file BenzeneHtpEngine.cpp.
References Game::Board(), HtpUtil::ColorArg(), HexBoard::ComputeAll(), Resistance::Evaluate(), StoneBoard::GetEmpty(), HexBoard::GetPosition(), HexEval, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HexBoard::PlayMove(), Resistance::Score(), HexEnvironment::SyncBoard(), and HexBoard::UndoMove().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdEvalTwoDist | ( | HtpCommand & | cmd | ) | [inherited] |
Definition at line 464 of file BenzeneHtpEngine.cpp.
References TwoDistance::ADJACENT, Game::Board(), HtpUtil::ColorArg(), HexBoard::ComputeAll(), HexBoard::Const(), EVAL_INFINITY, TwoDistance::Evaluate(), HexBoard::GetPosition(), HexEval, ConstBoard::Interior(), StoneBoard::IsOccupied(), HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, TwoDistance::Score(), and HexEnvironment::SyncBoard().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void HexHtpEngine::CmdExec | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Executes HTP commands contained in given file.
Definition at line 131 of file HexHtpEngine.cpp.
References LogInfo().
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdFinalScore | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Returns a string with what we think the outcome of the game is.
Value will be "B+" for a black win, and "W+" for a white win.
Definition at line 267 of file HexHtpEngine.cpp.
References BLACK, Game::Board(), GroupBuilder::Build(), Groups::GetWinner(), HexHtpEngine::m_game, and WHITE.
Referenced by HexHtpEngine::HexHtpEngine().
void BenzeneHtpEngine::CmdFindCombDecomp | ( | HtpCommand & | cmd | ) | [inherited] |
Tries to find a combinatorial decomposition of the board state.
Outputs cells in the vc if there is a decomposition. Usage: 'find-comb-decomp [color]'
Definition at line 324 of file BenzeneHtpEngine.cpp.
References BLACK, Game::Board(), HtpUtil::ColorArg(), HexBoard::ComputeAll(), BoardUtils::FindCombinatorialDecomposition(), HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, HexBoard::SetUseDecompositions(), HexEnvironment::SyncBoard(), HexPointUtil::ToString(), and HexBoard::UseDecompositions().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdFindSplitDecomp | ( | HtpCommand & | cmd | ) | [inherited] |
Tries to find a group that crowds both opponent edges.
Outputs group that crowds both edges if one exists. Usage: 'find-split-decomp [color]'
FIXME: Dump inferior cell info as well? It's hard to see what's actually going on if it is not displayed.
Definition at line 347 of file BenzeneHtpEngine.cpp.
References BLACK, Game::Board(), HtpUtil::ColorArg(), HexBoard::ComputeAll(), BoardUtils::FindSplittingDecomposition(), HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, and HexEnvironment::SyncBoard().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void HexHtpEngine::CmdGenMove | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Generates a move and handles time remaining.
Definition at line 183 of file HexHtpEngine.cpp.
References HtpUtil::ColorArg(), HexHtpEngine::GenMove(), GameUtil::IsGameOver(), LogWarning(), HexHtpEngine::m_game, HexHtpEngine::Play(), RESIGN, Game::SetTimeRemaining(), and Game::TimeRemaining().
Referenced by HexHtpEngine::HexHtpEngine().
void BenzeneHtpEngine::CmdGetAbsorbGroup | ( | HtpCommand & | cmd | ) | [inherited] |
Returns the set of stones this stone is part of.
Definition at line 123 of file BenzeneHtpEngine.cpp.
References Game::Board(), GroupBuilder::Build(), Group::Captain(), EMPTY, StoneBoard::GetColor(), Groups::GetGroup(), HexHtpEngine::m_game, and HtpUtil::MoveArg().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdHandbookAdd | ( | HtpCommand & | cmd | ) | [inherited] |
Pulls moves out of the game for given color and appends them to the given handbook file.
Skips the first move (ie, the move from the empty board). Performs no duplicate checking. Usage: handbook-add [handbook.txt] [sgf file] [color] [max move #]
Definition at line 148 of file BenzeneHtpEngine.cpp.
References Game::Board(), HtpUtil::ColorArg(), FIRST_TO_PLAY, StoneBoard::Height(), HexAssert, HexHtpEngine::m_game, HexSgUtil::NodeHasSetupInfo(), HexSgUtil::SgColorToHexColor(), HexSgUtil::SgPointToHexPoint(), HashUtil::toString(), and StoneBoard::Width().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void BenzeneHtpEngine::CmdLicense | ( | HtpCommand & | cmd | ) | [inherited] |
Displays usage license.
Definition at line 107 of file BenzeneHtpEngine.cpp.
References Get().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void HexHtpEngine::CmdLoadSgf | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Loads game or position from given sgf.
Sets position to given move number or the last move of the game if none is given.
Definition at line 311 of file HexHtpEngine.cpp.
References Game::Board(), StoneBoard::Height(), LogWarning(), HexHtpEngine::m_game, HexHtpEngine::NewGame(), HexSgUtil::NodeHasSetupInfo(), HexHtpEngine::Play(), HexHtpEngine::SetPosition(), HexSgUtil::SgColorToHexColor(), and HexSgUtil::SgPointToHexPoint().
Referenced by HexHtpEngine::HexHtpEngine().
void BenzeneHtpEngine::CmdMiscDebug | ( | HtpCommand & | cmd | ) | [inherited] |
Definition at line 581 of file BenzeneHtpEngine.cpp.
References HexEnvironment::brd, and BenzeneHtpEngine::m_pe.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
void HexHtpEngine::CmdName | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Returns program's name.
Definition at line 119 of file HexHtpEngine.cpp.
References Get().
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdNewGame | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Starts new game with the given board size.
Definition at line 156 of file HexHtpEngine.cpp.
References MAX_HEIGHT, MAX_WIDTH, and HexHtpEngine::NewGame().
Referenced by HexHtpEngine::HexHtpEngine().
void BenzeneHtpEngine::CmdParamDfpn | ( | HtpCommand & | cmd | ) | [inherited] |
void HexHtpEngine::CmdParamGame | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Displays/changes parameters relating to the current game.
Parameters:
allow_swap
See Game::AllowSwap game_time
See Game::GameTime Definition at line 371 of file HexHtpEngine.cpp.
References Game::AllowSwap(), Game::GameTime(), Game::History(), HexHtpEngine::m_game, Game::SetAllowSwap(), and Game::SetGameTime().
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdPlay | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Plays a move.
Definition at line 176 of file HexHtpEngine.cpp.
References HtpUtil::ColorArg(), HtpUtil::MoveArg(), and HexHtpEngine::Play().
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdRegGenMove | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Generates a move, but does not play it.
Sets random seed.
Definition at line 208 of file HexHtpEngine.cpp.
References HtpUtil::ColorArg(), HexHtpEngine::GenMove(), GameUtil::IsGameOver(), HexHtpEngine::m_game, and RESIGN.
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdShowboard | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Displays the board.
Definition at line 229 of file HexHtpEngine.cpp.
References Game::Board(), and HexHtpEngine::m_game.
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdTimeLeft | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Displays time left for both players or given player.
Definition at line 243 of file HexHtpEngine.cpp.
References BLACK, HtpUtil::ColorArg(), Time::Formatted(), HexHtpEngine::m_game, Game::SetTimeRemaining(), Game::TimeRemaining(), and WHITE.
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdUndo | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Undo the last move.
Definition at line 222 of file HexHtpEngine.cpp.
References HexHtpEngine::m_game, and Game::UndoMove().
Referenced by HexHtpEngine::HexHtpEngine().
void HexHtpEngine::CmdVersion | ( | HtpCommand & | cmd | ) | [virtual, inherited] |
Returns program's version.
Definition at line 125 of file HexHtpEngine.cpp.
References Get().
Referenced by HexHtpEngine::HexHtpEngine().
Definition at line 100 of file MoHexEngine.cpp.
References Game::Board(), HexEnvironment::brd, BenzenePlayer::GenMove(), PlayAndSolve::GenMove(), BenzeneHtpEngine::m_dfpnPositions, BenzeneHtpEngine::m_dfpnSolver, HexHtpEngine::m_game, BenzeneHtpEngine::m_pe, m_player, BenzeneHtpEngine::m_se, BenzeneHtpEngine::m_useParallelSolver, and HexEnvironment::SyncBoard().
Referenced by GenMove().
Generates a move for color.
Implements HexHtpEngine.
Definition at line 88 of file MoHexEngine.cpp.
References BookCheck::BestMove(), Game::Board(), DoSearch(), INVALID_POINT, m_bookCheck, HexHtpEngine::m_game, SwapCheck::PlaySwap(), SWAP_PIECES, and TimeForMove().
void MoHexEngine::MoHexParam | ( | HtpCommand & | cmd | ) |
Definition at line 152 of file MoHexEngine.cpp.
References MoHexPlayer::BackupIceInfo(), HexUctSearch::KeepGames(), HexUctSearch::LiveGfx(), HexUctSearch::LiveGfxInterval(), m_player, BenzeneHtpEngine::m_useParallelSolver, MoHexPlayer::MaxGames(), MoHexPlayer::MaxTime(), MoHexPlayer::PerformPreSearch(), HexUctSearch::PlayoutUpdateRadius(), MoHexPlayer::Ponder(), MoHexPlayer::ReuseSubtree(), MoHexPlayer::Search(), BenzenePlayer::SearchSingleton(), MoHexPlayer::SetBackupIceInfo(), HexUctSearch::SetKeepGames(), HexUctSearch::SetLiveGfx(), HexUctSearch::SetLiveGfxInterval(), MoHexPlayer::SetMaxGames(), MoHexPlayer::SetMaxTime(), MoHexPlayer::SetPerformPreSearch(), HexUctSearch::SetPlayoutUpdateRadius(), MoHexPlayer::SetPonder(), MoHexPlayer::SetReuseSubtree(), BenzenePlayer::SetSearchSingleton(), HexUctSearch::SetTreeUpdateRadius(), MoHexPlayer::SetUseTimeManagement(), HexUctSearch::TreeUpdateRadius(), and MoHexPlayer::UseTimeManagement().
Referenced by MoHexEngine().
void MoHexEngine::MoHexPolicyParam | ( | HtpCommand & | cmd | ) |
Definition at line 119 of file MoHexEngine.cpp.
References HexUctSharedPolicy::Config(), m_player, HexUctPolicyConfig::pattern_check_percent, HexUctPolicyConfig::patternHeuristic, HexUctPolicyConfig::response_threshold, HexUctPolicyConfig::responseHeuristic, and MoHexPlayer::SharedPolicy().
Referenced by MoHexEngine().
void BenzeneHtpEngine::NewGame | ( | int | width, | |
int | height | |||
) | [protected, virtual, inherited] |
Creates a new game on a board with given dimensions.
Reimplemented from HexHtpEngine.
Definition at line 94 of file BenzeneHtpEngine.cpp.
References BenzeneHtpEngine::m_pe, BenzeneHtpEngine::m_se, and HexEnvironment::NewGame().
void BenzeneHtpEngine::ParamPlayer | ( | BenzenePlayer * | player, | |
HtpCommand & | cmd | |||
) | [protected, inherited] |
Plays a move.
Definition at line 72 of file HexHtpEngine.cpp.
References Game::INVALID_MOVE, HexHtpEngine::m_game, Game::OCCUPIED_CELL, Game::PlayMove(), and RESIGN.
Referenced by HexHtpEngine::CmdGenMove(), HexHtpEngine::CmdLoadSgf(), HexHtpEngine::CmdPlay(), and HexHtpEngine::SetPosition().
void MoHexEngine::RaveValues | ( | HtpCommand & | cmd | ) |
Definition at line 325 of file MoHexEngine.cpp.
References m_player, and MoHexPlayer::Search().
Referenced by MoHexEngine().
void MoHexEngine::RegisterCmd | ( | const std::string & | name, | |
GtpCallback< MoHexEngine >::Method | method | |||
) | [private] |
Definition at line 75 of file MoHexEngine.cpp.
Referenced by MoHexEngine().
void MoHexEngine::SaveGames | ( | HtpCommand & | cmd | ) |
Saves games from last search to a SGF.
Definition at line 299 of file MoHexEngine.cpp.
References m_player, HexUctSearch::SaveGames(), and MoHexPlayer::Search().
Referenced by MoHexEngine().
void MoHexEngine::SaveTree | ( | HtpCommand & | cmd | ) |
Saves the search tree from the previous search to the specified file.
The optional second parameter sets the max depth to output. If not given, entire tree is saved.
Definition at line 283 of file MoHexEngine.cpp.
References m_player, HexUctSearch::SaveTree(), and MoHexPlayer::Search().
Referenced by MoHexEngine().
void HexHtpEngine::SetPosition | ( | const SgNode * | node | ) | [protected, inherited] |
Definition at line 293 of file HexHtpEngine.cpp.
References BLACK, Game::Board(), HexSgUtil::GetSetupPosition(), StoneBoard::Height(), HexHtpEngine::m_game, HexHtpEngine::Play(), and WHITE.
Referenced by HexHtpEngine::CmdLoadSgf().
double MoHexEngine::TimeForMove | ( | HexColor | color | ) |
Definition at line 81 of file MoHexEngine.cpp.
References HexHtpEngine::m_game, m_player, MoHexPlayer::MaxTime(), Game::TimeRemaining(), and MoHexPlayer::UseTimeManagement().
Referenced by GenMove().
void MoHexEngine::Values | ( | HtpCommand & | cmd | ) |
Definition at line 307 of file MoHexEngine.cpp.
References m_player, and MoHexPlayer::Search().
Referenced by MoHexEngine().
StoneBoard HexHtpEngine::m_board [protected, inherited] |
Definition at line 86 of file HexHtpEngine.hpp.
Referenced by HexHtpEngine::CmdClearBoard(), HexHtpEngine::HexHtpEngine(), and HexHtpEngine::NewGame().
boost::scoped_ptr<Book> MoHexEngine::m_book [private] |
Definition at line 54 of file MoHexEngine.hpp.
BookCheck MoHexEngine::m_bookCheck [private] |
Definition at line 56 of file MoHexEngine.hpp.
Referenced by GenMove().
Definition at line 58 of file MoHexEngine.hpp.
Referenced by MoHexEngine().
boost::scoped_ptr<DfpnDB> BenzeneHtpEngine::m_dfpnDB [protected, inherited] |
Definition at line 101 of file BenzeneHtpEngine.hpp.
boost::scoped_ptr<DfpnHashTable> BenzeneHtpEngine::m_dfpnHashTable [protected, inherited] |
Definition at line 97 of file BenzeneHtpEngine.hpp.
SolverDBParameters BenzeneHtpEngine::m_dfpnParam [protected, inherited] |
Definition at line 105 of file BenzeneHtpEngine.hpp.
SolverDB<DfpnHashTable, DfpnDB, DfpnData> BenzeneHtpEngine::m_dfpnPositions [protected, inherited] |
Definition at line 109 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneTestEngine::CmdSetPlayer(), DoSearch(), and WolveEngine::GenMove().
DfpnSolver BenzeneHtpEngine::m_dfpnSolver [protected, inherited] |
Definition at line 93 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneTestEngine::CmdSetPlayer(), DoSearch(), and WolveEngine::GenMove().
DfpnCommands BenzeneHtpEngine::m_dfpnSolverCommands [protected, inherited] |
Definition at line 119 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
boost::scoped_ptr<DfsDB> BenzeneHtpEngine::m_dfsDB [protected, inherited] |
Definition at line 99 of file BenzeneHtpEngine.hpp.
boost::scoped_ptr<DfsHashTable> BenzeneHtpEngine::m_dfsHashTable [protected, inherited] |
Definition at line 95 of file BenzeneHtpEngine.hpp.
SolverDBParameters BenzeneHtpEngine::m_dfsParam [protected, inherited] |
Definition at line 103 of file BenzeneHtpEngine.hpp.
SolverDB<DfsHashTable, DfsDB, DfsData> BenzeneHtpEngine::m_dfsPositions [protected, inherited] |
Definition at line 107 of file BenzeneHtpEngine.hpp.
DfsSolver BenzeneHtpEngine::m_dfsSolver [protected, inherited] |
Definition at line 91 of file BenzeneHtpEngine.hpp.
DfsCommands BenzeneHtpEngine::m_dfsSolverCommands [protected, inherited] |
Definition at line 117 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
Game HexHtpEngine::m_game [protected, inherited] |
Definition at line 88 of file HexHtpEngine.hpp.
Referenced by HexHtpEngine::CmdAllLegalMoves(), HexHtpEngine::CmdBoardID(), BenzeneHtpEngine::CmdComputeDominated(), BenzeneHtpEngine::CmdComputeDominatedOnCell(), BenzeneHtpEngine::CmdComputeFillin(), BenzeneHtpEngine::CmdComputeInferior(), BenzeneHtpEngine::CmdComputeReversible(), BenzeneHtpEngine::CmdComputeVulnerable(), BenzeneHtpEngine::CmdEncodePattern(), BenzeneHtpEngine::CmdEvalInfluence(), BenzeneHtpEngine::CmdEvalResistDelta(), BenzeneHtpEngine::CmdEvalTwoDist(), HexHtpEngine::CmdFinalScore(), BenzeneHtpEngine::CmdFindCombDecomp(), BenzeneHtpEngine::CmdFindSplitDecomp(), HexHtpEngine::CmdGenMove(), BenzeneHtpEngine::CmdGetAbsorbGroup(), BenzeneHtpEngine::CmdHandbookAdd(), HexHtpEngine::CmdLoadSgf(), HexHtpEngine::CmdParamGame(), HexHtpEngine::CmdRegGenMove(), HexHtpEngine::CmdShowboard(), HexHtpEngine::CmdTimeLeft(), HexHtpEngine::CmdUndo(), DoSearch(), WolveEngine::GenMove(), GenMove(), BenzeneTestEngine::GenMove(), HexHtpEngine::NewGame(), HexHtpEngine::Play(), HexHtpEngine::SetPosition(), WolveEngine::TimeForMove(), TimeForMove(), and BenzeneTestEngine::TimeForMove().
HexEnvironment BenzeneHtpEngine::m_pe [protected, inherited] |
Player's environment.
Definition at line 86 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneHtpEngine::CmdComputeDominated(), BenzeneHtpEngine::CmdComputeDominatedOnCell(), BenzeneHtpEngine::CmdComputeFillin(), BenzeneHtpEngine::CmdComputeInferior(), BenzeneHtpEngine::CmdComputeReversible(), BenzeneHtpEngine::CmdComputeVulnerable(), BenzeneHtpEngine::CmdEvalInfluence(), BenzeneHtpEngine::CmdEvalResist(), BenzeneHtpEngine::CmdEvalResistDelta(), BenzeneHtpEngine::CmdEvalTwoDist(), BenzeneHtpEngine::CmdFindCombDecomp(), BenzeneHtpEngine::CmdFindSplitDecomp(), BenzeneHtpEngine::CmdMiscDebug(), DoSearch(), WolveEngine::GenMove(), BenzeneTestEngine::GenMove(), and BenzeneHtpEngine::NewGame().
MoHexPlayer& MoHexEngine::m_player [private] |
Definition at line 52 of file MoHexEngine.hpp.
Referenced by Bounds(), DoSearch(), MoHexParam(), MoHexPolicyParam(), RaveValues(), SaveGames(), SaveTree(), TimeForMove(), and Values().
HexEnvironmentCommands BenzeneHtpEngine::m_playerEnvCommands [protected, inherited] |
Definition at line 111 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
HexEnvironment BenzeneHtpEngine::m_se [protected, inherited] |
Solver's environment.
Definition at line 89 of file BenzeneHtpEngine.hpp.
Referenced by DoSearch(), WolveEngine::GenMove(), and BenzeneHtpEngine::NewGame().
HexEnvironmentCommands BenzeneHtpEngine::m_solverEnvCommands [protected, inherited] |
Definition at line 113 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
bool BenzeneHtpEngine::m_useParallelSolver [protected, inherited] |
Definition at line 121 of file BenzeneHtpEngine.hpp.
Referenced by DoSearch(), WolveEngine::GenMove(), MoHexParam(), and WolveEngine::WolveParam().
VCCommands BenzeneHtpEngine::m_vcCommands [protected, inherited] |
Definition at line 115 of file BenzeneHtpEngine.hpp.
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().