All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Friends | List of all members
osl::search::AlphaBeta2Tree< EvalT > Class Template Reference

"tree" of AlphaBeta2, copied by split More...

#include <alphaBeta2.h>

Inheritance diagram for osl::search::AlphaBeta2Tree< EvalT >:
Inheritance graph
[legend]
Collaboration diagram for osl::search::AlphaBeta2Tree< EvalT >:
Collaboration graph
[legend]

Classes

struct  BetaCut
 
struct  NextMove
 
struct  NextQMove
 

Public Types

enum  { MaxDepth = SearchState2Core::MaxDepth }
 
typedef EvalT eval_t
 
typedef AlphaBeta2Common< EvalT > common_t
 
typedef AlphaBeta2Window Window
 
- Public Types inherited from osl::search::SearchBase< EvalT, SimpleHashTable, CountRecorder, RealizationProbability >
typedef EvalT eval_t
 
typedef RealizationProbability Probabilities_t
 

Public Member Functions

bool stopping () const
 
void testStop ()
 
size_t nodeCount () const
 
template<Player P>
const MoveLogProb nextMove ()
 
template<osl::Player P>
const osl::MoveLogProb nextMove ()
 
- Public Member Functions inherited from osl::search::SearchBase< EvalT, SimpleHashTable, CountRecorder, RealizationProbability >
 SearchBase (CountRecorder &r, SimpleHashTable *t)
 
virtual ~SearchBase ()
 
virtual bool abort (Move) const
 
bool validTableMove (const NumEffectState &state, const MoveLogProb &move, int limit) const
 テーブルの指手の正しさを確かめる More...
 
void recordWinByCheckmate (Player P, SimpleHashRecord *record, Move check_move) const
 詰将棋の見つけた勝 More...
 
void recordLoseByCheckmate (Player P, SimpleHashRecord *record) const
 詰将棋の見つけた敗 More...
 
- Public Member Functions inherited from osl::search::SearchState2
 SearchState2 (const NumEffectState &s, checkmate_t &checker)
 
virtual ~SearchState2 ()
 
void setState (const NumEffectState &s)
 state のコピーを行う. More...
 
void setKillerMove (Move best_move)
 
int curLimit () const
 
bool abort (Move) const
 
- Public Member Functions inherited from osl::search::SearchState2Core
 SearchState2Core (const NumEffectState &s, checkmate_t &checker)
 
virtual ~SearchState2Core ()
 
int curDepth () const
 
void setHistory (const MoveStack &h)
 
bool hasLastRecord (unsigned int n=0) const
 
SimpleHashRecordlastRecord (unsigned int n=0)
 
const SimpleHashRecordlastRecord (unsigned int n=0) const
 
SimpleHashRecordrootRecord ()
 
void setCurrentRecord (SimpleHashRecord *r)
 
void setRootRecord (SimpleHashRecord *root)
 
void setKillerMove (Move best_move)
 
void getBigramKillerMoves (MoveVector &moves) const
 
void getKillerMoves (MoveVector &moves) const
 
const BigramKillerMovebigramKillerMove () const
 
void setBigramKillerMove (const BigramKillerMove &killers)
 
HistoryTablehistoryTable ()
 
const HistoryTablehistoryTable () const
 
void pushPass ()
 
void popPass ()
 
template<Player P, class Function >
void doUndoMoveOrPass (const HashKey &new_hash, Move move, Function &f)
 まともなdoUndo More...
 
void makeMove (Move move)
 
const Move lastMove (int i=1) const
 
const MoveStack & history () const
 
const RecordStack2recordHistory () const
 
const PathEncodingpath () const
 
const NumEffectState & state () const
 
const NumEffectState & rootState () const
 
void restoreRootState ()
 
const checkmate_tcheckmateSearcher () const
 
const RepetitionCounterrepetitionCounter () const
 
const HashKey & currentHash () const
 
template<Player P, class Function >
void doUndoMoveLight (Move move, Function &f)
 軽量化版 doUndo 千日手情報や, hash を更新しない More...
 
template<Player P>
bool isLosingState (int node_limit)
 
template<Player P>
bool isWinningState (int node_limit, Move &checkmate_move, bool parallel=false)
 
template<Player P>
bool isWinningStateShort (int depth, Move &checkmate_move)
 FixedDepthSearcher を呼ぶ More...
 
template<Player P>
bool isThreatmateState (int node_limit, Move &threatmate_move, bool=false)
 P の手番でPの玉に詰めろがかかっているかどうか More...
 
template<Player P>
bool isThreatmateStateShort (int depth, Move &threatmate_move)
 
