Default time management for Go. More...
#include <GoTimeControl.h>
Public Member Functions | |
GoTimeControl (const GoBoard &bd) | |
void | GetPositionInfo (SgBlackWhite &toPlay, int &movesPlayed, int &estimatedRemainingMoves) |
double | TimeForCurrentMove (const SgTimeRecord &timeRecord, bool quiet=false) |
double | FastOpenFactor () const |
void | SetFastOpenFactor (double factor) |
int | FastOpenMoves () const |
void | SetFastOpenMoves (int nummoves) |
double | RemainingConstant () const |
void | SetRemainingConstant (double value) |
void | SetMinTime (double mintime) |
Parameters | |
float | FinalSpace () const |
Set estimated proportion of occupied points at the end of the game. | |
void | SetFinalSpace (float finalspace) |
See FinalSpace(). | |
Private Attributes | |
const GoBoard & | m_bd |
float | m_finalSpace |
Estimated proportion of remaining space that will be played out. |
Default time management for Go.
Implements SgDefaultTimeControl. The remaining number of moves in the game is estimated by comparing the number of empty points to the expected final number of empty points (can be tuned with the SetFinalSpace() parameter; default = 0.75).
Definition at line 20 of file GoTimeControl.h.
GoTimeControl::GoTimeControl | ( | const GoBoard & | bd | ) |
Definition at line 15 of file GoTimeControl.cpp.
float GoTimeControl::FinalSpace | ( | ) | const |
Set estimated proportion of occupied points at the end of the game.
See class description.
Definition at line 21 of file GoTimeControl.cpp.
References m_finalSpace.
Referenced by GoGtpEngine::CmdParamTimecontrol().
void GoTimeControl::GetPositionInfo | ( | SgBlackWhite & | toPlay, | |
int & | movesPlayed, | |||
int & | estimatedRemainingMoves | |||
) | [virtual] |
Implements SgDefaultTimeControl.
Definition at line 26 of file GoTimeControl.cpp.
References GoBoard::AllPoints(), m_bd, m_finalSpace, GoBoard::Occupied(), SgPointSet::Size(), GoBoard::ToPlay(), and GoBoard::TotalNumEmpty().
void GoTimeControl::SetFinalSpace | ( | float | finalspace | ) |
See FinalSpace().
Definition at line 38 of file GoTimeControl.cpp.
References m_finalSpace, and SG_ASSERT.
Referenced by GoGtpEngine::CmdParamTimecontrol().
const GoBoard& GoTimeControl::m_bd [private] |
Definition at line 44 of file GoTimeControl.h.
Referenced by GetPositionInfo().
float GoTimeControl::m_finalSpace [private] |
Estimated proportion of remaining space that will be played out.
Definition at line 47 of file GoTimeControl.h.
Referenced by FinalSpace(), GetPositionInfo(), and SetFinalSpace().