All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
osl::game_playing::SearchPlayer Class Referenceabstract

MtdfPlayer と AlphaBetaPlayer の共通部分 More...

#include <searchPlayer.h>

Inheritance diagram for osl::game_playing::SearchPlayer:
Inheritance graph
[legend]
Collaboration diagram for osl::game_playing::SearchPlayer:
Collaboration graph
[legend]

Classes

struct  Config
 

Public Member Functions

 SearchPlayer ()
 
 SearchPlayer (const SearchPlayer &)
 
 ~SearchPlayer ()
 
void setDepthLimit (int limit, int initial_limit, int deepening_step)
 
void setNodeLimit (size_t node_limit)
 
void setNodeCountHardLimit (size_t node_limit)
 
void setTableLimit (size_t size, int record_limit)
 
void setVerbose (int verbose=1)
 
void setDrawCoef (double new_value)
 
void setNextIterationCoefficient (double new_value)
 
double nextIterationCoefficient () const
 
void enableSavePV (bool enable=true)
 
void enableMultiPV (int width)
 
void addMonitor (const boost::shared_ptr< search::SearchMonitor > &)
 
void resetRecorder (search::CountRecorder *new_recorder)
 所有権移転 More...
 
void pushMove (Move m)
 
void popMove ()
 
void swapTable (SearchPlayer &other)
 other の局面表と取り替える More...
 
const search::SimpleHashTabletable () const
 
const search::CountRecorderrecorder () const
 
bool stopSearchNow ()
 探索をとめる More...
 
bool canStopSearch ()
 
const MoveWithComment selectBestMove (const GameState &, int limit, int elapsed, int byoyomi)
 searchWithSecondsForThisMove を呼び出す More...
 
const MoveWithComment selectBestMoveInTime (const GameState &, const search::TimeAssigned &)
 
const search::TimeAssigned assignTime (const GameState &state, int limit, int elapsed, int byoyomi) const
 
void saveSearchResult (const GameState &, const MoveWithComment &)
 
virtual const MoveWithComment searchWithSecondsForThisMove (const GameState &, const search::TimeAssigned &)=0
 
void setRootIgnoreMoves (const MoveVector *rim, bool prediction)
 
const ConfiggetConfig () const
 
int secondsForThisMove (const GameState &state, int limit, int elapsed, int byoyomi) const
 
void setTimeAssign (const search::TimeAssigned &new_assign)
 
const MilliSeconds startTime () const
 
template<class Searcher >
osl::game_playing::ComputerPlayercloneIt (const Searcher &copy) const
 
template<class Searcher >
int pawnValue ()
 
template<class Searcher >
int pawnValueOfTurn (Player turn)
 
template<class Searcher >
const osl::search::MoveWithComment search (const GameState &state, const search::TimeAssigned &msec)
 
- Public Member Functions inherited from osl::game_playing::ComputerPlayer
 ComputerPlayer ()
 
virtual ~ComputerPlayer ()
 
virtual ComputerPlayerclone () const =0
 new したものを返す More...
 
virtual bool isReasonableMove (const GameState &, Move move, int pawn_sacrifice)
 
virtual void setInitialState (const NumEffectState &)
 
virtual void allowSpeculativeSearch (bool value)
 相手時間の探索を許可する (GameManager が操作) More...
 
virtual void setRootIgnoreMoves (const container::MoveVector *rim, bool prediction)
 
- Public Member Functions inherited from osl::game_playing::ComputerPlayerSelectBestMoveInTime
virtual ~ComputerPlayerSelectBestMoveInTime ()
 

Static Public Member Functions

static const search::TimeAssigned assignTime (const GameState &state, int limit, int elapsed, int byoyomi, int verbose)
 
static int secondsForThisMove (const GameState &state, int limit, int elapsed, int byoyomi, int verboseness)
 

Protected Member Functions

template<class Searcher >
ComputerPlayercloneIt (const Searcher &) const
 
const MilliSeconds::Interval setUpTable (const GameState &, int pawn_value)
 
template<class Searcher >
const MoveWithComment search (const GameState &, const search::TimeAssigned &)
 
template<class Searcher >
bool isReasonableMoveBySearch (Searcher &, Move move, int pawn_sacrifice)
 
const search::TimeAssigned adjust (const search::TimeAssigned &org, const MilliSeconds::Interval &elapsed)
 

Static Protected Member Functions

template<class Searcher >
static int pawnValue ()
 
template<class Searcher >
static int pawnValueOfTurn (Player turn)
 

Protected Attributes

Config config
 
boost::shared_ptr
< search::SimpleHashTable
table_ptr
 
boost::shared_ptr
< checkmate::DualDfpn
checkmate_ptr
 
boost::scoped_ptr
< search::CountRecorder
recorder_ptr
 
volatile bool searching
 
boost::scoped_ptr
< search::SearchTimer
searcher
 
volatile bool plan_stop
 探索に入る前に止める More...
 
const MoveVector * root_ignore_moves
 
bool prediction_for_speculative_search
 
boost::scoped_ptr< PVHistorypv_history
 
