Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

BookCommands Class Reference

Commands for inspecting opening books. More...

#include <BookCommands.hpp>

Inheritance diagram for BookCommands:
BookBuilderCommands< PLAYER >

List of all members.

Public Member Functions

 BookCommands (Game &game, HexEnvironment &env, boost::scoped_ptr< Book > &m_book, BookCheck &bookCheck)
 ~BookCommands ()
void Register (GtpEngine &engine)

Protected Attributes

Gamem_game
HexEnvironmentm_env
boost::scoped_ptr< Book > & m_book
BookCheckm_bookCheck

Private Member Functions

void Register (GtpEngine &engine, const std::string &command, GtpCallback< BookCommands >::Method method)
void CmdBookOpen (HtpCommand &cmd)
 Opens/Creates an opening book for the current boardsize.
void CmdBookClose (HtpCommand &cmd)
 Closes a book if one is open.
void CmdBookStat (HtpCommand &cmd)
void CmdBookMainLineDepth (HtpCommand &cmd)
void CmdBookCounts (HtpCommand &cmd)
void CmdBookScores (HtpCommand &cmd)
void CmdBookVisualize (HtpCommand &cmd)
void CmdBookDumpPolarizedLeafs (HtpCommand &cmd)
 Dumps variations leading to non-terminal leafs whose value is polarized.
void CmdBookImportSolvedStates (HtpCommand &cmd)
 Imports positions from file into book.
void CmdBookSetValue (HtpCommand &cmd)
 Sets value of current state in the book.
void CmdBookParam (HtpCommand &cmd)

Detailed Description

Commands for inspecting opening books.

Definition at line 21 of file BookCommands.hpp.


Constructor & Destructor Documentation

BookCommands::BookCommands ( Game game,
HexEnvironment env,
boost::scoped_ptr< Book > &  m_book,
BookCheck bookCheck 
)

Definition at line 14 of file BookCommands.cpp.

BookCommands::~BookCommands (  ) 

Definition at line 24 of file BookCommands.cpp.


Member Function Documentation

void BookCommands::CmdBookClose ( HtpCommand cmd  )  [private]

Closes a book if one is open.

Definition at line 69 of file BookCommands.cpp.

References m_book.

Referenced by Register().

void BookCommands::CmdBookCounts ( HtpCommand cmd  )  [private]

Definition at line 98 of file BookCommands.cpp.

References Game::Board(), m_book, m_game, and StoneBoard::WhoseTurn().

Referenced by Register().

void BookCommands::CmdBookDumpPolarizedLeafs ( HtpCommand cmd  )  [private]

Dumps variations leading to non-terminal leafs whose value is polarized.

The ignore file is an optional argument that lists states that should not be ingored (not dumped again). Usage: book-dump-polarized-leafs [polarization] [output file] { [ignore file] }

Definition at line 174 of file BookCommands.cpp.

References Game::Board(), BookUtil::DumpPolarizedLeafs(), FIRST_TO_PLAY, HexPointUtil::FromString(), Game::History(), GameUtil::HistoryToSequence(), StateSet::Insert(), LogInfo(), m_book, m_game, StateSet::Size(), and StoneBoard::WhoseTurn().

Referenced by Register().

void BookCommands::CmdBookImportSolvedStates ( HtpCommand cmd  )  [private]

Imports positions from file into book.

Definition at line 217 of file BookCommands.cpp.

References Game::Board(), StoneBoard::Const(), BookUtil::ImportSolvedStates(), m_book, and m_game.

Referenced by Register().

void BookCommands::CmdBookMainLineDepth ( HtpCommand cmd  )  [private]

Definition at line 85 of file BookCommands.cpp.

References Game::Board(), BookUtil::GetMainLineDepth(), m_book, m_game, and StoneBoard::WhoseTurn().

Referenced by Register().

void BookCommands::CmdBookOpen ( HtpCommand cmd  )  [private]

Opens/Creates an opening book for the current boardsize.

Usage: "book-expand [filename]"

Definition at line 56 of file BookCommands.cpp.

References m_book, and BenzeneException::what().

Referenced by Register().

void BookCommands::CmdBookParam ( HtpCommand cmd  )  [private]
void BookCommands::CmdBookScores ( HtpCommand cmd  )  [private]
void BookCommands::CmdBookSetValue ( HtpCommand cmd  )  [private]

Sets value of current state in the book.

Usage: book-set-value [value] Where [value] can be one of W, L, or value in rage [0, 1].

Definition at line 235 of file BookCommands.cpp.

References Game::Board(), IMMEDIATE_LOSS, IMMEDIATE_WIN, m_book, m_game, and StoneBoard::WhoseTurn().

Referenced by Register().

void BookCommands::CmdBookStat ( HtpCommand cmd  )  [private]

Definition at line 77 of file BookCommands.cpp.

References m_book.

Referenced by Register().

void BookCommands::CmdBookVisualize ( HtpCommand cmd  )  [private]
void BookCommands::Register ( GtpEngine &  engine,
const std::string &  command,
GtpCallback< BookCommands >::Method  method 
) [private]

Definition at line 45 of file BookCommands.cpp.

void BookCommands::Register ( GtpEngine &  engine  ) 

Member Data Documentation

boost::scoped_ptr<Book>& BookCommands::m_book [protected]

Definition at line 38 of file BookCommands.hpp.

Referenced by CmdBookParam(), and CmdBookScores().

Game& BookCommands::m_game [protected]

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


6 Jan 2011 Doxygen 1.6.3