"tree" of AlphaBeta2, copied by split More...
#include <alphaBeta2.h>
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 |
![]() | |
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 () |
![]() | |
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... | |
![]() | |
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 |
![]() | |
SearchState2Core (const NumEffectState &s, checkmate_t &checker) | |
virtual | ~SearchState2Core () |
int | curDepth () const |
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 More... | |
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 を更新しない 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 |
![]() | |
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 TimeAssigned & | timeAssigned () 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 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 |
MoveGenerator & | makeGenerator () |
![]() | |
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... | |
![]() | |
AlphaBeta2Common (const NumEffectState &s) | |
Static Protected Member Functions | |
static MoveGenerator * | alloc () |
static void | dealloc (MoveGenerator *) |
![]() | |
static int | rootLimitBias () |
static int | leafLimit () |
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 | |
![]() | |
volatile bool | stop_tree |
beta cut in parallel search More... | |
![]() | |
static const int | ReSearchLimitMargin = 80 |
再探索や,指手生成でより確率の高い手があったときに無視する範囲 More... | |
![]() | |
enum | NodeType { PvNode = 0, AllNode = 1, CutNode = -1 } |
![]() | |
enum | { MaxDepth = SearchState2Core::MaxDepth } |
enum | MoveType { INITIAL, HASH =INITIAL, TACTICAL, KILLER, PASS, ALL, FINISH } |
typedef FixedCapacityVector < Move, 4 > | killer_t |
"tree" of AlphaBeta2, copied by split
Definition at line 142 of file alphaBeta2.h.
typedef AlphaBeta2Common<EvalT> osl::search::AlphaBeta2Tree< EvalT >::common_t |
Definition at line 148 of file alphaBeta2.h.
typedef EvalT osl::search::AlphaBeta2Tree< EvalT >::eval_t |
Definition at line 147 of file alphaBeta2.h.
typedef AlphaBeta2Window osl::search::AlphaBeta2Tree< EvalT >::Window |
Definition at line 179 of file alphaBeta2.h.
anonymous enum |
Enumerator | |
---|---|
MaxDepth |
Definition at line 149 of file alphaBeta2.h.
|
protected |
Definition at line 75 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Tree< EvalT >::shared.
|
protected |
Definition at line 103 of file alphaBeta2.cc.
References osl::search::SearchState2Core::pv.
|
protected |
Definition at line 114 of file alphaBeta2.cc.
|
protected |
Definition at line 1385 of file alphaBeta2.cc.
References osl::alt(), osl::search::SimpleHashTable::isVerbose(), osl::OslConfig::lock_io, osl::newPtypeO(), osl::PAWN, and osl::OslConfig::usiOutputPawnValue().
|
staticprotected |
Definition at line 126 of file alphaBeta2.cc.
|
protected |
alphaBetaSearch (move)
Definition at line 1501 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::search::AlphaBeta2Window::beta(), osl::search::DominanceCheck::detect(), osl::Sennichite::hasWinner(), osl::Sennichite::isDraw(), osl::Sennichite::isNormal(), osl::search::DominanceCheck::LOSE, osl::MoveLogProb::move(), osl::eval::notLessThan(), result, osl::search::DominanceCheck::WIN, and osl::Sennichite::winner().
|
protected |
Definition at line 164 of file alphaBeta2.cc.
References osl::search::SimpleHashRecord::addNodeCount(), osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::search::SimpleHashRecord::bestMove(), osl::search::AlphaBeta2Window::beta(), osl::eval::betterThan(), osl::search::ThreatmateState::CHECK_AFTER_THREATMATE, osl::search::SimpleHashRecord::inCheck(), osl::Move::isNormal(), limit, osl::MoveLogProb::logProb(), osl::eval::max(), osl::search::DualThreatmateState::mayHaveCheckmate(), osl::OslConfig::memoryUseLimit(), osl::eval::min(), osl::MoveLogProb::move(), osl::eval::notLessThan(), osl::search::AlphaBeta2Window::null(), osl::Move::player(), result, osl::search::SimpleHashRecord::setInCheck(), osl::search::DualThreatmateState::status(), osl::search::ThreatmateState::status(), and osl::search::SimpleHashRecord::threatmate().
|
staticprotected |
Definition at line 141 of file alphaBeta2.cc.
|
protected |
alpha値が求まった後で他の手を調べる
Definition at line 1580 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::eval::betterThan(), osl::eval::delta(), osl::search::SimpleHashTable::isVerbose(), osl::OslConfig::lock_io, osl::MoveLogProb::move(), moves, osl::newPtypeO(), osl::PAWN, result, and width.
|
protected |
|
protected |
Definition at line 147 of file alphaBeta2.cc.
const MoveLogProb osl::search::AlphaBeta2Tree< EvalT >::nextMove | ( | ) |
const osl::MoveLogProb osl::search::AlphaBeta2Tree< EvalT >::nextMove | ( | ) |
Definition at line 528 of file alphaBeta2.cc.
References osl::search::SimpleHashRecord::bestMove(), osl::Move::capturePtype(), osl::search::SimpleHashRecord::inCheck(), osl::search::MoveGenerator::init(), osl::search::DualThreatmateState::maybeThreatmate(), osl::MoveLogProb::move(), osl::search::MoveGenerator::nextMove(), osl::search::MoveGenerator::nextTacticalMove(), osl::Move::PASS(), osl::MoveLogProb::setLogProbAtMost(), osl::search::RealizationProbability::TableMove, osl::search::SimpleHashRecord::threatmate(), and osl::MoveLogProb::validMove().
|
inline |
Definition at line 180 of file alphaBeta2.h.
References osl::search::AlphaBeta2Tree< EvalT >::node_count.
|
protected |
Definition at line 958 of file alphaBeta2.cc.
|
protected |
Definition at line 1149 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::search::AlphaBeta2Window::beta(), osl::eval::betterThan(), osl::eval::delta(), finish, osl::checkmate::ImmediateCheckmate::hasCheckmateMove(), osl::search::SimpleHashRecord::inCheck(), osl::search::MoveGenerator::init(), osl::eval::max(), osl::search::DualThreatmateState::maybeThreatmate(), osl::search::DualThreatmateState::mayHaveCheckmate(), osl::search::MoveGenerator::nextMove(), osl::search::MoveGenerator::nextTacticalMove(), osl::Move::PASS(), osl::PAWN, osl::search::SimpleHashRecord::setInCheck(), osl::search::DualThreatmateState::updateInLock(), and osl::MoveLogProb::validMove().
|
protected |
Definition at line 999 of file alphaBeta2.cc.
References osl::search::SimpleHashRecord::qrecord, result, osl::search::QuiescenceRecord::setLowerBound(), and osl::search::SimpleHashRecord::threatmate().
|
protected |
Definition at line 1073 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::search::QuiescenceRecord::bestMove(), osl::search::AlphaBeta2Window::beta(), osl::eval::betterThan(), osl::eval::delta(), finish, osl::search::SimpleHashRecord::inCheck(), osl::search::MoveGenerator::init(), osl::Move::isNormal(), osl::eval::max(), osl::search::DualThreatmateState::maybeThreatmate(), osl::search::MoveGenerator::nextMove(), osl::search::MoveGenerator::nextTacticalMove(), osl::Move::PASS(), osl::PAWN, osl::search::SimpleHashRecord::qrecord, and osl::MoveLogProb::validMove().
|
protected |
Definition at line 970 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::search::AlphaBeta2Window::beta(), count, osl::Move::isInvalid(), osl::Move::PASS(), and result.
|
protected |
Definition at line 1041 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::search::AlphaBeta2Window::beta(), osl::eval::betterThan(), osl::eval::delta(), osl::search::AlphaBeta2Window::null(), and result.
|
static |
Definition at line 1275 of file alphaBeta2.cc.
References osl::alt(), osl::eval::betterThan(), osl::eval::delta(), osl::KING, osl::newPtypeO(), osl::PAWN, and width.
|
protected |
Definition at line 613 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::search::AlphaBeta2Window::beta(), osl::eval::betterThan(), osl::search::QuiescenceRecord::checkmateNodesLeft(), osl::search::SearchTable::CheckmateSpecialDepth, osl::Move::DeclareWin(), osl::eval::delta(), osl::search::SimpleHashRecord::hasGreaterLowerBound(), osl::search::SimpleHashRecord::hasLesserUpperBound(), osl::search::SimpleHashRecord::hasLowerBound(), osl::search::SimpleHashRecord::hasUpperBound(), osl::search::SearchTable::HistorySpecialDepth, osl::search::SimpleHashRecord::inCheck(), osl::Move::INVALID(), osl::Move::isCapture(), osl::search::AlphaBeta2Window::isConsistent(), osl::eval::isConsistentValue(), osl::Move::isNormal(), osl::Move::isValid(), osl::MoveLogProb::logProb(), osl::search::SimpleHashRecord::lowerBound(), osl::eval::max(), osl::search::DualThreatmateState::maybeThreatmate(), osl::MoveLogProb::move(), osl::search::AlphaBeta2Window::null(), osl::Move::player(), osl::search::SimpleHashRecord::qrecord, result, search_assert, osl::search::SimpleHashRecord::threatmate(), osl::search::QuiescenceRecord::threatmateNodes(), osl::search::SimpleHashRecord::upperBound(), osl::OslConfig::usiMode(), and osl::MoveLogProb::validMove().
|
protected |
Definition at line 285 of file alphaBeta2.cc.
References osl::search::AlphaBeta2Window::alpha(), osl::eval::betterThan(), osl::search::AlphaBeta2Window::null(), and result.
|
protected |
Definition at line 1412 of file alphaBeta2.cc.
References osl::newPtypeO(), osl::PAWN, osl::record::csa::show(), and osl::WHITE.
|
private |
Definition at line 1423 of file alphaBeta2.cc.
References osl::misc::eucToLang(), osl::container::GeneralSimpleHashTable< Record >::find(), osl::Move::isNormal(), osl::search::DualThreatmateState::isThreatmate(), K_TSUMERO, osl::OslConfig::memoryUseRatio(), osl::newPtypeO(), osl::PAWN, osl::record::csa::show(), osl::record::ki2::show(), osl::search::SimpleHashRecord::threatmate(), osl::OslConfig::usiMode(), and osl::WHITE.
|
static |
Definition at line 1309 of file alphaBeta2.cc.
References osl::alt(), osl::eval::betterThan(), osl::eval::delta(), osl::KING, osl::newPtypeO(), osl::PAWN, and width.
|
inline |
Definition at line 169 of file alphaBeta2.h.
References osl::search::SearchState2Core::stop_tree, and osl::search::SearchTimer::stopping().
|
inline |
|
protected |
詰めろの有無を確認
Definition at line 307 of file alphaBeta2.cc.
References count, osl::search::SimpleHashRecord::inCheck(), osl::search::DualThreatmateState::isThreatmate(), osl::eval::max(), osl::search::SimpleHashRecord::nodeCount(), osl::search::SimpleHashRecord::qrecord, osl::search::DualThreatmateState::setThreatmate(), osl::search::SimpleHashRecord::threatmate(), and osl::search::QuiescenceRecord::threatmateNodesLeft().
|
private |
|
protected |
初めの方で詰みを読む
Definition at line 380 of file alphaBeta2.cc.
References osl::alt(), checkmate_limit, osl::search::QuiescenceRecord::checkmateNodesLeft(), count, depth, osl::checkmate::limitToCheckCount(), osl::eval::max(), osl::search::DualThreatmateState::maybeThreatmate(), osl::search::DualThreatmateState::mayHaveCheckmate(), osl::eval::min(), osl::search::SimpleHashRecord::nodeCount(), osl::search::SimpleHashRecord::qrecord, and osl::search::SimpleHashRecord::threatmate().
|
protected |
負けそうな時にさらに詰みを読む
Definition at line 448 of file alphaBeta2.cc.
References osl::alt(), osl::eval::betterThan(), checkmate_limit, osl::search::SimpleHashRecord::checkmateNodes(), osl::search::QuiescenceRecord::checkmateNodesLeft(), count, osl::search::SimpleHashRecord::inCheck(), osl::isMajorNonPieceOK(), osl::KING, osl::eval::max(), osl::search::DualThreatmateState::maybeThreatmate(), osl::search::DualThreatmateState::mayHaveCheckmate(), osl::newPtypeO(), osl::search::SimpleHashRecord::nodeCount(), osl::search::SimpleHashRecord::qrecord, and osl::search::SimpleHashRecord::threatmate().
|
protected |
Definition at line 519 of file alphaBeta2.cc.
References osl::search::SimpleHashRecord::inCheck(), osl::search::DualThreatmateState::maybeThreatmate(), and osl::search::SimpleHashRecord::threatmate().
|
protected |
Definition at line 1259 of file alphaBeta2.cc.
|
protected |
Definition at line 1341 of file alphaBeta2.cc.
References osl::alt(), osl::eval::betterThan(), osl::search::SimpleHashTable::isVerbose(), osl::KING, osl::KNIGHT, osl::OslConfig::lock_io, osl::newPtypeO(), osl::PAWN, osl::eval::Ptype_Eval_Table, result, threshold, and osl::OslConfig::usiOutputPawnValue().
Definition at line 194 of file alphaBeta2.h.
Definition at line 196 of file alphaBeta2.h.
Definition at line 197 of file alphaBeta2.h.
Definition at line 199 of file alphaBeta2.h.
|
protected |
Definition at line 154 of file alphaBeta2.h.
|
staticprotected |
Definition at line 159 of file alphaBeta2.h.
|
protected |
Definition at line 155 of file alphaBeta2.h.
|
protected |
Definition at line 155 of file alphaBeta2.h.
|
protected |
Definition at line 153 of file alphaBeta2.h.
|
protected |
Definition at line 154 of file alphaBeta2.h.
|
protected |
Definition at line 154 of file alphaBeta2.h.
|
protected |
Definition at line 154 of file alphaBeta2.h.
|
protected |
静止探索も含めたノード数
Definition at line 152 of file alphaBeta2.h.
Referenced by osl::search::AlphaBeta2Tree< EvalT >::nodeCount().
|
protected |
Definition at line 156 of file alphaBeta2.h.
Referenced by osl::search::AlphaBeta2Tree< EvalT >::AlphaBeta2Tree().
|
protected |
Definition at line 157 of file alphaBeta2.h.
Referenced by osl::search::AlphaBeta2< EvalT >::sharedRootInfo().