Player using HexAbSearch to generate moves. More...
#include <WolvePlayer.hpp>
Public Member Functions | |
WolvePlayer () | |
virtual | ~WolvePlayer () |
std::string | Name () const |
Returns "wolve". | |
WolveSearch & | Search () |
Returns the search. | |
HexPoint | GenMove (const HexState &state, const Game &game, HexBoard &brd, double maxTime, double &score) |
Generates a move from this board position. | |
bool | SearchSingleton () const |
Search states with only a single move? | |
void | SetSearchSingleton (bool flag) |
See SetSearchSingleton(). | |
Parameters | |
const std::vector< int > & | PlyWidth () const |
Number of moves to consider at each depth after move ordering. | |
void | SetPlyWidth (const std::vector< int > &width) |
See PlyWidth(). | |
const std::vector< int > & | SearchDepths () const |
Depths to search if using iterative deepening. | |
void | SetSearchDepths (const std::vector< int > &depths) |
See UseIterativeDeepening(). | |
double | PanicTime () const |
When time remaining is less than this, max search depth is set to 4. | |
void | SetPanicTime (double time) |
See PanicTime(). | |
Protected Member Functions | |
bool | FillinCausedWin () const |
Protected Attributes | |
bool | m_fillinCausedWin |
HexColor | m_fillinWinner |
Private Member Functions | |
void | CheckPanicMode (double timeRemaining, std::vector< int > &search_depths, std::vector< int > &plywidth) |
Reduce search strength if running out of time. | |
virtual HexPoint | Search (const HexState &state, const Game &game, HexBoard &brd, const bitset_t &consider, double maxTime, double &score) |
Generates a move in the given gamestate using alphabeta. | |
Private Attributes | |
WolveSearch | m_search |
SearchTT | m_tt |
TT for search. | |
std::vector< int > | m_plywidth |
See PlyWidths(). | |
std::vector< int > | m_search_depths |
See SearchDepths(). | |
double | m_panic_time |
See PanicTime(). |
Player using HexAbSearch to generate moves.
Definition at line 177 of file WolvePlayer.hpp.
WolvePlayer::WolvePlayer | ( | ) | [explicit] |
Definition at line 18 of file WolvePlayer.cpp.
References m_plywidth, m_search, m_search_depths, m_tt, and HexAbSearch::SetTT().
WolvePlayer::~WolvePlayer | ( | ) | [virtual] |
Definition at line 35 of file WolvePlayer.cpp.
void WolvePlayer::CheckPanicMode | ( | double | timeRemaining, | |
std::vector< int > & | search_depths, | |||
std::vector< int > & | plywidth | |||
) | [private] |
Reduce search strength if running out of time.
Definition at line 42 of file WolvePlayer.cpp.
References LogWarning(), and m_panic_time.
Referenced by Search().
bool BenzenePlayer::FillinCausedWin | ( | ) | const [inline, protected, inherited] |
Definition at line 86 of file BenzenePlayer.hpp.
References BenzenePlayer::m_fillinCausedWin.
Referenced by PerfectPlayer::Search().
HexPoint BenzenePlayer::GenMove | ( | const HexState & | state, | |
const Game & | game, | |||
HexBoard & | brd, | |||
double | maxTime, | |||
double & | score | |||
) | [virtual, inherited] |
Generates a move from this board position.
If the game is already over (somebody has won), returns RESIGN.
Derived Benzene players that use different search algorithms should not extend this method, but the protected virtual method Search() below.
If state is terminal (game over, vc/fill-in win/loss), returns "appropriate" move. Otherwise, calls Search().
Implements HexPlayer.
Definition at line 27 of file BenzenePlayer.cpp.
References BenzenePlayer::CheckEndgame(), BenzenePlayer::InitSearch(), INVALID_POINT, LogInfo(), BenzenePlayer::Search(), and HexState::ToPlay().
Referenced by MoHexEngine::DoSearch(), WolveEngine::GenMove(), PlayAndSolve::PlayerThread::operator()(), and BookBuilder< PLAYER >::Worker::operator()().
std::string WolvePlayer::Name | ( | ) | const [inline, virtual] |
double WolvePlayer::PanicTime | ( | ) | const [inline] |
When time remaining is less than this, max search depth is set to 4.
A value of zero turns this option off.
Definition at line 271 of file WolvePlayer.hpp.
References m_panic_time.
Referenced by WolveEngine::WolveParam().
const std::vector< int > & WolvePlayer::PlyWidth | ( | ) | const [inline] |
Number of moves to consider at each depth after move ordering.
Definition at line 251 of file WolvePlayer.hpp.
References m_plywidth.
Referenced by WolveEngine::WolveParam().
HexPoint WolvePlayer::Search | ( | const HexState & | state, | |
const Game & | game, | |||
HexBoard & | brd, | |||
const bitset_t & | consider, | |||
double | maxTime, | |||
double & | score | |||
) | [private, virtual] |
Generates a move in the given gamestate using alphabeta.
Implements BenzenePlayer.
Definition at line 62 of file WolvePlayer.cpp.
References CheckPanicMode(), HexAbSearch::DumpStats(), HexAssert, LogInfo(), m_plywidth, m_search, m_search_depths, MiscUtil::PrintVector(), HexAbSearch::Search(), WolveSearch::SetRootMovesToConsider(), HexState::ToPlay(), UNUSED(), and HexBoard::Write().
WolveSearch & WolvePlayer::Search | ( | ) | [inline] |
Returns the search.
Definition at line 246 of file WolvePlayer.hpp.
References m_search.
Referenced by WolveEngine::WolveParam().
const std::vector< int > & WolvePlayer::SearchDepths | ( | ) | const [inline] |
Depths to search if using iterative deepening.
See UseIterativeDeepening().
Definition at line 261 of file WolvePlayer.hpp.
References m_search_depths.
Referenced by WolveEngine::WolveParam().
bool BenzenePlayer::SearchSingleton | ( | ) | const [inline, inherited] |
Search states with only a single move?
Definition at line 76 of file BenzenePlayer.hpp.
References BenzenePlayer::m_search_singleton.
Referenced by MoHexEngine::MoHexParam(), and WolveEngine::WolveParam().
void WolvePlayer::SetPanicTime | ( | double | time | ) | [inline] |
See PanicTime().
Definition at line 276 of file WolvePlayer.hpp.
References m_panic_time.
Referenced by WolveEngine::WolveParam().
void WolvePlayer::SetPlyWidth | ( | const std::vector< int > & | width | ) | [inline] |
See PlyWidth().
Definition at line 256 of file WolvePlayer.hpp.
References m_plywidth.
Referenced by WolveEngine::WolveParam().
void WolvePlayer::SetSearchDepths | ( | const std::vector< int > & | depths | ) | [inline] |
See UseIterativeDeepening().
Definition at line 266 of file WolvePlayer.hpp.
References m_search_depths.
Referenced by WolveEngine::WolveParam().
void BenzenePlayer::SetSearchSingleton | ( | bool | flag | ) | [inline, inherited] |
See SetSearchSingleton().
Definition at line 81 of file BenzenePlayer.hpp.
References BenzenePlayer::m_search_singleton.
Referenced by MoHexEngine::MoHexParam(), and WolveEngine::WolveParam().
bool BenzenePlayer::m_fillinCausedWin [protected, inherited] |
Definition at line 46 of file BenzenePlayer.hpp.
Referenced by BenzenePlayer::FillinCausedWin(), and BenzenePlayer::InitSearch().
HexColor BenzenePlayer::m_fillinWinner [protected, inherited] |
Definition at line 48 of file BenzenePlayer.hpp.
Referenced by BenzenePlayer::InitSearch(), and PerfectPlayer::Search().
double WolvePlayer::m_panic_time [private] |
See PanicTime().
Definition at line 231 of file WolvePlayer.hpp.
Referenced by CheckPanicMode(), PanicTime(), and SetPanicTime().
std::vector<int> WolvePlayer::m_plywidth [private] |
See PlyWidths().
Definition at line 225 of file WolvePlayer.hpp.
Referenced by PlyWidth(), Search(), SetPlyWidth(), and WolvePlayer().
WolveSearch WolvePlayer::m_search [private] |
Definition at line 219 of file WolvePlayer.hpp.
Referenced by Search(), and WolvePlayer().
std::vector<int> WolvePlayer::m_search_depths [private] |
See SearchDepths().
Definition at line 228 of file WolvePlayer.hpp.
Referenced by Search(), SearchDepths(), SetSearchDepths(), and WolvePlayer().
SearchTT WolvePlayer::m_tt [private] |