bool abort () const
 
bool tryThreatmate () const
 
void makePV (Move m)
 
void initPV ()
 
void makePV (PVVector &parent, Move m, PVVector &pv) const
 
int countCheckAfterThreatmate (Player turn, int depth=1) const
 turn の側が連続王手で詰ろを逃れている回数 More...
 
int countCheckAfterThreatmateSacrifice (Player turn, int depth=1) const
 
- Public Member Functions inherited from osl::search::SearchTimer
 SearchTimer ()
 
 SearchTimer (const SearchTimer &src)
 
virtual ~SearchTimer ()
 
void setTimeAssign (const TimeAssigned &a)
 
void setStartTime (MilliSeconds start)
 
void setStable (bool new_stable)
 
bool isStableNow () const
 
bool hasSchedule () const
 
const TimeAssignedtimeAssigned () const
 
const MilliSeconds startTime () const
 
double elapsed (MilliSeconds now) const
 
double elapsed () const
 
void setNextIterationCoefficient (double new_value)
 
void setNodeCountHardLimit (uint64_t new_value)
 
double nextIterationCoefficient () const
 
bool stopping () const
 
void stopNow ()
 
SearchTimerCommon::StopReason stopReason ()
 
void throwIfNoMoreTime (uint64_t node_count)
 
int nodeAffordable () const
 
void addMonitor (const boost::shared_ptr< SearchMonitor > &)
 
bool hasMonitor () const
 
const vector
< boost::shared_ptr
< SearchMonitor > > & 
monitors () const
 
int lastMemoryUseRatio1000 () const
 

Static Public Member Functions

static int rootAlpha (Player P, int last_value, Progress16 progress)
 
static int stableThreshold (Player P, int last_value)
 
- Static Public Member Functions inherited from osl::search::SearchTimer
static void adjustMemoryUseLimit (double scale=0.9)
 メモリとノード数の関係を調整. More...
 

Protected Member Functions

 AlphaBeta2Tree (const NumEffectState &s, checkmate_t &checker, SimpleHashTable *t, CountRecorder &)
 
 AlphaBeta2Tree (const AlphaBeta2Tree &src, AlphaBeta2Parallel< EvalT > *)
 
 ~AlphaBeta2Tree ()
 
void updateRootPV (Player P, std::ostream &, int, Move)
 
void addMultiPV (Player P, int, Move)
 
bool isStable (Player P, int new_value) const
 
void showFailLow (int result, Move m) const
 
template<Player P>
int alphaBetaSearch (const MoveLogProb &move, Window window, bool in_pv)
 alphaBetaSearch (move) More...
 
template<Player P>
int alphaBetaSearchAfterMove (const MoveLogProb &move, Window window, bool in_pv)
 
template<Player P>
int quiesce (Window)
 
template<Player P>
int quiesceStable (Window)
 
template<Player P>
int quiesceExp (Window)
 
template<Player P>
int searchAllMoves (SimpleHashRecord *, Window w)
 
template<Player P>
int searchAllMoves (Move m, int limit_consumption, SimpleHashRecord *, Window w)
 
template<Player P>
bool tryCheckmate (SimpleHashRecord *record, bool in_pv, Move &checkmate_move)
 初めの方で詰みを読む More...
 
template<Player P>
bool tryCheckmateAgain (SimpleHashRecord *record, Move &checkmate_move, int node_count, int best_value)
 負けそうな時にさらに詰みを読む More...
 
template<Player P>
void testThreatmate (SimpleHashRecord *record, bool in_pv)
 詰めろの有無を確認 More...
 
template<Player P>
void examineMovesRoot (const MoveLogProbVector &, size_t, Window, MoveLogProb &, int &)
 alpha値が求まった後で他の手を調べる More...
 
template<Player P>
int quiesceRoot (Window, int depth_left, Move &best_move, DualThreatmateState)
 
template<Player P>
int quiesce (Window, int depth_left, DualThreatmateState)
 
template<Player P>
bool quiesceWithMove (Move, Window &, int, Move &, int &, const DualThreatmateState &)
 
void updateCheckmateCount ()
 
bool tryPass (SimpleHashRecord *record, Player P) const
 
MoveGeneratormakeGenerator ()
 
- Protected Member Functions inherited from osl::search::SearchState2
void setRoot (int limit)
 root で limitを閾値に探索を始めることを設定 More...
 
void addLimit (int limit)
 
void subLimit (int limit)
 
int countSacrificeCheck2 (int history_max) const
 王手の捨て駒の連続を2ループまで数える More...
 
