Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

DfpnCommands Class Reference

Commands for building/inspecting virtual connections. More...

#include <DfpnCommands.hpp>

List of all members.

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

Gamem_game
HexEnvironmentm_env
DfpnSolverm_solver
boost::scoped_ptr
< DfpnHashTable > & 
m_tt
boost::scoped_ptr< DfpnDB > & m_db
DfpnStatesm_positions

Detailed Description

Commands for building/inspecting virtual connections.

Definition at line 21 of file DfpnCommands.hpp.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]
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]
void DfpnCommands::CmdParamSolverDB ( HtpCommand cmd  )  [private]
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  ) 

Member Data Documentation

boost::scoped_ptr<DfpnDB>& DfpnCommands::m_db [private]

Definition at line 40 of file DfpnCommands.hpp.

Referenced by CmdCloseDB(), CmdDBStat(), and CmdOpenDB().

Definition at line 34 of file DfpnCommands.hpp.

Referenced by CmdFindWinning(), and CmdSolveState().

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().


The documentation for this class was generated from the following files:


6 Jan 2011 Doxygen 1.6.3