Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

WolvePlayer Class Reference

Player using HexAbSearch to generate moves. More...

#include <WolvePlayer.hpp>

Inheritance diagram for WolvePlayer:
BenzenePlayer HexPlayer

List of all members.

Public Member Functions

 WolvePlayer ()
virtual ~WolvePlayer ()
std::string Name () const
 Returns "wolve".
WolveSearchSearch ()
 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().

Detailed Description

Player using HexAbSearch to generate moves.

Definition at line 177 of file WolvePlayer.hpp.


Constructor & Destructor Documentation

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.


Member Function Documentation

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

Bug:
Subtract time spent to here from max_time after each step.

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]

Returns "wolve".

Implements HexPlayer.

Definition at line 241 of file WolvePlayer.hpp.

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]
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]

Member Data Documentation

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

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

TT for search.

Definition at line 222 of file WolvePlayer.hpp.

Referenced by WolvePlayer().


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


6 Jan 2011 Doxygen 1.6.3