All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Attributes | Private Member Functions | Friends
osl::search::SearchState2Core Class Reference

#include <searchState2.h>

Inheritance diagram for osl::search::SearchState2Core:
Inheritance graph
[legend]
Collaboration diagram for osl::search::SearchState2Core:
Collaboration graph
[legend]

List of all members.

Classes

struct  UpdateWrapper
struct  Updator

Public Types

enum  { MaxDepth = 64 }
typedef DualDfpn checkmate_t
typedef FixedCapacityVector
< Move, MaxDepth
PVVector

Public Member Functions

 SearchState2Core (const NumEffectState &s, checkmate_t &checker)
virtual ~SearchState2Core ()
int curDepth () const
virtual void setState (const NumEffectState &s)
 state のコピーを行う.
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
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 を更新しない
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 を呼ぶ
template<Player P>
bool isThreatmateState (int node_limit, Move &threatmate_move, bool=false)
 P の手番でPの玉に詰めろがかかっているかどうか
template<Player P>
bool isThreatmateStateShort (int depth, Move &threatmate_move)
bool abort () const
virtual bool abort (Move) 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 の側が連続王手で詰ろを逃れている回数
int countCheckAfterThreatmateSacrifice (Player turn, int depth=1) const

Static Public Member Functions

template<Player P>
static bool isWinningState (checkmate_t &search, NumEffectState &state, const HashKey &key, PathEncoding path, int node_limit, Move &checkmate_move, Move last_move, bool=false)
static bool isWinningState (checkmate_t &search, NumEffectState &state, const HashKey &key, PathEncoding path, int node_limit, Move &checkmate_move, Move last_move, bool parallel=false)

Public Attributes

volatile bool stop_tree
 beta cut in parallel search

Static Public Attributes

static CArray< int, MaxDepthdepth_node_count_quiesce

Protected Types

enum  NodeType { PvNode = 0, AllNode = 1, CutNode = -1 }

Protected Attributes

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

Private Member Functions

void pushBeforeApply (Move move)
 ApplyMoveの前に行うこと
void updateRepetitionCounterAfterMove (const HashKey &new_hash)
 pushBeforeApply の後,ApplyMoveの中,Functionを呼ぶ前に呼ばれる
void popAfterApply ()
 ApplyMoveの後に行うこと
void makeMoveHook (Move)

Friends

struct AlphaBeta2ParallelCommon
struct Updator

Detailed Description

Definition at line 86 of file searchState2.h.


Member Typedef Documentation

Reimplemented in osl::search::AlphaBeta2< EvalT >.

Definition at line 94 of file searchState2.h.

Definition at line 113 of file searchState2.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
MaxDepth 

Definition at line 93 of file searchState2.h.

Enumerator:
PvNode 
AllNode 
CutNode 

Definition at line 116 of file searchState2.h.


Constructor & Destructor Documentation

osl::search::SearchState2Core::SearchState2Core ( const NumEffectState &  s,
checkmate_t checker 
)

Definition at line 54 of file searchState2.cc.

References hasLastRecord(), and setState().

Definition at line 63 of file searchState2.cc.


Member Function Documentation

Definition at line 121 of file searchState2.cc.

Referenced by osl::search::SearchState2::abort().

bool osl::search::SearchState2Core::abort ( Move  best_move) const [virtual]

Definition at line 189 of file searchState2.h.

Definition at line 298 of file searchState2.h.

int osl::search::SearchState2Core::countCheckAfterThreatmate ( Player  turn,
int  depth = 1 
) const [inline]

turn の側が連続王手で詰ろを逃れている回数

Definition at line 454 of file searchState2.h.

References osl::search::ThreatmateState::CHECK_AFTER_THREATMATE, depth, and result.

int osl::search::SearchState2Core::countCheckAfterThreatmateSacrifice ( Player  turn,
int  depth = 1 
) const [inline]

Definition at line 126 of file searchState2.h.

const HashKey& osl::search::SearchState2Core::currentHash ( ) const [inline]

Definition at line 302 of file searchState2.h.

References osl::RepetitionCounter::history().

template<Player P, class Function >
void osl::search::SearchState2Core::doUndoMoveLight ( Move  move,
Function &  f 
) [inline]

軽量化版 doUndo 千日手情報や, hash を更新しない

Definition at line 311 of file searchState2.h.

References osl::PathEncoding::popMove(), and osl::PathEncoding::pushMove().

template<Player P, class Function >
void osl::search::SearchState2Core::doUndoMoveOrPass ( const HashKey &  new_hash,
Move  move,
Function &  f 
) [inline]

まともなdoUndo

Definition at line 273 of file searchState2.h.

References osl::PathEncoding::popMove(), and osl::PathEncoding::pushMove().

void osl::search::SearchState2Core::getBigramKillerMoves ( MoveVector &  moves) const [inline]

Definition at line 176 of file searchState2.h.

void osl::search::SearchState2Core::getKillerMoves ( MoveVector &  moves) const [inline]

Definition at line 184 of file searchState2.h.

bool osl::search::SearchState2Core::hasLastRecord ( unsigned int  n = 0) const [inline]

Definition at line 136 of file searchState2.h.

References osl::search::RecordStack2::hasLastRecord().

Referenced by SearchState2Core().

const MoveStack& osl::search::SearchState2Core::history ( ) const [inline]

Definition at line 292 of file searchState2.h.

Referenced by osl::search::MoveGenerator::generateKingEscape().

Definition at line 193 of file searchState2.h.

Definition at line 194 of file searchState2.h.

Definition at line 443 of file searchState2.h.

References depth.

template<Player P>
bool osl::search::SearchState2Core::isLosingState ( int  node_limit) [inline]

