My Project
|
#include <proofNumberTable.h>
Classes | |
struct | Liberty |
Public Member Functions | |
void | init () |
const Liberty | countLiberty (Ptype ptype, Direction d, unsigned int liberty_mask) const |
dir 方向からの王手をかけた時のlibertyの予想 | |
const Liberty | countLibertyShortNotKnight (Player player, Square to, Ptype ptype, Square king, King8Info info) const |
8近傍へのdropまたは取れない移動後のlibertyの予測値を返す. | |
const Liberty | countLibertyLong (Player player, Square to, Ptype ptype, Square king, King8Info info) const |
int | countLiberty (const NumEffectState &state, int liberty_count, Move move, Square king, King8Info info) const |
move は王手である必要がある | |
int | countLiberty (const NumEffectState &state, Move move) const |
テスト用 | |
int | libertyAfterAllDrop (const NumEffectState &state) const |
drop のみ | |
int | libertyAfterAllDrop (const NumEffectState &state, Player attack, King8Info info) const |
int | libertyAfterAllMove (const NumEffectState &state) const |
移動 のみ | |
int | libertyAfterAllMove (const NumEffectState &state, Player attack, King8Info info, Square king) const |
int | libertyAfterAllCheck (const NumEffectState &state) const |
全て | |
int | disproofAfterAllCheck (const NumEffectState &, Player, King8Info) const |
const ProofDisproof | attackEstimation (const NumEffectState &state) const |
全て | |
const ProofDisproof | attackEstimation (const NumEffectState &state, Player attack, King8Info info, Square king) const |
Private Attributes | |
CArray2d< CArray< Liberty, DIRECTION_SIZE >, 0x100u, PTYPE_SIZE > | liberties |
一つの王手 -> Liberty: long なdirection は1マスあけた王手を意味する | |
CArray2d< uint8_t, 0x10000u, 8 > | drop_liberty |
全ての有効drop -> 最小liberty. | |
CArray2d< uint8_t, 0x100u, 0x100u > | pmajor_liberty |
龍や馬で王手をかけられる時のliberty: [liberty][move_mask] | |
CArray2d< uint8_t, 0x100u, 0x100u > | promote_liberty |
王が1,2段目にいる時の移動王手によるliberty: [liberty][move_mask]. | |
CArray2d< uint8_t, 0x100u, 0x100u > | other_move_liberty |
それ以外の移動liberty: [liberty][move_mask] | |
Definition at line 15 of file proofNumberTable.h.
const osl::checkmate::ProofDisproof osl::checkmate::ProofNumberTable::attackEstimation | ( | const NumEffectState & | state | ) | const |
全て
Definition at line 356 of file proofNumberTable.cc.
References osl::alt(), osl::NumEffectState::Iking8Info(), osl::SimpleState::kingSquare(), and osl::SimpleState::turn().
Referenced by osl::checkmate::FixedDepthSolverExt::SetProofPieces::attackEstimation().
const osl::checkmate::ProofDisproof osl::checkmate::ProofNumberTable::attackEstimation | ( | const NumEffectState & | state, |
Player | attack, | ||
King8Info | info, | ||
Square | king | ||
) | const |
Definition at line 343 of file proofNumberTable.cc.
|
inline |
move は王手である必要がある
Definition at line 100 of file proofNumberTable.h.
References osl::alt(), osl::misc::BitOp::countBit(), osl::NumEffectState::countEffect(), countLibertyLong(), countLibertyShortNotKnight(), osl::checkmate::ProofNumberTable::Liberty::has_effect, osl::effect_util::AdditionalEffect::hasEffect(), osl::Move::isDrop(), osl::Square::isNeighboring8(), osl::KNIGHT, osl::checkmate::King8Info::liberty(), osl::checkmate::ProofNumberTable::Liberty::liberty, osl::Move::player(), osl::Move::ptype(), and osl::Move::to().
int osl::checkmate::ProofNumberTable::countLiberty | ( | const NumEffectState & | state, |
Move | move | ||
) | const |
テスト用
Definition at line 224 of file proofNumberTable.cc.
References osl::alt(), osl::NumEffectState::Iking8Info(), osl::SimpleState::kingSquare(), osl::checkmate::King8Info::libertyCount(), and osl::Move::player().
|
inline |
dir 方向からの王手をかけた時のlibertyの予想
Definition at line 50 of file proofNumberTable.h.
References liberties, osl::UUL, and osl::UUR.
Referenced by osl::checkmate::PureLibertyEstimator::attackH(), countLibertyLong(), and countLibertyShortNotKnight().
|
inline |
Definition at line 74 of file proofNumberTable.h.
References osl::BLACK, osl::Board_Table, countLiberty(), osl::BoardTable::getLongDirection(), osl::BoardTable::getShortOffsetNotKnight(), osl::isLong(), osl::isMajor(), osl::Square::isNeighboring8(), osl::LANCE, osl::checkmate::King8Info::liberty(), osl::unpromote(), osl::WHITE, and osl::Offset::zero().
Referenced by countLiberty().
|
inline |
8近傍へのdropまたは取れない移動後のlibertyの予測値を返す.
玉は取り返せる時でも取り返さない値. 桂馬は表をひく必要がないので呼び出し側で処理する.
Definition at line 62 of file proofNumberTable.h.
References osl::BLACK, osl::Board_Table, countLiberty(), osl::BoardTable::getShort8(), osl::Square::isNeighboring8(), osl::KNIGHT, osl::checkmate::King8Info::liberty(), and osl::WHITE.
Referenced by countLiberty().
int osl::checkmate::ProofNumberTable::disproofAfterAllCheck | ( | const NumEffectState & | state, |
Player | attack, | ||
King8Info | info | ||
) | const |
Definition at line 329 of file proofNumberTable.cc.
References osl::checkmate::King8Info::countMoveCandidate(), osl::checkmate::King8Info::dropCandidate(), osl::GOLD, osl::SimpleState::hasPieceOnStand(), and osl::SILVER.
void osl::checkmate::ProofNumberTable::init | ( | ) |
Definition at line 83 of file proofNumberTable.cc.
References osl::dirToMask(), osl::PtypeTable::getMoveMask(), osl::GOLD, osl::checkmate::ProofNumberTable::Liberty::has_effect, osl::isPiece(), osl::KING, osl::checkmate::ProofNumberTable::Liberty::liberty, osl::LONG_DIRECTION_MAX, osl::LONG_DIRECTION_MIN, osl::PBISHOP, osl::PKNIGHT, osl::PLANCE, osl::PPAWN, osl::PROOK, osl::PSILVER, osl::PTYPE_BASIC_MIN, osl::PTYPE_MAX, osl::PTYPE_PIECE_MIN, osl::Ptype_Table, osl::shortToLong(), and osl::U.
int osl::checkmate::ProofNumberTable::libertyAfterAllCheck | ( | const NumEffectState & | state | ) | const |
全て
Definition at line 365 of file proofNumberTable.cc.
int osl::checkmate::ProofNumberTable::libertyAfterAllDrop | ( | const NumEffectState & | state | ) | const |
drop のみ
Definition at line 254 of file proofNumberTable.cc.
References osl::alt(), osl::NumEffectState::Iking8Info(), and osl::SimpleState::turn().
int osl::checkmate::ProofNumberTable::libertyAfterAllDrop | ( | const NumEffectState & | state, |
Player | attack, | ||
King8Info | info | ||
) | const |
Definition at line 233 of file proofNumberTable.cc.
References osl::GOLD, osl::SimpleState::hasPieceOnStand(), osl::checkmate::King8Info::libertyCount(), osl::checkmate::King8Info::libertyDropMask(), osl::ROOK, and osl::SimpleState::turn().
int osl::checkmate::ProofNumberTable::libertyAfterAllMove | ( | const NumEffectState & | state | ) | const |
移動 のみ
Definition at line 320 of file proofNumberTable.cc.
References osl::alt(), osl::NumEffectState::Iking8Info(), osl::SimpleState::kingSquare(), and osl::SimpleState::turn().
int osl::checkmate::ProofNumberTable::libertyAfterAllMove | ( | const NumEffectState & | state, |
Player | attack, | ||
King8Info | info, | ||
Square | king | ||
) | const |
Definition at line 262 of file proofNumberTable.cc.
References osl::alt(), osl::BLACK, osl::Board_Table, osl::Square::canPromote(), osl::BoardTable::getOffset(), osl::GOLD, osl::NumEffectState::hasEffectByPtype(), osl::isMajor(), osl::Piece::isOnBoardByOwner(), osl::isPromoted(), osl::checkmate::King8Info::liberty(), osl::checkmate::King8Info::moveCandidateMask(), osl::SimpleState::pieceOf(), osl::Piece::ptype(), osl::Piece::ptypeO(), osl::Piece::square(), osl::Square::squareForBlack(), osl::U, osl::WHITE, and osl::Square::y().
|
private |
全ての有効drop -> 最小liberty.
liberty 8bit + 有効drop 8bit + 最小値 -> ptype mask
Definition at line 35 of file proofNumberTable.h.
|
private |
一つの王手 -> Liberty: long なdirection は1マスあけた王手を意味する
Definition at line 31 of file proofNumberTable.h.
Referenced by countLiberty().
|
private |
それ以外の移動liberty: [liberty][move_mask]
Definition at line 43 of file proofNumberTable.h.
|
private |
龍や馬で王手をかけられる時のliberty: [liberty][move_mask]
Definition at line 37 of file proofNumberTable.h.
|
private |
王が1,2段目にいる時の移動王手によるliberty: [liberty][move_mask].
それ以外でUに金類が移動できる場合もこれで良いか.
Definition at line 41 of file proofNumberTable.h.