#include <alphaBeta3.h>
Classes | |
struct | CallQuiesce |
struct | CallSearch |
struct | PVInfo |
struct | PVVector |
struct | SearchInfo |
Public Types | |
enum | MoveCategory { Initial, KingEscape, Pass, TakeBack, Capture, Killer, CaptureAll, All } |
enum | { MaxDepth = 64 } |
enum | NodeType { PvNode = 0, CutNode = 1, AllNode = -1 } |
typedef SearchState2::checkmate_t | checkmate_t |
typedef eval::ml::OpenMidEndingEval | eval_t |
Public Member Functions | |
AlphaBeta3 (const NumEffectState &s, checkmate_t &checker, SimpleHashTable *t, CountRecorder &) | |
~AlphaBeta3 () | |
Move | computeBestMoveIteratively (int limit, int step, int initial_limit=600, size_t node_limit=1600000, const TimeAssigned &assign=TimeAssigned(MilliSeconds::Interval(60 *1000)), MoveWithComment *additional_info=0) |
bool | isReasonableMove (Move move, int pawn_sacrifice=1) |
void | setRootIgnoreMoves (const MoveVector *rim, bool) |
void | setHistory (const MoveStack &h) |
void | enableMultiPV (unsigned int) |
template<osl::Player P> | |
osl::Move | nextMove () |
template<osl::Player P> | |
void | generateAllMoves (const NumEffectState &state, const SearchInfo &parent, SearchInfo &node) |
template<osl::Player P> | |
void | generateCapture (const NumEffectState &state, SearchInfo &node) |
template<osl::Player P> | |
bool | seePlusLight (const NumEffectState &state, Move m) |
template<osl::Player P> | |
void | generateCaptureAll (const NumEffectState &state, SearchInfo &node) |
![]() | |
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 void | showNodeDepth (std::ostream &) |
static void | clearNodeDepth () |
template<Player P> | |
static void | generateAllMoves (const NumEffectState &state, const SearchInfo &, SearchInfo &) |
template<Player P> | |
static void | generateCapture (const NumEffectState &state, SearchInfo &) |
template<Player P> | |
static void | generateCaptureAll (const NumEffectState &state, SearchInfo &) |
template<Player P> | |
static bool | seePlusLight (const NumEffectState &state, Move m) |
![]() | |
static void | adjustMemoryUseLimit (double scale=0.9) |
メモリとノード数の関係を調整. More... | |
Private Member Functions | |
Move | searchRoot (int limit) |
template<Player P> | |
int | makeMoveAndSearch (Move, int consume) |
template<Player P> | |
void | presearch () |
template<Player P> | |
void | search () |
template<Player P> | |
Move | nextMove () |
template<Player P> | |
void | quiesceRoot () |
template<Player P> | |
int | makeMoveAndQuiesce (Move) |
template<Player P> | |
void | quiesce () |
bool | reductionOk () const |
int | evalValue () const |
![]() | |
FixedEval () | |
void | setDrawValue (int value) |
int | drawValue () const |
~FixedEval () | |
Private Attributes | |
volatile int | stop_by_alarm |
NumEffectState | state |
int | depth |
CountRecorder & | recorder |
SimpleHashTable * | table_common |
Friends | |
struct | CallSearch< BLACK > |
struct | CallSearch< WHITE > |
struct | CallQuiesce< BLACK > |
struct | CallQuiesce< WHITE > |
Additional Inherited Members | |
![]() | |
static int | winByFoul (Player P) |
相手の王手千日手,打歩詰. More... | |
static int | winByLoop (Player P) |
駒得するループ. More... | |
static int | winByCheckmate (Player P) |
詰による勝 More... | |
static int | minusInfty (Player P) |
探索windowの下限 (負けでも更新される値) More... | |
static int | winThreshold (Player P) |
この値を越えれば勝. More... | |
static int | windowMax (Player P) |
探索して意味がある範囲 (偶数) More... | |
static int | brinkmatePenalty (Player P, int limit) |
必死(に見える)局面の評価値 Pが負けそう More... | |
static int | threatmatePenalty (Player P) |
末端で詰めろがかかっている場合のペナルティ. More... | |
static int | isWinValue (Player P, int val) |
勝かどうか. More... | |
Definition at line 21 of file alphaBeta3.h.
Definition at line 25 of file alphaBeta3.h.
Definition at line 26 of file alphaBeta3.h.
anonymous enum |
Enumerator | |
---|---|
MaxDepth |
Definition at line 47 of file alphaBeta3.h.
Enumerator | |
---|---|
Initial | |
KingEscape | |
Pass | |
TakeBack | |
Capture | |
Killer | |
CaptureAll | |
All |
Definition at line 46 of file alphaBeta3.h.
Enumerator | |
---|---|
PvNode | |
CutNode | |
AllNode |
Definition at line 48 of file alphaBeta3.h.
osl::search::AlphaBeta3::AlphaBeta3 | ( | const NumEffectState & | s, |
checkmate_t & | checker, | ||
SimpleHashTable * | t, | ||
CountRecorder & | r | ||
) |
Definition at line 142 of file alphaBeta3.cc.
References osl::rating::StandardFeatureSet::instance(), and MaxDepth.
osl::search::AlphaBeta3::~AlphaBeta3 | ( | ) |
Definition at line 153 of file alphaBeta3.cc.
|
static |
Definition at line 261 of file alphaBeta3.cc.
osl::Move osl::search::AlphaBeta3::computeBestMoveIteratively | ( | int | limit, |
int | step, | ||
int | initial_limit = 600 , |
||
size_t | node_limit = 1600000 , |
||
const TimeAssigned & | assign = TimeAssigned(MilliSeconds::Interval(60*1000)) , |
||
MoveWithComment * | additional_info = 0 |
||
) |
Definition at line 168 of file alphaBeta3.cc.
References osl::search::BigramKillerMove::clear(), osl::stat::Average::clear(), osl::search::CompactHashTable::clear(), osl::stat::Average::getAverage(), limit, osl::eval::min(), osl::search::CompactHashTable::probe_fail, osl::search::CompactHashTable::probe_success, and osl::search::CompactHashTable::table.
|
inline |
Definition at line 40 of file alphaBeta3.h.
|
private |
Definition at line 158 of file alphaBeta3.cc.
References depth.
|
static |
void osl::search::AlphaBeta3::generateAllMoves | ( | const NumEffectState & | state, |
const SearchInfo & | parent, | ||
SearchInfo & | node | ||
) |
Definition at line 735 of file alphaBeta3.cc.
References osl::search::AlphaBeta3::SearchInfo::alpha, osl::search::AlphaBeta3::SearchInfo::beta, osl::eval::betterThan(), cut_drop_move_in_frontier_node, osl::eval::delta(), osl::search::AlphaBeta3::SearchInfo::eval, extended_futility_margin, extended_futility_pruning_enabled, futility_pruning_enabled, osl::rating::FeatureSet::generateRating(), osl::search::AlphaBeta3::SearchInfo::height, osl::search::AlphaBeta3::SearchInfo::in_check, osl::rating::StandardFeatureSet::instance(), moves, osl::search::AlphaBeta3::SearchInfo::moves, osl::search::AlphaBeta3::SearchInfo::node_type, and osl::eval::ml::OpenMidEndingEval::value().
|
static |
void osl::search::AlphaBeta3::generateCapture | ( | const NumEffectState & | state, |
SearchInfo & | node | ||
) |
Definition at line 771 of file alphaBeta3.cc.
References osl::move_generator::capture::generate(), osl::move_generator::GenerateCapture::generate(), osl::PtypeTable::getIndexLimit(), osl::PtypeTable::getIndexMin(), osl::Piece::isOnBoardByOwner(), osl::search::AlphaBeta3::SearchInfo::moves, osl::PieceStand::order, osl::PAWN, osl::Ptype_Table, osl::Piece::square(), and store().
|
static |
void osl::search::AlphaBeta3::generateCaptureAll | ( | const NumEffectState & | state, |
SearchInfo & | node | ||
) |
Definition at line 835 of file alphaBeta3.cc.
References osl::move_generator::GenerateCapture::generate(), osl::PtypeTable::getIndexLimit(), osl::PtypeTable::getIndexMin(), osl::Piece::isOnBoardByOwner(), osl::search::AlphaBeta3::SearchInfo::moves, osl::PieceStand::order, osl::Ptype_Table, osl::Piece::square(), and store().
bool osl::search::AlphaBeta3::isReasonableMove | ( | Move | move, |
int | pawn_sacrifice = 1 |
||
) |
Definition at line 242 of file alphaBeta3.cc.
|
private |
Definition at line 935 of file alphaBeta3.cc.
References depth.
|
private |
Definition at line 369 of file alphaBeta3.cc.
References osl::search::AlphaBeta3::SearchInfo::alpha, osl::search::AlphaBeta3::SearchInfo::beta, depth, osl::search::AlphaBeta3::SearchInfo::eval, osl::search::AlphaBeta3::SearchInfo::extended, osl::search::AlphaBeta3::SearchInfo::hash_key, osl::Sennichite::hasWinner(), osl::search::AlphaBeta3::SearchInfo::height, osl::Sennichite::isDraw(), osl::Move::isNormal(), osl::search::AlphaBeta3::SearchInfo::moved, osl::search::AlphaBeta3::SearchInfo::node_type, osl::PathEncoding::path, osl::search::AlphaBeta3::SearchInfo::path, osl::PathEncoding::popMove(), osl::PathEncoding::pushMove(), osl::search::AlphaBeta3::SearchInfo::pv, and osl::Sennichite::winner().
|
private |
osl::Move osl::search::AlphaBeta3::nextMove | ( | ) |
Definition at line 671 of file alphaBeta3.cc.
References osl::All, depth, osl::move_generator::GenerateCapture::generate(), osl::move_generator::GenerateEscape< P >::generate(), osl::search::KillerMoveTable::getMove(), osl::search::BigramKillerMove::getMove(), osl::search::AlphaBeta3::SearchInfo::in_check, osl::Move::isNormal(), osl::search::AlphaBeta3::SearchInfo::move_index, osl::search::AlphaBeta3::SearchInfo::move_type, osl::search::AlphaBeta3::SearchInfo::moved, osl::search::AlphaBeta3::SearchInfo::moves, osl::search::AlphaBeta3::SearchInfo::node_type, osl::Move::PASS(), osl::TakeBack, and osl::Move::to().
|
private |
Definition at line 422 of file alphaBeta3.cc.
References osl::search::AlphaBeta3::SearchInfo::alpha, osl::alt(), osl::search::CompactRecord::best_move, best_move_extension_enabled, osl::search::AlphaBeta3::SearchInfo::beta, osl::eval::betterThan(), depth, osl::search::AlphaBeta3::SearchInfo::eval, osl::search::AlphaBeta3::SearchInfo::extended, osl::search::AlphaBeta3::SearchInfo::hash_key, osl::search::AlphaBeta3::SearchInfo::height, osl::search::AlphaBeta3::SearchInfo::in_check, osl::Move::isNormal(), osl::Move::isPass(), osl::KING, lmr_enabled, lmr_fullwidth, lmr_reduce_limit, lmr_verify_enabled, osl::eval::min(), osl::search::AlphaBeta3::SearchInfo::moved, moves, osl::search::AlphaBeta3::SearchInfo::node_type, osl::search::CompactHashTable::probe(), osl::search::AlphaBeta3::SearchInfo::search_value, table_record_limit, osl::Move::to(), and osl::eval::ml::OpenMidEndingEval::update().
|
private |
Definition at line 957 of file alphaBeta3.cc.
References osl::search::AlphaBeta3::SearchInfo::alpha, osl::alt(), osl::search::AlphaBeta3::SearchInfo::beta, osl::eval::betterThan(), osl::eval::ml::OpenMidEndingEval::captureValue(), osl::eval::delta(), depth, osl::search::AlphaBeta3::SearchInfo::eval, osl::move_generator::GenerateCapture::generate(), osl::move_generator::GenerateEscape< P >::generate(), osl::PtypeTable::getIndexLimit(), osl::PtypeTable::getIndexMin(), immediate_checkmate_enabled, osl::search::AlphaBeta3::SearchInfo::in_check, osl::Piece::isOnBoardByOwner(), osl::eval::min(), osl::search::AlphaBeta3::SearchInfo::moved, osl::search::AlphaBeta3::SearchInfo::moves, osl::newPtypeO(), osl::search::AlphaBeta3::SearchInfo::node_type, osl::PieceStand::order, osl::search::promoteIf(), osl::Ptype_Table, osl::search::AlphaBeta3::SearchInfo::pv, osl::search::AlphaBeta3::SearchInfo::search_value, osl::search::AlphaBeta3::PVVector::setPV(), osl::Piece::square(), and osl::eval::ml::OpenMidEndingEval::update().
|
private |
Definition at line 866 of file alphaBeta3.cc.
References osl::search::AlphaBeta3::SearchInfo::alpha, osl::alt(), osl::search::AlphaBeta3::SearchInfo::beta, osl::eval::betterThan(), osl::eval::ml::OpenMidEndingEval::captureValue(), osl::eval::delta(), depth, osl::search::AlphaBeta3::SearchInfo::eval, osl::move_generator::GenerateCapture::generate(), osl::move_generator::GenerateEscape< P >::generate(), osl::PtypeTable::getIndexLimit(), osl::PtypeTable::getIndexMin(), immediate_checkmate_enabled, osl::search::AlphaBeta3::SearchInfo::in_check, osl::Piece::isOnBoardByOwner(), osl::search::AlphaBeta3::SearchInfo::moves, osl::newPtypeO(), osl::search::AlphaBeta3::SearchInfo::node_type, osl::PieceStand::order, osl::search::promoteIf(), osl::Ptype_Table, osl::search::AlphaBeta3::SearchInfo::pv, osl::search::AlphaBeta3::SearchInfo::search_value, osl::search::AlphaBeta3::PVVector::setPV(), and osl::Piece::square().
|
inlineprivate |
Definition at line 409 of file alphaBeta3.cc.
References depth, osl::search::AlphaBeta3::SearchInfo::in_check, osl::Move::isCaptureOrPromotion(), and osl::search::AlphaBeta3::SearchInfo::moved.
|
private |
Definition at line 541 of file alphaBeta3.cc.
References osl::stat::Average::add(), osl::eval::betterThan(), osl::eval::delta(), depth, osl::search::CompactRecord::Exact, extended_futility_margin, extended_futility_pruning_enabled, futility_margin, futility_pruning_enabled, immediate_checkmate_enabled, osl::Move::isInvalid(), osl::search::CompactRecord::LowerBound, osl::search::CompactHashTable::probe(), osl::search::BigramKillerMove::setMove(), osl::search::KillerMoveTable::setMove(), osl::search::CompactHashTable::store(), table_record_limit, and osl::search::CompactRecord::UpperBound.
|
private |
Definition at line 267 of file alphaBeta3.cc.
References osl::search::AlphaBeta3::SearchInfo::alpha, osl::alt(), osl::search::CompactRecord::best_move, osl::search::AlphaBeta3::SearchInfo::beta, osl::eval::betterThan(), osl::BLACK, osl::search::ShouldPromoteCut::canIgnoreAndNotDrop(), decorate_csa_in_pv, osl::eval::delta(), depth, osl::search::AlphaBeta3::SearchInfo::eval, osl::search::CompactRecord::Exact, osl::find(), osl::move_generator::capture::generate(), osl::rating::FeatureSet::generateRating(), osl::search::AlphaBeta3::SearchInfo::hash_key, osl::search::AlphaBeta3::SearchInfo::height, osl::rating::StandardFeatureSet::instance(), osl::Move::isNormal(), limit, osl::search::CompactRecord::limit, osl::search::AlphaBeta3::SearchInfo::moved, moves, osl::search::AlphaBeta3::SearchInfo::moves, osl::search::AlphaBeta3::SearchInfo::node_type, osl::Move::PASS(), osl::search::AlphaBeta3::SearchInfo::path, osl::search::CompactHashTable::probe(), osl::search::AlphaBeta3::SearchInfo::pv, osl::search::SimpleHashRecord::setLowerBound(), osl::search::AlphaBeta3::PVVector::setPV(), osl::record::csa::show(), show_height_in_pv, osl::search::CompactHashTable::store(), osl::search::CompactRecord::type, and osl::search::CompactRecord::value.
|
static |
|
inline |
Definition at line 823 of file alphaBeta3.cc.
References osl::Move::capturePtype(), osl::Move::isDrop(), osl::Move::oldPtype(), osl::Move::player(), osl::eval::Ptype_Eval_Table, osl::Move::to(), and osl::eval::PtypeEvalTable::value().
void osl::search::AlphaBeta3::setHistory | ( | const MoveStack & | h) |
Definition at line 252 of file alphaBeta3.cc.
void osl::search::AlphaBeta3::setRootIgnoreMoves | ( | const MoveVector * | rim, |
bool | |||
) |
Definition at line 248 of file alphaBeta3.cc.
|
static |
Definition at line 257 of file alphaBeta3.cc.
|
friend |
Definition at line 87 of file alphaBeta3.h.
|
friend |
Definition at line 88 of file alphaBeta3.h.
|
friend |
Definition at line 84 of file alphaBeta3.h.
|
friend |
Definition at line 86 of file alphaBeta3.h.
|
private |
Definition at line 100 of file alphaBeta3.h.
|
private |
Definition at line 101 of file alphaBeta3.h.
|
private |
Definition at line 99 of file alphaBeta3.h.
|
private |
Definition at line 98 of file alphaBeta3.h.
|
private |
Definition at line 102 of file alphaBeta3.h.