void checkPointSearchAllMoves ()
 debug 用途 More...
 
- Protected Member Functions inherited from osl::search::AlphaBeta2Common< EvalT >
 AlphaBeta2Common (const NumEffectState &s)
 

Static Protected Member Functions

static MoveGeneratoralloc ()
 
static void dealloc (MoveGenerator *)
 
- Static Protected Member Functions inherited from osl::search::AlphaBeta2Common< EvalT >
static int rootLimitBias ()
 
static int leafLimit ()
 

Protected Attributes

size_t node_count
 静止探索も含めたノード数 More...
 
FixedCapacityVector
< MoveGenerator *, MaxDepth
generators
 
stat::Average mpn
 
stat::Average mpn_cut
 
stat::Average alpha_update
 
stat::Average last_alpha_update
 
stat::Average ext
 
stat::Average ext_limit
 
boost::shared_ptr
< AlphaBeta2Parallel< EvalT > > 
shared
 
boost::shared_ptr
< AlphaBeta2SharedRoot
shared_root
 
- Protected Attributes inherited from osl::search::SearchBase< EvalT, SimpleHashTable, CountRecorder, RealizationProbability >
CountRecorderrecorder
 
SimpleHashTabletable
 
- Protected Attributes inherited from osl::search::SearchState2
int root_limit
 
int cur_limit
 
- Protected Attributes inherited from osl::search::SearchState2Core
NumEffectState current_state
 
NumEffectState root_state
 
checkmate_tcheckmate_searcher
 
PathEncoding current_path
 
MoveStack move_history
 
int root_depth
 
RecordStack2 record_stack
 
RepetitionCounter repetition_counter
 
boost::shared_ptr
< SearchState2Shared
shared
 
CArray< PVVector, MaxDepthpv
 
CArray< NodeType, MaxDepthnode_type
 
- Protected Attributes inherited from osl::search::AlphaBeta2Common< EvalT >
EvalT eval
 
PassCounter pass_count
 
CArray< MoveType, MaxDepthmove_type
 現在の深さでの作成状態, nextMove() で利用 More...
 
CArray< bool, MaxDepthin_pv
 
CArray< killer_t, MaxDepthkillers
 
const MoveVector * root_ignore_moves
 
bool prediction_for_speculative_search
 
int multi_pv
 experimental More...
 

Static Protected Attributes

static CArray< int,
SearchState2Core::MaxDepth
depth_node_count
 

Private Member Functions

void throwStop ()
 
void showPV (std::ostream &, int, Move, char stable) const
 

Friends

struct NextMove< BLACK >
 
struct NextMove< WHITE >
 
struct NextQMove< BLACK >
 
struct NextQMove< WHITE >
 

Additional Inherited Members

- Public Attributes inherited from osl::search::SearchState2Core
volatile bool stop_tree
 beta cut in parallel search More...
 
- Static Public Attributes inherited from osl::search::SearchState2
static const int ReSearchLimitMargin = 80
 再探索や,指手生成でより確率の高い手があったときに無視する範囲 More...
 
- Protected Types inherited from osl::search::SearchState2Core
enum  NodeType { PvNode = 0, AllNode = 1, CutNode = -1 }
 
- Protected Types inherited from osl::search::AlphaBeta2Common< EvalT >
enum  { MaxDepth = SearchState2Core::MaxDepth }
 
enum  MoveType {
  INITIAL, HASH =INITIAL, TACTICAL, KILLER,
  PASS, ALL, FINISH
}
 
typedef FixedCapacityVector
< Move, 4 > 
killer_t
 

Detailed Description

template<class EvalT>
class osl::search::AlphaBeta2Tree< EvalT >

"tree" of AlphaBeta2, copied by split

Definition at line 142 of file alphaBeta2.h.

Member Typedef Documentation

template<class EvalT>
typedef AlphaBeta2Common<EvalT> osl::search::AlphaBeta2Tree< EvalT >::common_t

Definition at line 148 of file alphaBeta2.h.

template<class EvalT>
typedef EvalT osl::search::AlphaBeta2Tree< EvalT >::eval_t

Definition at line 147 of file alphaBeta2.h.

template<class EvalT>
typedef AlphaBeta2Window osl::search::AlphaBeta2Tree< EvalT >::Window

Definition at line 179 of file alphaBeta2.h.

Member Enumeration Documentation

template<class EvalT>
anonymous enum
Enumerator
MaxDepth 

Definition at line 149 of file alphaBeta2.h.

Constructor & Destructor Documentation

