osl::move_probability::BlockLong Class Reference

`#include <feature.h>`

Inheritance diagram for osl::move_probability::BlockLong:

## Public Types

enum | { AttackPtype = 8 , BasicAttack = AttackPtype*osl::PTYPEO_SIZE , OptionSize = 8 , LongAttackSize = BasicAttack * OptionSize , DIM = PTYPE_SIZE * 2 * LongAttackSize }

## Public Member Functions

| BlockLong ()
double | match (const StateInfo &state, const MoveInfo &move, int offset, const double *w) const
Public Member Functions inherited from osl::move_probability::Feature
| Feature (std::string n, size_t d)
virtual | ~Feature ()
std::string | name () const
size_t | dimension () const

## Static Public Member Functions

static int | longAttackIndex (osl::PtypeO ptypeo)
static double | addPiece (const StateInfo &state, Piece piece, Square to, const double *w, int offset)
static int | ptypeSupport (Ptype moved, bool has_support)
static double | findAll (const StateInfo &state, Player P, Square target, const double *w, int offset)
static double | findAll (const StateInfo &state, Move move, const double *w, int offset=0)
static void | updateCache (StateInfo &)
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 | makeLongAttackOne (StateInfo &info, Piece piece, Direction d)

## Detailed Description

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

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
AttackPtype |
BasicAttack |
OptionSize |
LongAttackSize |
DIM |

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

## Constructor & Destructor Documentation

## BlockLong()

osl::move_probability::BlockLong::BlockLong | ( |  | ) |

inline

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

References DIM, and osl::move_probability::Feature::Feature().

## Member Function Documentation

## addPiece()

double osl::move_probability::BlockLong::addPiece | ( | const StateInfo & | state,
|  | Piece | piece,
|  | Square | to,
|  | const double * | w,
|  | int | offset )

inline static

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

References osl::BLACK, osl::Board_Table, osl::NumEffectState::hasEffectByPiece(), osl::move_probability::StateInfo::long_attack_cache, LongAttackSize, osl::longToShort(), osl::Piece::number(), osl::Piece::square(), and osl::move_probability::StateInfo::state.

Referenced by findAll().

## findAll() [1/2]

double osl::move_probability::BlockLong::findAll | ( | const StateInfo & | state,
|  | Move | move,
|  | const double * | w,
|  | int | offset = 0 )

inline static

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

References osl::NumEffectState::countEffect(), findAll(), osl::Move::isDrop(), osl::Move::player(), osl::Move::ptype(), ptypeSupport(), osl::move_probability::StateInfo::state, and osl::Move::to().

## findAll() [2/2]

double osl::move_probability::BlockLong::findAll | ( | const StateInfo & | state,
|  | Player | P,
|  | Square | target,
|  | const double * | w,
|  | int | offset )

inline static

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

References addPiece(), osl::alt(), osl::misc::GeneralMask< Integer >::any(), osl::NumEffectState::longEffectAt(), osl::SimpleState::pieceOf(), osl::move_probability::StateInfo::state, and osl::misc::GeneralMask< Integer >::takeOneBit().

Referenced by osl::move_probability::AddEffectLong::addOne(), findAll(), osl::move_probability::BlockLongFrom::findAll(), match(), and osl::move_probability::LongRecapture::match().

## longAttackIndex()

int osl::move_probability::BlockLong::longAttackIndex | ( | osl::PtypeO | ptypeo | ) |

inline static

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

References osl::BISHOP, osl::getOwner(), osl::getPtype(), osl::LANCE, osl::PBISHOP, osl::PROOK, osl::ROOK, and osl::WHITE.

Referenced by makeLongAttackOne().

## makeLongAttackOne()

void osl::move_probability::BlockLong::makeLongAttackOne | ( | StateInfo & | info,
|  | Piece | piece,
|  | Direction | d )

static private

Definition at line 146 of file feature_.cc.

References osl::alt(), osl::move_probability::StateInfo::attack_shadow, osl::BLACK, osl::Board_Table, osl::Square::canPromote(), osl::NumEffectState::hasEffectAt(), osl::Piece::isEdge(), osl::Square::isEdge(), osl::Piece::isEmpty(), osl::Square::isNeighboring8(), osl::Move::isNormal(), osl::Piece::isOnBoardByOwner(), osl::isPiece(), osl::Square::isPieceStand(), osl::SimpleState::kingSquare(), osl::move_probability::StateInfo::long_attack_cache, longAttackIndex(), osl::NumEffectState::mobilityOf(), osl::Piece::number(), OptionSize, osl::Piece::owner(), osl::SimpleState::pieceAt(), osl::SimpleState::pieceOnBoard(), osl::Piece::ptypeO(), osl::PTYPEO_SIZE, osl::ptypeOIndex(), osl::FixedCapacityVector< T, Capacity >::push_back(), osl::Piece::square(), osl::move_probability::StateInfo::state, osl::move_probability::StateInfo::threatmate_move, osl::Move::to(), osl::SimpleState::turn(), and osl::WHITE.

Referenced by updateCache().

## match()

double osl::move_probability::BlockLong::match | ( | const StateInfo & | state,
|  | const MoveInfo & | move,
|  | int | offset,
|  | const double * | w ) const

inline virtual

Implements osl::move_probability::Feature.

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

References findAll(), and osl::move_probability::MoveInfo::move.

## ptypeSupport()

int osl::move_probability::BlockLong::ptypeSupport | ( | Ptype | moved,
|  | bool | has_support )

inline static

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

References LongAttackSize.

Referenced by findAll().

## updateCache()

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

static

Definition at line 112 of file feature_.cc.

References osl::BLACK, osl::D, osl::DL, osl::DR, osl::Piece::isOnBoard(), osl::Piece::isPromoted(), osl::L, makeLongAttackOne(), osl::Piece::owner(), osl::SimpleState::pieceOf(), osl::R, osl::move_probability::StateInfo::state, osl::U, osl::UL, and osl::UR.

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

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

- move_probability/feature.h
- feature_.cc