osl::move_probability::PatternCommon Class Reference

`#include <feature.h>`

Inheritance diagram for osl::move_probability::PatternCommon:

## 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
Public Member Functions inherited from osl::move_probability::Feature
| 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 Public Member Functions inherited from osl::move_probability::Feature
static int | classifyEffect9 (const NumEffectState &state, Player player, Square to)

## Static Private Member Functions

static void | updateCacheOne (Square target, StateInfo &info)

## Detailed Description

Definition at line 470 of file move_probability/feature.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
SupportSize |
AttackSize |
AttackBase |
EffectSize |
EffectBase |
OpKingSize |
OpKingBase |
MyKingSize |
MyKingBase |
PromotionSize |
PromotionBase |
PinOpenSize |
PinOpenBase |
LastToSize |
LastToBase |
LastEffectChangedSize |
LastEffectChangedBase |
SquareDim |
PatternCacheSize |
OneDim |

Definition at line 473 of file move_probability/feature.h.

## Constructor & Destructor Documentation

## PatternCommon()

osl::move_probability::PatternCommon::PatternCommon | ( | const std::string & | name,
|  | int | dim )

inline

Definition at line 487 of file move_probability/feature.h.

References osl::move_probability::Feature::dim, osl::move_probability::Feature::Feature(), and osl::move_probability::Feature::name().

Referenced by osl::move_probability::PatternBase< false >::PatternBase().

## Member Function Documentation

## addOne()

double osl::move_probability::PatternCommon::addOne | ( | const StateInfo & | state,
|  | int | offset,
|  | const double * | w,
|  | Square | position ) const

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< false >::match().

## updateCache()

void osl::move_probability::PatternCommon::updateCache | ( | StateInfo & | info | ) |

static

Definition at line 13 of file feature_.cc.

References updateCacheOne().

Referenced by osl::move_probability::StateInfo::finishUpdate().

## updateCacheOne()

void osl::move_probability::PatternCommon::updateCacheOne | ( | Square | target,
|  | StateInfo & | info )

static private

Definition at line 24 of file feature_.cc.

References osl::alt(), osl::altIfPiece(), osl::move_probability::StateInfo::attack_shadow, AttackBase, osl::BLACK, osl::Square::canPromote(), osl::move_probability::StateInfo::changed_effects, osl::move_probability::Feature::classifyEffect9(), EffectBase, osl::CArray< T, Capacity >::fill(), osl::container::MoveStack::hasLastMove(), osl::move_probability::StateInfo::history, osl::Square::index(), osl::isPiece(), osl::Piece::isPiece(), osl::NumEffectState::king8Info(), osl::SimpleState::kingSquare(), osl::move_probability::StateInfo::last_add_effect, osl::move_probability::StateInfo::last_move_ptype5, LastEffectChangedBase, osl::container::MoveStack::lastMove(), LastToBase, osl::checkmate::King8Info::libertyCount(), MyKingBase, MyKingSize, osl::Piece::number(), OpKingBase, OpKingSize, osl::Piece::owner(), osl::move_probability::StateInfo::pattern_cache, PatternCacheSize, osl::SimpleState::pieceAt(), osl::move_probability::StateInfo::pin, PinOpenBase, osl::NumEffectState::pinOrOpen(), PromotionBase, osl::PTYPE_BASIC_MIN, osl::PTYPE_EDGE, osl::Piece::ptypeO(), osl::ptypeOIndex(), SquareDim, osl::move_probability::StateInfo::state, osl::move_probability::ToEffect::supportAttack(), osl::container::BoardMask::test(), osl::PieceMask::test(), osl::Move::to(), osl::SimpleState::turn(), osl::WHITE, osl::Square::x(), and osl::Square::y().

Referenced by updateCache().

The documentation for this class was generated from the following files:

- move_probability/feature.h
- feature_.cc