template<class EvalT >
osl::search::AlphaBeta2Tree< EvalT >::AlphaBeta2Tree ( const NumEffectState &  s,
checkmate_t checker,
SimpleHashTable t,
CountRecorder r 
)
protected

Definition at line 75 of file alphaBeta2.cc.

References osl::search::AlphaBeta2Tree< EvalT >::shared.

template<class EvalT >
osl::search::AlphaBeta2Tree< EvalT >::AlphaBeta2Tree ( const AlphaBeta2Tree< EvalT > &  src,
AlphaBeta2Parallel< EvalT > *   
)
protected

Definition at line 103 of file alphaBeta2.cc.

References osl::search::SearchState2Core::pv.

template<class EvalT >
osl::search::AlphaBeta2Tree< EvalT >::~AlphaBeta2Tree ( )
protected

Definition at line 114 of file alphaBeta2.cc.

Member Function Documentation

template<class EvalT >
void osl::search::AlphaBeta2Tree< EvalT >::addMultiPV ( Player  P,
int  result,
Move  m 
)
protected
template<class EvalT >
osl::search::MoveGenerator * osl::search::AlphaBeta2Tree< EvalT >::alloc ( )
staticprotected

Definition at line 126 of file alphaBeta2.cc.

template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::alphaBetaSearch ( const MoveLogProb move,
Window  window,
bool  in_pv 
)
protected
template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::alphaBetaSearchAfterMove ( const MoveLogProb move,
Window  window,
bool  in_pv 
)
protected
template<class EvalT >
void osl::search::AlphaBeta2Tree< EvalT >::dealloc ( MoveGenerator p)
staticprotected

Definition at line 141 of file alphaBeta2.cc.

template<class EvalT >
template<osl::Player P>
template void osl::search::AlphaBeta2Tree< EvalT >::examineMovesRoot< WHITE > ( const MoveLogProbVector &  ,
size_t  ,
Window  ,
MoveLogProb ,
int &   
)
protected
template<class EvalT>
bool osl::search::AlphaBeta2Tree< EvalT >::isStable ( Player  P,
int  new_value 
) const
protected
template<class EvalT >
osl::search::MoveGenerator & osl::search::AlphaBeta2Tree< EvalT >::makeGenerator ( )
protected

Definition at line 147 of file alphaBeta2.cc.

template<class EvalT>
template<Player P>
const MoveLogProb osl::search::AlphaBeta2Tree< EvalT >::nextMove ( )
template<class EvalT>
template<osl::Player P>
const osl::MoveLogProb osl::search::AlphaBeta2Tree< EvalT >::nextMove ( )
template<class EvalT>
size_t osl::search::AlphaBeta2Tree< EvalT >::nodeCount ( ) const
inline

Definition at line 180 of file alphaBeta2.h.

References osl::search::AlphaBeta2Tree< EvalT >::node_count.

template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::quiesce ( Window  w)
protected

Definition at line 958 of file alphaBeta2.cc.

template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::quiesce ( Window  w,
int  depth_left,
DualThreatmateState  parent_threatmate 
)
protected
template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::quiesceExp ( Window  w)
protected
template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::quiesceRoot ( Window  w,
int  depth_left,
Move best_move,
DualThreatmateState  threatmate 
)
protected
template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::quiesceStable ( Window  w)
protected
template<class EvalT >
template<osl::Player P>
bool osl::search::AlphaBeta2Tree< EvalT >::quiesceWithMove ( Move  move,
Window w,
int  depth_left,
Move best_move,
int &  best_value,
const DualThreatmateState threatmate 
)
protected
template<class EvalT >
int osl::search::AlphaBeta2Tree< EvalT >::rootAlpha ( Player  P,
int  last_value,
Progress16  progress 
)
static
template<class EvalT >
template<osl::Player P>
int osl::search::AlphaBeta2Tree< EvalT >::searchAllMoves ( SimpleHashRecord record,
Window  w 
)
protected
template<class EvalT >
template<osl::Player Turn>
int osl::search::AlphaBeta2Tree< EvalT >::searchAllMoves ( Move  m,
int  limit_consumption,
SimpleHashRecord record,
Window  w 
)
protected
template<class EvalT >
void osl::search::AlphaBeta2Tree< EvalT >::showFailLow ( int  result,
Move  m 
) const
protected

Definition at line 1412 of file alphaBeta2.cc.

References osl::newPtypeO(), osl::PAWN, osl::record::csa::show(), and osl::WHITE.

