#include <moveGenerator.h>
Public Member Functions | |
MoveGenerator () | |
template<class EvalT > | |
void | init (int limit, const SimpleHashRecord *record, const EvalT &, const NumEffectState &, bool in_pv, Move hash_move, bool quiesce=false) |
template<Player P> | |
const MoveLogProb | nextTacticalMove (const SearchState2 &state) |
template<Player P> | |
const MoveLogProb | nextMove (const SearchState2 &state) |
void | registerMove (const NumEffectState &state, Move m) |
killer move など More... | |
int | triedMoves () const |
const PieceMask & | myPins () const |
void | dump () const |
void | generateAll (Player P, const SearchState2 &state, analyzer::CategoryMoveVector &) |
template<Player P> | |
void | generateAll (const SearchState2 &, MoveLogProbVector &) |
void | generateAll (Player P, const SearchState2 &state, MoveLogProbVector &out) |
const MoveLogProbVector & | generated () const |
template<Player P> | |
void | quiesceCapture (const NumEffectState &, Square) |
template<osl::Player P> | |
const osl::MoveLogProb | nextTacticalMoveWithGeneration (const SearchState2 &state) |
template<osl::Player P> | |
const osl::MoveLogProb | nextMoveWithGeneration (const SearchState2 &state) |
Static Public Member Functions | |
static int | captureValue (Ptype) |
static void | initOnce () |
call this before any use of instance of MoveGenerator More... | |
Private Types | |
enum | State { INITIAL, KING_ESCAPE, TAKE_BACK, BREAK_THREATMATE, CAPTURE, TACTICAL_FINISH, TESUJI, ALL, FINISH } |
typedef void(MoveGenerator::* | generator_t )(const SearchState2 &) |
Private Member Functions | |
template<Player P> | |
const MoveLogProb | nextMoveWithGeneration (const SearchState2 &) |
template<Player P> | |
const MoveLogProb | nextTacticalMoveWithGeneration (const SearchState2 &) |
template<Player P> | |
void | generateKingEscape (const SearchState2 &state) |
template<Player P> | |
void | generateTakeBack (const SearchState2 &state) |
template<Player P> | |
void | generateBreakThreatmate (const SearchState2 &state) |
template<Player P> | |
void | generateCapture (const SearchState2 &state) |
template<Player P> | |
void | generateTesuji (const SearchState2 &state) |
template<Player P> | |
void | generateAllExp (const SearchState2 &state) |
template<Player P> | |
void | generateAll (const SearchState2 &state) |
template<Player P> | |
void | addCapture (const NumEffectState &, const RatingEnv &, const MoveVector &) |
Private Attributes | |
MoveLogProbVector | moves |
int | cur_state |
size_t | cur_index |
const SimpleHashRecord * | record |
int | limit |
int | tried |
MoveMarker | marker |
RatingEnv | env |
Progress32 | progress |
Move | eval_suggestion |
bool | in_quiesce |
bool | in_pv |
Static Private Attributes | |
static const CArray2d < generator_t, 2, FINISH > | Generators |
static const CArray< const char *, FINISH > | GeneratorNames |
Definition at line 53 of file moveGenerator.h.
|
private |
Definition at line 59 of file moveGenerator.h.
|
private |
Enumerator | |
---|---|
INITIAL | |
KING_ESCAPE | |
TAKE_BACK | |
BREAK_THREATMATE | |
CAPTURE | |
TACTICAL_FINISH | |
TESUJI | |
ALL | |
FINISH |
Definition at line 55 of file moveGenerator.h.
osl::search::MoveGenerator::MoveGenerator | ( | ) |
Definition at line 150 of file moveGenerator.cc.
|
private |
Definition at line 350 of file moveGenerator.cc.
References feature_set(), osl::Move::from(), osl::Move::isDrop(), osl::KING, osl::rating::FeatureSet::logProbSeePlus(), max_see, moves, osl::Move::ptype(), and osl::Move::to().
|
static |
Definition at line 155 of file moveGenerator.cc.
References osl::eval::PtypeEvalTable::captureValue(), osl::isPiece(), osl::newPtypeO(), osl::eval::Ptype_Eval_Table, result, and osl::WHITE.
void osl::search::MoveGenerator::dump | ( | ) | const |
Definition at line 194 of file moveGenerator.cc.
References moves.
void osl::search::MoveGenerator::generateAll | ( | Player | P, |
const SearchState2 & | state, | ||
analyzer::CategoryMoveVector & | out | ||
) |
Definition at line 487 of file moveGenerator.cc.
References moves, and osl::playerToIndex().
Referenced by osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot().
void osl::search::MoveGenerator::generateAll | ( | const SearchState2 & | state, |
MoveLogProbVector & | out | ||
) |
Definition at line 512 of file moveGenerator.cc.
References osl::search::SearchState2Core::state(), and osl::MoveLogProb::validMove().
void osl::search::MoveGenerator::generateAll | ( | Player | P, |
const SearchState2 & | state, | ||
MoveLogProbVector & | out | ||
) |
Definition at line 530 of file moveGenerator.cc.
References osl::BLACK, and out.
|
private |
Definition at line 446 of file moveGenerator.cc.
References osl::alt(), feature_set(), osl::Move::from(), osl::rating::FeatureSet::generateLogProb(), osl::Move::isCaptureOrPromotion(), osl::Move::isDrop(), osl::KING, limit, osl::MoveLogProb::logProb(), osl::eval::min(), osl::MoveLogProb::move(), moves, osl::Move::ptype(), osl::search::SearchState2Core::state(), and osl::Move::to().
|
private |
|
private |
Definition at line 284 of file moveGenerator.cc.
References osl::search::BreakThreatmate::generate(), osl::Move::isNormal(), osl::MoveLogProb::move(), moves, and osl::search::SearchState2Core::state().
|
private |
Definition at line 384 of file moveGenerator.cc.
References osl::search::SearchState2Core::state().
|
inline |
Definition at line 125 of file moveGenerator.h.
References moves.
|
private |
Definition at line 251 of file moveGenerator.cc.
References osl::alt(), feature_set(), osl::move_generator::GenerateEscape< P >::generate(), osl::search::SearchState2Core::history(), osl::eval::min(), moves, osl::Piece::square(), osl::search::SearchState2Core::state(), and osl::unpromote().
|
private |
Definition at line 297 of file moveGenerator.cc.
References feature_set(), osl::Move::from(), osl::move_generator::GenerateCapture::generate(), osl::Move::isDrop(), osl::KING, osl::search::SearchState2Core::lastMove(), osl::rating::FeatureSet::logProbTakeBack(), osl::eval::min(), moves, osl::Move::ptype(), osl::search::SearchState2Core::state(), and osl::Move::to().
|
private |
Definition at line 407 of file moveGenerator.cc.
References osl::move_generator::capture::generate(), moves, and osl::search::SearchState2Core::state().
void osl::search::MoveGenerator::init | ( | int | limit, |
const SimpleHashRecord * | record, | ||
const EvalT & | eval, | ||
const NumEffectState & | state, | ||
bool | in_pv, | ||
Move | hash_move, | ||
bool | quiesce = false |
||
) |
Definition at line 167 of file moveGenerator.cc.
References osl::alt(), osl::Move::isNormal(), and moves.
Referenced by osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot(), osl::search::AlphaBeta2Tree< EvalT >::nextMove(), osl::search::AlphaBeta2Tree< EvalT >::quiesce(), and osl::search::AlphaBeta2Tree< EvalT >::quiesceRoot().
|
static |
call this before any use of instance of MoveGenerator
Definition at line 43 of file moveGenerator.cc.
References osl::rating::StandardFeatureSet::instance().
Referenced by osl::search::AlphaBeta2< EvalT >::AlphaBeta2().
|
inline |
Definition at line 115 of file moveGenerator.h.
References env.
|
inline |
Definition at line 93 of file moveGenerator.h.
References cur_index, cur_state, FINISH, moves, TACTICAL_FINISH, and tried.
Referenced by osl::search::AlphaBeta2Tree< EvalT >::nextMove(), osl::search::AlphaBeta2Tree< EvalT >::quiesce(), and osl::search::AlphaBeta2Tree< EvalT >::quiesceRoot().
|
private |
const osl::MoveLogProb osl::search::MoveGenerator::nextMoveWithGeneration | ( | const SearchState2 & | state) |
Definition at line 231 of file moveGenerator.cc.
References moves, and osl::playerToIndex().
|
inline |
P | turn |
Definition at line 83 of file moveGenerator.h.
References cur_index, cur_state, moves, TACTICAL_FINISH, and tried.
Referenced by osl::search::AlphaBeta2Tree< EvalT >::nextMove(), osl::search::AlphaBeta2Tree< EvalT >::quiesce(), and osl::search::AlphaBeta2Tree< EvalT >::quiesceRoot().
|
private |
const osl::MoveLogProb osl::search::MoveGenerator::nextTacticalMoveWithGeneration | ( | const SearchState2 & | state) |
Definition at line 207 of file moveGenerator.cc.
References moves, and osl::playerToIndex().
void osl::search::MoveGenerator::quiesceCapture | ( | const NumEffectState & | state, |
Square | to | ||
) |
Definition at line 428 of file moveGenerator.cc.
References osl::move_generator::GenerateCapture::generate(), max_see, and moves.
|
inline |
killer move など
Definition at line 106 of file moveGenerator.h.
References osl::Move::isNormal(), marker, osl::search::MoveMarker::registerMove(), and tried.
|
inline |
Definition at line 114 of file moveGenerator.h.
References tried.
|
private |
Definition at line 64 of file moveGenerator.h.
Referenced by nextMove(), and nextTacticalMove().
|
private |
Definition at line 63 of file moveGenerator.h.
Referenced by nextMove(), and nextTacticalMove().
|
private |
Definition at line 69 of file moveGenerator.h.
Referenced by myPins().
|
private |
Definition at line 71 of file moveGenerator.h.
|
staticprivate |
Definition at line 61 of file moveGenerator.h.
|
staticprivate |
Definition at line 60 of file moveGenerator.h.
|
private |
Definition at line 75 of file moveGenerator.h.
|
private |
Definition at line 73 of file moveGenerator.h.
|
private |
Definition at line 66 of file moveGenerator.h.
|
private |
Definition at line 68 of file moveGenerator.h.
Referenced by registerMove().
|
private |
Definition at line 62 of file moveGenerator.h.
Referenced by generated(), nextMove(), and nextTacticalMove().
|
private |
Definition at line 70 of file moveGenerator.h.
|
private |
Definition at line 65 of file moveGenerator.h.
|
private |
Definition at line 67 of file moveGenerator.h.
Referenced by nextMove(), nextTacticalMove(), registerMove(), and triedMoves().