AlphaBeta の書き直し版 More...
#include <alphaBeta2.h>
Public Types | |
typedef AlphaBeta2Tree< EvalT > | base_t |
typedef base_t::checkmate_t | checkmate_t |
typedef base_t::Window | Window |
Public Member Functions | |
AlphaBeta2 (const NumEffectState &s, checkmate_t &checker, SimpleHashTable *t, CountRecorder &) | |
~AlphaBeta2 () | |
template<Player P> | |
int | alphaBetaSearchRoot (Window window, MoveLogProb &best_move, int limit) |
entrance of alpha beta window search. | |
int | alphaBetaSearchRoot (Window window, MoveLogProb &best_move, int limit) |
int | alphaBetaSearchRoot (MoveLogProb &best_move, int limit) |
Move | computeBestMoveIteratively (int limit, const int step=100, int initialLimit=600, size_t nodeLimit=1600000, const TimeAssigned &assign=TimeAssigned(MilliSeconds::Interval(60 *1000)), MoveWithComment *additional_info=0) |
entrance of alpha beta iterative search. | |
bool | isReasonableMove (Move move, int pawn_sacrifice=1) |
void | setRootIgnoreMoves (const MoveVector *rim, bool prediction) |
void | enableMultiPV (unsigned int width) |
const AlphaBeta2SharedRoot | sharedRootInfo () const |
void | setRoot (int limit) |
root で limitを閾値に探索を始めることを設定 | |
void | makeMove (Move) |
Static Public Member Functions | |
static const Window | fullWindow (Player P) |
static void | showNodeDepth (std::ostream &) |
static void | clearNodeDepth () |
Private Types | |
enum | PVCheckmateStatus { PVStable, PVThreatmateNotRecord, PVThreatmate, PVCheckmate } |
Private Member Functions | |
PVCheckmateStatus | findCheckmateInPV (int verify_node, CArray< bool, 2 > &king_in_threat) |
AlphaBeta の書き直し版
Definition at line 284 of file alphaBeta2.h.
typedef AlphaBeta2Tree<EvalT> osl::search::AlphaBeta2< EvalT >::base_t |
Definition at line 288 of file alphaBeta2.h.
typedef base_t::checkmate_t osl::search::AlphaBeta2< EvalT >::checkmate_t |
Reimplemented from osl::search::SearchState2Core.
Definition at line 289 of file alphaBeta2.h.
typedef base_t::Window osl::search::AlphaBeta2< EvalT >::Window |
Reimplemented from osl::search::AlphaBeta2Tree< EvalT >.
Definition at line 290 of file alphaBeta2.h.
enum osl::search::AlphaBeta2::PVCheckmateStatus [private] |
Definition at line 344 of file alphaBeta2.h.
osl::search::AlphaBeta2< EvalT >::AlphaBeta2 | ( | const NumEffectState & | s, |
checkmate_t & | checker, | ||
SimpleHashTable * | t, | ||
CountRecorder & | r | ||
) |
Definition at line 1650 of file alphaBeta2.cc.
References osl::search::MoveGenerator::initOnce().
osl::search::AlphaBeta2< EvalT >::~AlphaBeta2 | ( | ) |
Definition at line 1659 of file alphaBeta2.cc.
int osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot | ( | Window | window, |
MoveLogProb & | best_move, | ||
int | limit | ||
) |
entrance of alpha beta window search.
see http://www.logos.t.u-tokyo.ac.jp/~gekisashi/algorithm/re_search.html. rootDepth, curLimit are initialized here.
Definition at line 2071 of file alphaBeta2.cc.
References osl::search::SimpleHashTable::allocate(), osl::search::AlphaBeta2Window::alpha(), osl::alt(), osl::search::SimpleHashRecord::bestMove(), osl::search::QuiescenceRecord::bestMove(), osl::search::AlphaBeta2Window::beta(), osl::eval::betterThan(), osl::search::QuiescenceRecord::checkmateNodesLeft(), count, osl::eval::delta(), osl::container::GeneralSimpleHashTable< Record >::find(), osl::Move::from(), osl::search::MoveGenerator::generateAll(), osl::search::SimpleHashRecord::hasGreaterLowerBound(), osl::search::SimpleHashRecord::hasUpperBound(), osl::search::SearchTable::HistorySpecialDepth, osl::search::MoveGenerator::init(), osl::Move::INVALID(), osl::Move::isDrop(), osl::Move::isNormal(), osl::search::DualThreatmateState::isThreatmate(), osl::search::SimpleHashTable::isVerbose(), osl::KING, osl::OslConfig::lock_io, osl::eval::max(), osl::eval::min(), osl::MoveLogProb::move(), osl::Move::move, moves, osl::newPtypeO(), osl::PieceStand::order, osl::Move::PASS(), osl::PAWN, osl::Move::ptype(), osl::search::SimpleHashRecord::qrecord, osl::search::SimpleHashRecord::resetValue(), result, osl::OslConfig::searchExactValueInOneReply(), osl::search::SimpleHashRecord::setInCheck(), osl::search::SimpleHashRecord::setLowerBound(), osl::search::DualThreatmateState::setThreatmate(), osl::search::SimpleHashRecord::threatmate(), osl::Move::to(), osl::search::SimpleHashRecord::upperBound(), osl::OslConfig::usiOutputPawnValue(), osl::MoveLogProb::validMove(), and osl::search::SimpleHashTable::verboseLevel().
int osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot | ( | Window | window, |
MoveLogProb & | best_move, | ||
int | limit | ||
) | [inline] |
Definition at line 309 of file alphaBeta2.h.
References osl::BLACK, limit, and osl::search::SearchState2Core::state().
int osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot | ( | MoveLogProb & | best_move, |
int | limit | ||
) |
Definition at line 1748 of file alphaBeta2.cc.
void osl::search::AlphaBeta2< EvalT >::clearNodeDepth | ( | ) | [static] |
Definition at line 2532 of file alphaBeta2.cc.
osl::Move osl::search::AlphaBeta2< EvalT >::computeBestMoveIteratively | ( | int | limit, |
const int | step = 100 , |
||
int | initialLimit = 600 , |
||
size_t | nodeLimit = 1600000 , |
||
const TimeAssigned & | assign = TimeAssigned(MilliSeconds::Interval(60*1000)) , |
||
MoveWithComment * | additional_info = 0 |
||
) |
entrance of alpha beta iterative search.
Definition at line 1757 of file alphaBeta2.cc.
References osl::search::SimpleHashRecord::addNodeCount(), osl::Move::capturePtype(), osl::ctime_r(), osl::search::MoveWithComment::elapsed, osl::container::GeneralSimpleHashTable< Record >::find(), finish, osl::move_generator::capture::generate(), osl::search::SearchTable::HistorySpecialDepth, osl::Move::INVALID(), osl::isMajor(), osl::isMajorNonPieceOK(), osl::Move::isNormal(), osl::search::SimpleHashTable::isVerbose(), osl::OslConfig::lock_io, osl::search::SimpleHashRecord::lowerBound(), osl::search::SimpleHashRecord::lowerLimit(), osl::eval::max(), osl::OslConfig::memoryUseRatio(), osl::eval::min(), osl::search::MoveWithComment::move, osl::MoveLogProb::move(), osl::search::MoveWithComment::moves, moves, osl::newPtypeO(), osl::search::MoveWithComment::node_count, osl::search::SearchTimerCommon::NoMoreMemory, osl::search::SearchTimerCommon::NoMoreTime, osl::PAWN, osl::search::MoveWithComment::root_limit, osl::record::csa::show(), osl::search::SearchTimerCommon::StopByOutside, osl::Move::to(), osl::search::SimpleHashRecord::upperBound(), osl::OslConfig::usiMode(), osl::search::MoveWithComment::value, osl::search::SimpleHashTable::verboseLevel(), and osl::WHITE.
void osl::search::AlphaBeta2< EvalT >::enableMultiPV | ( | unsigned int | width | ) | [inline] |
Definition at line 338 of file alphaBeta2.h.
References osl::search::AlphaBeta2Common< EvalT >::multi_pv, and width.
osl::search::AlphaBeta2< EvalT >::PVCheckmateStatus osl::search::AlphaBeta2< EvalT >::findCheckmateInPV | ( | int | verify_node, |
CArray< bool, 2 > & | king_in_threat | ||
) | [private] |
Definition at line 1665 of file alphaBeta2.cc.
References osl::search::SimpleHashTable::allocate(), osl::alt(), osl::search::DualThreatmateState::isThreatmate(), osl::search::SimpleHashTable::isVerbose(), osl::Move::PASS(), osl::PathEncoding::pushMove(), osl::search::SearchState2Core::pv, osl::search::DualThreatmateState::setThreatmate(), osl::record::csa::show(), and osl::search::SimpleHashRecord::threatmate().
static const Window osl::search::AlphaBeta2< EvalT >::fullWindow | ( | Player | P | ) | [inline, static] |
Definition at line 305 of file alphaBeta2.h.
References osl::alt(), and osl::search::FixedEval::winThreshold().
bool osl::search::AlphaBeta2< EvalT >::isReasonableMove | ( | Move | move, |
int | pawn_sacrifice = 1 |
||
) |
Definition at line 2491 of file alphaBeta2.cc.
void osl::search::AlphaBeta2< EvalT >::makeMove | ( | Move | move | ) |
Reimplemented from osl::search::SearchState2Core.
Definition at line 2475 of file alphaBeta2.cc.
References osl::search::SimpleHashTable::allocate(), osl::search::SearchState2Core::makeMove(), and osl::search::SimpleHashRecord::setInCheck().
void osl::search::AlphaBeta2< EvalT >::setRoot | ( | int | limit | ) |
root で limitを閾値に探索を始めることを設定
Reimplemented from osl::search::SearchState2.
Definition at line 2465 of file alphaBeta2.cc.
References osl::search::SimpleHashTable::allocate(), osl::eval::max(), and osl::search::SearchState2::setRoot().
void osl::search::AlphaBeta2< EvalT >::setRootIgnoreMoves | ( | const MoveVector * | rim, |
bool | prediction | ||
) | [inline] |
Definition at line 329 of file alphaBeta2.h.
References osl::search::AlphaBeta2Common< EvalT >::prediction_for_speculative_search, and osl::search::AlphaBeta2Common< EvalT >::root_ignore_moves.
const AlphaBeta2SharedRoot osl::search::AlphaBeta2< EvalT >::sharedRootInfo | ( | ) | const [inline] |
Definition at line 339 of file alphaBeta2.h.
References osl::search::AlphaBeta2Tree< EvalT >::shared_root.
Referenced by osl::game_playing::AlphaBeta2OpenMidEndingEvalPlayer::analyzeWithSeconds().
void osl::search::AlphaBeta2< EvalT >::showNodeDepth | ( | std::ostream & | os | ) | [static] |
Definition at line 2498 of file alphaBeta2.cc.
References osl::eval::max(), and max_depth.