Definition at line 319 of file searchState2.h.

References search_assert.

template<Player P>
bool osl::search::SearchState2Core::isThreatmateState ( int  node_limit,
Move threatmate_move,
bool  = false 
) [inline]

P の手番でPの玉に詰めろがかかっているかどうか

Definition at line 380 of file searchState2.h.

References osl::Move::PASS(), and search_assert.

template<Player P>
bool osl::search::SearchState2Core::isThreatmateStateShort ( int  depth,
Move threatmate_move 
) [inline]
template<Player P>
static bool osl::search::SearchState2Core::isWinningState ( checkmate_t search,
NumEffectState &  state,
const HashKey &  key,
PathEncoding  path,
int  node_limit,
Move checkmate_move,
Move  last_move,
bool  = false 
) [inline, static]

Definition at line 329 of file searchState2.h.

References osl::PathEncoding::turn().

static bool osl::search::SearchState2Core::isWinningState ( checkmate_t search,
NumEffectState &  state,
const HashKey &  key,
PathEncoding  path,
int  node_limit,
Move checkmate_move,
Move  last_move,
bool  parallel = false 
) [inline, static]

Definition at line 349 of file searchState2.h.

References osl::BLACK, and search().

template<Player P>
bool osl::search::SearchState2Core::isWinningState ( int  node_limit,
Move checkmate_move,
bool  parallel = false 
) [inline]

Definition at line 362 of file searchState2.h.

References search_assert.

template<Player P>
bool osl::search::SearchState2Core::isWinningStateShort ( int  depth,
Move checkmate_move 
) [inline]
const Move osl::search::SearchState2Core::lastMove ( int  i = 1) const [inline]

Definition at line 291 of file searchState2.h.

Referenced by osl::search::MoveGenerator::generateTakeBack().

Definition at line 140 of file searchState2.h.

References osl::search::RecordStack2::lastRecord().

const SimpleHashRecord* osl::search::SearchState2Core::lastRecord ( unsigned int  n = 0) const [inline]

Definition at line 144 of file searchState2.h.

References osl::search::RecordStack2::lastRecord().

Reimplemented in osl::search::AlphaBeta2< EvalT >.

Definition at line 283 of file searchState2.h.

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

Definition at line 170 of file searchState2.cc.

Definition at line 438 of file searchState2.h.

References depth.

void osl::search::SearchState2Core::makePV ( PVVector parent,
Move  m,
PVVector pv 
) const

Definition at line 146 of file searchState2.cc.

References osl::Move::isPass().

ApplyMoveの後に行うこと

Definition at line 259 of file searchState2.h.

References osl::search::RecordStack2::pop(), and osl::RepetitionCounter::pop().

Definition at line 203 of file searchState2.h.

References osl::alt(), osl::Move::PASS(), and osl::PathEncoding::popMove().

void osl::search::SearchState2Core::pushBeforeApply ( Move  move) [inline, private]

ApplyMoveの前に行うこと

Definition at line 214 of file searchState2.h.

References osl::search::RecordStack2::push().

Definition at line 196 of file searchState2.h.

References osl::Move::PASS(), and osl::PathEncoding::pushMove().

Definition at line 293 of file searchState2.h.

Definition at line 299 of file searchState2.h.

Definition at line 85 of file searchState2.cc.

Definition at line 148 of file searchState2.h.

References osl::search::RecordStack2::rootRecord().

const NumEffectState& osl::search::SearchState2Core::rootState ( ) const [inline]

Definition at line 296 of file searchState2.h.

Definition at line 106 of file searchState2.cc.

void osl::search::SearchState2Core::setHistory ( const MoveStack &  h)

Definition at line 98 of file searchState2.cc.

void osl::search::SearchState2Core::setKillerMove ( Move  best_move) [inline]
void osl::search::SearchState2Core::setState ( const NumEffectState &  s) [virtual]

state のコピーを行う.

this->state は探索終了後も保存されるが,探索中に exception が起こると 破壊されている

Reimplemented in osl::search::SearchState2.

Definition at line 68 of file searchState2.cc.

Referenced by SearchState2Core(), and osl::search::SearchState2::setState().

const NumEffectState& osl::search::SearchState2Core::state ( ) const [inline]
void osl::search::SearchState2Core::updateRepetitionCounterAfterMove ( const HashKey &  new_hash) [inline, private]

pushBeforeApply の後,ApplyMoveの中,Functionを呼ぶ前に呼ばれる

Definition at line 252 of file searchState2.h.

References osl::RepetitionCounter::push().


Friends And Related Function Documentation

friend struct AlphaBeta2ParallelCommon [friend]

Definition at line 91 of file searchState2.h.

friend struct Updator [friend]

Definition at line 248 of file searchState2.h.


Member Data Documentation

Definition at line 97 of file searchState2.h.

Definition at line 105 of file searchState2.h.

Definition at line 96 of file searchState2.h.

Definition at line 122 of file searchState2.h.

Definition at line 106 of file searchState2.h.

Definition at line 117 of file searchState2.h.

Definition at line 109 of file searchState2.h.

Definition at line 110 of file searchState2.h.

Definition at line 107 of file searchState2.h.

NumEffectState osl::search::SearchState2Core::root_state [protected]

Definition at line 96 of file searchState2.h.

Reimplemented in osl::search::AlphaBeta2Tree< EvalT >.

Definition at line 111 of file searchState2.h.

beta cut in parallel search

Definition at line 120 of file searchState2.h.

Referenced by osl::search::AlphaBeta2Tree< EvalT >::stopping(), and osl::search::AlphaBeta2Tree< EvalT >::testStop().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines