#include <searchState2.h>


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 |
| SimpleHashRecord * | lastRecord (unsigned int n=0) |
| const SimpleHashRecord * | lastRecord (unsigned int n=0) const |
| SimpleHashRecord * | rootRecord () |
| void | setCurrentRecord (SimpleHashRecord *r) |
| void | setRootRecord (SimpleHashRecord *root) |
| void | setKillerMove (Move best_move) |
| void | getBigramKillerMoves (MoveVector &moves) const |
| void | getKillerMoves (MoveVector &moves) const |
| const BigramKillerMove & | bigramKillerMove () const |
| void | setBigramKillerMove (const BigramKillerMove &killers) |
| HistoryTable & | historyTable () |
| const HistoryTable & | historyTable () 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 RecordStack2 & | recordHistory () const |
| const PathEncoding & | path () const |
| const NumEffectState & | state () const |
| const NumEffectState & | rootState () const |
| void | restoreRootState () |
| const checkmate_t & | checkmateSearcher () const |
| const RepetitionCounter & | repetitionCounter () 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, MaxDepth > | depth_node_count_quiesce |
Protected Types | |
| enum | NodeType { PvNode = 0, AllNode = 1, CutNode = -1 } |
Protected Attributes | |
| NumEffectState | current_state |
| NumEffectState | root_state |
| checkmate_t * | checkmate_searcher |
| PathEncoding | current_path |
| MoveStack | move_history |
| int | root_depth |
| RecordStack2 | record_stack |
| RepetitionCounter | repetition_counter |
| boost::shared_ptr < SearchState2Shared > | shared |
| CArray< PVVector, MaxDepth > | pv |
| CArray< NodeType, MaxDepth > | node_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 |
Definition at line 86 of file searchState2.h.
| typedef DualDfpn osl::search::SearchState2Core::checkmate_t |
Reimplemented in osl::search::AlphaBeta2< EvalT >.
Definition at line 94 of file searchState2.h.
| typedef FixedCapacityVector<Move,MaxDepth> osl::search::SearchState2Core::PVVector |
Definition at line 113 of file searchState2.h.
| anonymous enum |
Definition at line 93 of file searchState2.h.
enum osl::search::SearchState2Core::NodeType [protected] |
Definition at line 116 of file searchState2.h.
| osl::search::SearchState2Core::SearchState2Core | ( | const NumEffectState & | s, |
| checkmate_t & | checker | ||
| ) |
Definition at line 54 of file searchState2.cc.
References hasLastRecord(), and setState().
| osl::search::SearchState2Core::~SearchState2Core | ( | ) | [virtual] |
Definition at line 63 of file searchState2.cc.
| bool osl::search::SearchState2Core::abort | ( | ) | const |
Definition at line 121 of file searchState2.cc.
Referenced by osl::search::SearchState2::abort().
| bool osl::search::SearchState2Core::abort | ( | Move | best_move | ) | const [virtual] |
Reimplemented in osl::search::SearchState2.
Definition at line 127 of file searchState2.cc.
References osl::search::SimpleHashRecord::dump(), and osl::record::csa::show().
| const BigramKillerMove& osl::search::SearchState2Core::bigramKillerMove | ( | ) | const [inline] |
Definition at line 189 of file searchState2.h.
| const checkmate_t& osl::search::SearchState2Core::checkmateSearcher | ( | ) | const [inline] |
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 469 of file searchState2.h.
References osl::search::ThreatmateState::CHECK_AFTER_THREATMATE, depth, and result.
| int osl::search::SearchState2Core::curDepth | ( | ) | 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().
| 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().
| 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().
| HistoryTable& osl::search::SearchState2Core::historyTable | ( | ) | [inline] |
Definition at line 193 of file searchState2.h.
| const HistoryTable& osl::search::SearchState2Core::historyTable | ( | ) | const [inline] |
Definition at line 194 of file searchState2.h.
| void osl::search::SearchState2Core::initPV | ( | ) | [inline] |
Definition at line 443 of file searchState2.h.
References depth.
| bool osl::search::SearchState2Core::isLosingState | ( | int | node_limit | ) | [inline] |
Definition at line 319 of file searchState2.h.
References search_assert.
| 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.
| bool osl::search::SearchState2Core::isThreatmateStateShort | ( | int | depth, |
| Move & | threatmate_move | ||
| ) | [inline] |
Definition at line 408 of file searchState2.h.
References depth, osl::checkmate::FixedDepthSearcher::hasCheckmateMove(), osl::checkmate::ProofDisproof::isCheckmateSuccess(), and search_assert.
| 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().
| 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.
| bool osl::search::SearchState2Core::isWinningStateShort | ( | int | depth, |
| Move & | checkmate_move | ||
| ) | [inline] |
FixedDepthSearcher を呼ぶ
Definition at line 370 of file searchState2.h.
References depth, osl::checkmate::FixedDepthSearcher::hasCheckmateMove(), and osl::checkmate::ProofDisproof::isCheckmateSuccess().
| 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().
| SimpleHashRecord* osl::search::SearchState2Core::lastRecord | ( | unsigned int | n = 0 | ) | [inline] |
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().
| void osl::search::SearchState2Core::makeMove | ( | Move | move | ) | [inline] |
Reimplemented in osl::search::AlphaBeta2< EvalT >.
Definition at line 283 of file searchState2.h.
Referenced by osl::search::AlphaBeta2< EvalT >::makeMove().
| void osl::search::SearchState2Core::makeMoveHook | ( | Move | ) | [private] |
Definition at line 170 of file searchState2.cc.
| void osl::search::SearchState2Core::makePV | ( | Move | m | ) | [inline] |
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().
| const PathEncoding& osl::search::SearchState2Core::path | ( | ) | const [inline] |
Definition at line 294 of file searchState2.h.
Referenced by osl::search::QuiescenceSearch2< EvalT >::depthFromRoot().
| void osl::search::SearchState2Core::popAfterApply | ( | ) | [inline, private] |
ApplyMoveの後に行うこと
Definition at line 259 of file searchState2.h.
References osl::search::RecordStack2::pop(), and osl::RepetitionCounter::pop().
| void osl::search::SearchState2Core::popPass | ( | ) | [inline] |
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().
| void osl::search::SearchState2Core::pushPass | ( | ) | [inline] |
Definition at line 196 of file searchState2.h.
References osl::Move::PASS(), and osl::PathEncoding::pushMove().
| const RecordStack2& osl::search::SearchState2Core::recordHistory | ( | ) | const [inline] |
Definition at line 293 of file searchState2.h.
| const RepetitionCounter& osl::search::SearchState2Core::repetitionCounter | ( | ) | const [inline] |
Definition at line 299 of file searchState2.h.
Definition at line 85 of file searchState2.cc.
| SimpleHashRecord* osl::search::SearchState2Core::rootRecord | ( | ) | [inline] |
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.
| void osl::search::SearchState2Core::setBigramKillerMove | ( | const BigramKillerMove & | killers | ) |
Definition at line 106 of file searchState2.cc.
| void osl::search::SearchState2Core::setCurrentRecord | ( | SimpleHashRecord * | r | ) | [inline] |
Definition at line 152 of file searchState2.h.
References search_assert, osl::search::RecordStack2::setLastRecord(), and osl::search::RecordStack2::size().
Referenced by osl::search::qallocate().
| 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] |
Reimplemented in osl::search::SearchState2.
Definition at line 165 of file searchState2.h.
References osl::Move::isInvalid(), osl::Move::isPass(), osl::Move::player(), and search_assert.
| void osl::search::SearchState2Core::setRootRecord | ( | SimpleHashRecord * | root | ) | [inline] |
Definition at line 157 of file searchState2.h.
References search_assert, osl::search::RecordStack2::setRootRecord(), and osl::search::RecordStack2::size().
| 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] |
Definition at line 295 of file searchState2.h.
Referenced by osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot(), osl::search::QuiescenceSearch2< EvalT >::currentState(), osl::search::MoveGenerator::generateAll(), osl::search::MoveGenerator::generateBreakThreatmate(), osl::search::MoveGenerator::generateCapture(), osl::search::MoveGenerator::generateKingEscape(), osl::search::MoveGenerator::generateTakeBack(), osl::search::MoveGenerator::generateTesuji(), osl::search::QuiescenceSearch2< EvalT >::search(), osl::search::QuiescenceSearch2< EvalT >::searchIteratively(), and osl::search::QuiescenceSearch2< EvalT >::staticValueWithThreat().
| bool osl::search::SearchState2Core::tryThreatmate | ( | ) | const [inline] |
Definition at line 425 of file searchState2.h.
References osl::move_generator::addeffect8::hasEffect(), osl::search::FirstMoveThreatmate::isMember(), osl::Move::isNormal(), osl::Move::ptypeO(), and osl::Move::to().
| 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().
friend struct AlphaBeta2ParallelCommon [friend] |
Definition at line 91 of file searchState2.h.
friend struct Updator [friend] |
Definition at line 248 of file searchState2.h.
Definition at line 97 of file searchState2.h.
Definition at line 105 of file searchState2.h.
NumEffectState osl::search::SearchState2Core::current_state [protected] |
Definition at line 96 of file searchState2.h.
osl::CArray< int, osl::search::SearchState2Core::MaxDepth > osl::search::SearchState2Core::depth_node_count_quiesce [static] |
Definition at line 122 of file searchState2.h.
MoveStack osl::search::SearchState2Core::move_history [protected] |
Definition at line 106 of file searchState2.h.
CArray<NodeType,MaxDepth> osl::search::SearchState2Core::node_type [protected] |
Definition at line 117 of file searchState2.h.
CArray<PVVector,MaxDepth> osl::search::SearchState2Core::pv [protected] |
Definition at line 115 of file searchState2.h.
Referenced by osl::search::AlphaBeta2Tree< EvalT >::AlphaBeta2Tree(), and osl::search::AlphaBeta2< EvalT >::findCheckmateInPV().
Definition at line 109 of file searchState2.h.
Definition at line 110 of file searchState2.h.
int osl::search::SearchState2Core::root_depth [protected] |
Definition at line 107 of file searchState2.h.
NumEffectState osl::search::SearchState2Core::root_state [protected] |
Definition at line 96 of file searchState2.h.
boost::shared_ptr<SearchState2Shared> osl::search::SearchState2Core::shared [protected] |
Reimplemented in osl::search::AlphaBeta2Tree< EvalT >.
Definition at line 111 of file searchState2.h.
| volatile bool osl::search::SearchState2Core::stop_tree |
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().
1.7.6.1