int almost_resign_count
 
- Protected Attributes inherited from osl::game_playing::ComputerPlayer
bool speculative_search_allowed
 

Detailed Description

MtdfPlayer と AlphaBetaPlayer の共通部分

Definition at line 36 of file searchPlayer.h.

Constructor & Destructor Documentation

osl::game_playing::SearchPlayer::SearchPlayer ( )

Definition at line 49 of file searchPlayer.cc.

osl::game_playing::SearchPlayer::SearchPlayer ( const SearchPlayer copy)

Definition at line 59 of file searchPlayer.cc.

osl::game_playing::SearchPlayer::~SearchPlayer ( )

Definition at line 71 of file searchPlayer.cc.

Member Function Documentation

void osl::game_playing::SearchPlayer::addMonitor ( const boost::shared_ptr< search::SearchMonitor > &  m)

Definition at line 233 of file searchPlayer.cc.

const osl::search::TimeAssigned osl::game_playing::SearchPlayer::adjust ( const search::TimeAssigned org,
const MilliSeconds::Interval &  elapsed 
)
protected
const osl::search::TimeAssigned osl::game_playing::SearchPlayer::assignTime ( const GameState state,
int  limit,
int  elapsed,
int  byoyomi,
int  verbose 
)
static

Definition at line 328 of file searchPlayer.cc.

References osl::eval::max(), and osl::eval::min().

const osl::search::TimeAssigned osl::game_playing::SearchPlayer::assignTime ( const GameState state,
int  limit,
int  elapsed,
int  byoyomi 
) const

Definition at line 320 of file searchPlayer.cc.

bool osl::game_playing::SearchPlayer::canStopSearch ( )

Definition at line 82 of file searchPlayer.cc.

template<class Searcher >
osl::game_playing::ComputerPlayer* osl::game_playing::SearchPlayer::cloneIt ( const Searcher copy) const

Definition at line 40 of file searchPlayer.tcc.

template<class Searcher >
ComputerPlayer* osl::game_playing::SearchPlayer::cloneIt ( const Searcher ) const
protected
void osl::game_playing::SearchPlayer::enableMultiPV ( int  width)
inline
void osl::game_playing::SearchPlayer::enableSavePV ( bool  enable = true)
inline

Definition at line 94 of file searchPlayer.h.

References config, and osl::game_playing::SearchPlayer::Config::save_pv.

const Config& osl::game_playing::SearchPlayer::getConfig ( ) const
inline

Definition at line 147 of file searchPlayer.h.

References config.

template<class Searcher >
bool osl::game_playing::SearchPlayer::isReasonableMoveBySearch ( Searcher searcher,
Move  move,
int  pawn_sacrifice 
)
protected

Definition at line 146 of file searchPlayer.tcc.

double osl::game_playing::SearchPlayer::nextIterationCoefficient ( ) const
inline
template<class Searcher >
int osl::game_playing::SearchPlayer::pawnValue ( )

Definition at line 47 of file searchPlayer.tcc.

References osl::BLACK, osl::newPtypeO(), and osl::PAWN.

template<class Searcher >
static int osl::game_playing::SearchPlayer::pawnValue ( )
staticprotected
template<class Searcher >
int osl::game_playing::SearchPlayer::pawnValueOfTurn ( Player  turn)

Definition at line 54 of file searchPlayer.tcc.

References osl::eval::delta().

template<class Searcher >
static int osl::game_playing::SearchPlayer::pawnValueOfTurn ( Player  turn)
staticprotected
void osl::game_playing::SearchPlayer::popMove ( )
virtual

Implements osl::game_playing::ComputerPlayer.

Definition at line 247 of file searchPlayer.cc.

void osl::game_playing::SearchPlayer::pushMove ( Move  m)
virtual

Implements osl::game_playing::ComputerPlayer.

Definition at line 240 of file searchPlayer.cc.

const search::CountRecorder& osl::game_playing::SearchPlayer::recorder ( ) const
inline

Definition at line 110 of file searchPlayer.h.

References recorder_ptr.

void osl::game_playing::SearchPlayer::resetRecorder ( search::CountRecorder new_recorder)

所有権移転

Definition at line 104 of file searchPlayer.cc.

void osl::game_playing::SearchPlayer::saveSearchResult ( const GameState state,
const MoveWithComment &  best_move 
)
template<class Searcher >
const osl::search::MoveWithComment osl::game_playing::SearchPlayer::search ( const GameState state,
const search::TimeAssigned msec 
)
template<class Searcher >
const MoveWithComment osl::game_playing::SearchPlayer::search ( const GameState ,
const search::TimeAssigned  
)
protected
virtual const MoveWithComment osl::game_playing::SearchPlayer::searchWithSecondsForThisMove ( const GameState ,
const search::TimeAssigned  
)
pure virtual
int osl::game_playing::SearchPlayer::secondsForThisMove ( const GameState state,
int  limit,
int  elapsed,
int  byoyomi,
int  verboseness 
)
static
int osl::game_playing::SearchPlayer::secondsForThisMove ( const GameState state,
int  limit,
int  elapsed,
int  byoyomi 
) const