template<class EvalT >
void osl::search::AlphaBeta2Tree< EvalT >::showPV ( std::ostream &  os,
int  result,
Move  m,
char  stable 
) const
private
template<class EvalT >
int osl::search::AlphaBeta2Tree< EvalT >::stableThreshold ( Player  P,
int  last_value 
)
static
template<class EvalT>
bool osl::search::AlphaBeta2Tree< EvalT >::stopping ( ) const
inline
template<class EvalT>
void osl::search::AlphaBeta2Tree< EvalT >::testStop ( )
inline
template<class EvalT >
template<osl::Player P>
void osl::search::AlphaBeta2Tree< EvalT >::testThreatmate ( SimpleHashRecord record,
bool  in_pv 
)
protected
template<class EvalT>
void osl::search::AlphaBeta2Tree< EvalT >::throwStop ( )
private
template<class EvalT >
template<osl::Player P>
bool osl::search::AlphaBeta2Tree< EvalT >::tryCheckmate ( SimpleHashRecord record,
bool  in_pv,
Move checkmate_move 
)
protected
template<class EvalT >
template<osl::Player P>
bool osl::search::AlphaBeta2Tree< EvalT >::tryCheckmateAgain ( SimpleHashRecord record,
Move checkmate_move,
int  node_count,
int  best_value 
)
protected
template<class EvalT >
bool osl::search::AlphaBeta2Tree< EvalT >::tryPass ( SimpleHashRecord record,
Player  P 
) const
protected
template<class EvalT >
void osl::search::AlphaBeta2Tree< EvalT >::updateCheckmateCount ( )
protected

Definition at line 1259 of file alphaBeta2.cc.

template<class EvalT >
void osl::search::AlphaBeta2Tree< EvalT >::updateRootPV ( Player  P,
std::ostream &  os,
int  result,
Move  m 
)
protected

Friends And Related Function Documentation

template<class EvalT>
friend struct NextMove< BLACK >
friend

Definition at line 194 of file alphaBeta2.h.

template<class EvalT>
friend struct NextMove< WHITE >
friend

Definition at line 196 of file alphaBeta2.h.

template<class EvalT>
friend struct NextQMove< BLACK >
friend

Definition at line 197 of file alphaBeta2.h.

template<class EvalT>
friend struct NextQMove< WHITE >
friend

Definition at line 199 of file alphaBeta2.h.

Member Data Documentation

template<class EvalT>
stat::Average osl::search::AlphaBeta2Tree< EvalT >::alpha_update
protected

Definition at line 154 of file alphaBeta2.h.

template<class EvalT>
osl::CArray< int, osl::search::SearchState2Core::MaxDepth > osl::search::AlphaBeta2Tree< EvalT >::depth_node_count
staticprotected

Definition at line 159 of file alphaBeta2.h.

template<class EvalT>
stat::Average osl::search::AlphaBeta2Tree< EvalT >::ext
protected

Definition at line 155 of file alphaBeta2.h.

template<class EvalT>
stat::Average osl::search::AlphaBeta2Tree< EvalT >::ext_limit
protected

Definition at line 155 of file alphaBeta2.h.

template<class EvalT>
FixedCapacityVector<MoveGenerator*, MaxDepth> osl::search::AlphaBeta2Tree< EvalT >::generators
protected

Definition at line 153 of file alphaBeta2.h.

template<class EvalT>
stat::Average osl::search::AlphaBeta2Tree< EvalT >::last_alpha_update
protected

Definition at line 154 of file alphaBeta2.h.

template<class EvalT>
stat::Average osl::search::AlphaBeta2Tree< EvalT >::mpn
protected

Definition at line 154 of file alphaBeta2.h.

template<class EvalT>
stat::Average osl::search::AlphaBeta2Tree< EvalT >::mpn_cut
protected

Definition at line 154 of file alphaBeta2.h.

template<class EvalT>
size_t osl::search::AlphaBeta2Tree< EvalT >::node_count
protected

静止探索も含めたノード数

Definition at line 152 of file alphaBeta2.h.

Referenced by osl::search::AlphaBeta2Tree< EvalT >::nodeCount().

template<class EvalT>
boost::shared_ptr<AlphaBeta2Parallel<EvalT> > osl::search::AlphaBeta2Tree< EvalT >::shared
protected

Definition at line 156 of file alphaBeta2.h.

Referenced by osl::search::AlphaBeta2Tree< EvalT >::AlphaBeta2Tree().

template<class EvalT>
boost::shared_ptr<AlphaBeta2SharedRoot> osl::search::AlphaBeta2Tree< EvalT >::shared_root
protected

Definition at line 157 of file alphaBeta2.h.

Referenced by osl::search::AlphaBeta2< EvalT >::sharedRootInfo().


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