My Project
|
#include <feature.h>
Public Types | |
enum | { SupportSize = PTYPE_SIZE , AttackSize = PTYPE_SIZE , AttackBase = SupportSize , EffectSize = 9 , EffectBase = AttackBase+AttackSize , OpKingSize = 4 , OpKingBase = EffectBase+EffectSize , MyKingSize = 3 , MyKingBase = OpKingBase+OpKingSize , PromotionSize = 2 , PromotionBase = MyKingBase+MyKingSize , PinOpenSize = 4 , PinOpenBase = PromotionBase + PromotionSize , LastToSize = 4 , LastToBase = PinOpenBase + PinOpenSize , LastEffectChangedSize = 6 , LastEffectChangedBase = LastToBase + LastToSize , SquareDim = LastEffectChangedBase + LastEffectChangedSize , PatternCacheSize = PTYPEO_SIZE*SquareDim , OneDim = PTYPE_SIZE*PatternCacheSize } |
Public Member Functions | |
PatternCommon (const std::string &name, int dim) | |
double | addOne (const StateInfo &state, int offset, const double *w, Square position) const |
![]() | |
Feature (std::string n, size_t d) | |
virtual | ~Feature () |
std::string | name () const |
virtual double | match (const StateInfo &, const MoveInfo &, int offset, const double *) const =0 |
size_t | dimension () const |
Static Public Member Functions | |
static void | updateCache (StateInfo &info) |
![]() | |
static int | classifyEffect9 (const NumEffectState &state, Player player, Square to) |
Static Private Member Functions | |
static void | updateCacheOne (Square target, StateInfo &info) |
Definition at line 470 of file move_probability/feature.h.
anonymous enum |
Definition at line 473 of file move_probability/feature.h.
|
inline |
Definition at line 487 of file move_probability/feature.h.
|
inline |
Definition at line 490 of file move_probability/feature.h.
References osl::Square::index(), osl::Piece::isEdge(), osl::Square::isOnBoardRegion(), osl::move_probability::StateInfo::pattern_cache, osl::SimpleState::pieceAt(), osl::ptypeOIndex(), osl::CArray< T, Capacity >::size(), SquareDim, and osl::move_probability::StateInfo::state.
Referenced by osl::move_probability::PatternBase< TestPromotable >::match().
|
static |
Definition at line 13 of file feature_.cc.
References updateCacheOne().
|
staticprivate |
Definition at line 24 of file feature_.cc.
References osl::alt(), osl::altIfPiece(), osl::move_probability::StateInfo::attack_shadow, osl::BLACK, osl::Square::canPromote(), osl::move_probability::StateInfo::changed_effects, osl::CArray< T, Capacity >::fill(), osl::container::MoveStack::hasLastMove(), osl::move_probability::StateInfo::history, osl::Square::index(), osl::Piece::isPiece(), osl::isPiece(), osl::NumEffectState::king8Info(), osl::SimpleState::kingSquare(), osl::move_probability::StateInfo::last_add_effect, osl::move_probability::StateInfo::last_move_ptype5, osl::container::MoveStack::lastMove(), osl::checkmate::King8Info::libertyCount(), osl::Piece::number(), osl::Piece::owner(), osl::move_probability::StateInfo::pattern_cache, osl::SimpleState::pieceAt(), osl::move_probability::StateInfo::pin, osl::NumEffectState::pinOrOpen(), osl::PTYPE_BASIC_MIN, osl::PTYPE_EDGE, osl::Piece::ptypeO(), osl::ptypeOIndex(), osl::move_probability::StateInfo::state, osl::move_probability::ToEffect::supportAttack(), osl::PieceMask::test(), osl::container::BoardMask::test(), osl::Move::to(), osl::SimpleState::turn(), osl::WHITE, osl::Square::x(), and osl::Square::y().
Referenced by updateCache().