Definition at line 255 of file searchPlayer.cc.

const osl::search::MoveWithComment osl::game_playing::SearchPlayer::selectBestMove ( const GameState state,
int  limit,
int  elapsed,
int  byoyomi 
)
virtual

searchWithSecondsForThisMove を呼び出す

Implements osl::game_playing::ComputerPlayer.

Definition at line 341 of file searchPlayer.cc.

Referenced by main().

const osl::search::MoveWithComment osl::game_playing::SearchPlayer::selectBestMoveInTime ( const GameState state,
const search::TimeAssigned msec 
)
virtual
void osl::game_playing::SearchPlayer::setDepthLimit ( int  limit,
int  initial_limit,
int  deepening_step 
)

Definition at line 188 of file searchPlayer.cc.

Referenced by main(), and search().

void osl::game_playing::SearchPlayer::setDrawCoef ( double  new_value)
inline

Definition at line 88 of file searchPlayer.h.

References config, and osl::game_playing::SearchPlayer::Config::draw_coef.

void osl::game_playing::SearchPlayer::setNextIterationCoefficient ( double  new_value)

Definition at line 225 of file searchPlayer.cc.

Referenced by search().

void osl::game_playing::SearchPlayer::setNodeCountHardLimit ( size_t  node_limit)

Definition at line 202 of file searchPlayer.cc.

void osl::game_playing::SearchPlayer::setNodeLimit ( size_t  node_limit)

Definition at line 196 of file searchPlayer.cc.

Referenced by main(), and search().

void osl::game_playing::SearchPlayer::setRootIgnoreMoves ( const MoveVector *  rim,
bool  prediction 
)
inline

Definition at line 141 of file searchPlayer.h.

References prediction_for_speculative_search, and root_ignore_moves.

void osl::game_playing::SearchPlayer::setTableLimit ( size_t  size,
int  record_limit 
)

Definition at line 208 of file searchPlayer.cc.

Referenced by main(), and search().

void osl::game_playing::SearchPlayer::setTimeAssign ( const search::TimeAssigned new_assign)

Definition at line 365 of file searchPlayer.cc.

const osl::MilliSeconds::Interval osl::game_playing::SearchPlayer::setUpTable ( const GameState gs,
int  pawn_value 
)
protected
void osl::game_playing::SearchPlayer::setVerbose ( int  verbose = 1)

Definition at line 217 of file searchPlayer.cc.

Referenced by search().

const osl::MilliSeconds osl::game_playing::SearchPlayer::startTime ( ) const

Definition at line 373 of file searchPlayer.cc.

bool osl::game_playing::SearchPlayer::stopSearchNow ( )
virtual

探索をとめる

Reimplemented from osl::game_playing::ComputerPlayer.

Definition at line 88 of file searchPlayer.cc.

References osl::ctime_r().

void osl::game_playing::SearchPlayer::swapTable ( SearchPlayer other)

other の局面表と取り替える

Definition at line 76 of file searchPlayer.cc.

References table_ptr.

Referenced by osl::game_playing::SpeculativeAllMoves::waitResult().

const search::SimpleHashTable* osl::game_playing::SearchPlayer::table ( ) const
inline

Definition at line 109 of file searchPlayer.h.

References table_ptr.

Referenced by search().

Member Data Documentation

int osl::game_playing::SearchPlayer::almost_resign_count
protected

Definition at line 77 of file searchPlayer.h.

boost::shared_ptr<checkmate::DualDfpn> osl::game_playing::SearchPlayer::checkmate_ptr
protected

Definition at line 68 of file searchPlayer.h.

Config osl::game_playing::SearchPlayer::config
protected
volatile bool osl::game_playing::SearchPlayer::plan_stop
protected

探索に入る前に止める

Definition at line 73 of file searchPlayer.h.

bool osl::game_playing::SearchPlayer::prediction_for_speculative_search
protected

Definition at line 75 of file searchPlayer.h.

Referenced by setRootIgnoreMoves().

boost::scoped_ptr<PVHistory> osl::game_playing::SearchPlayer::pv_history
protected

Definition at line 76 of file searchPlayer.h.

boost::scoped_ptr<search::CountRecorder> osl::game_playing::SearchPlayer::recorder_ptr
protected

Definition at line 69 of file searchPlayer.h.

Referenced by recorder().

const MoveVector* osl::game_playing::SearchPlayer::root_ignore_moves
protected

Definition at line 74 of file searchPlayer.h.

Referenced by setRootIgnoreMoves().

boost::scoped_ptr<search::SearchTimer> osl::game_playing::SearchPlayer::searcher
protected

Definition at line 71 of file searchPlayer.h.

volatile bool osl::game_playing::SearchPlayer::searching
protected

Definition at line 70 of file searchPlayer.h.

boost::shared_ptr<search::SimpleHashTable> osl::game_playing::SearchPlayer::table_ptr
protected

Definition at line 67 of file searchPlayer.h.

Referenced by swapTable(), and table().


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