osl::search::QuiescenceGenerator< P > Struct Template Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Static Private Member Functions | List of all members
osl::search::QuiescenceGenerator< P > Struct Template Reference

QuiescenceSearch で使う指手生成 More...

`#include <quiescenceGenerator.h>`

## Public Member Functions
template<osl::Ptype PTYPE>
void | promote (const NumEffectState &state, MoveVector &moves)
template<osl::Ptype PTYPE, size_t N>
void | promoteN (const NumEffectState &state, MoveVector &moves, const HistoryTable &table)
template<osl::Ptype PTYPE, bool has_dont_capture>
void | capture (const NumEffectState &state, MoveVector &moves, Piece dont_capture)
template<class EvalT >
void | escapeFromLastMoveOtherThanPawn (const NumEffectState &state, Move last_move, MoveVector &moves)
template<osl::Direction DIR>
void | advanceBishop (const NumEffectState &state, const Square from, MoveVector &moves)
template<class EvalT >
void | escapeFromLastMove (const NumEffectState &state, Move last_move, MoveVector &moves)

## Static Public Member Functions
template<Ptype PTYPE, bool has_dont_capture>
static void | capture (const NumEffectState &, MoveVector &moves, Piece dont_capture)
| P が敵の PTYPE を取る手を生成する． More...
static void | capture (const NumEffectState &, Square target, MoveVector &moves)
| P が敵の target を取る手を生成する． More...
static void | capture1 (const NumEffectState &state, Square target, MoveVector &moves)
| P が敵の target を取る手を最大1手生成する． More...
static void | promote (const NumEffectState &, PieceMask pins, MoveVector &moves)
template<Ptype PTYPE>
static void | promote (const NumEffectState &, MoveVector &moves)
template<Ptype PTYPE, size_t N>
static void | promoteN (const NumEffectState &, MoveVector &moves, const HistoryTable &table)
static void | check (const NumEffectState &, PieceMask pins, MoveVector &moves, bool no_liberty=false)
static void | check (const NumEffectState &, PieceMask pins, bool no_liberty, const Square8 &sendoffs, MoveVector &moves)
static void | escapeKing (const NumEffectState &state, MoveVector &moves)
static bool | escapeKingInTakeBack (const NumEffectState &state, MoveVector &moves, bool check_by_lance)
static void | dropMajorPiece (const NumEffectState &state, MoveVector &moves)
static void | dropMajorPiece3 (const NumEffectState &state, MoveVector &moves, const HistoryTable &table)
static void | attackMajorPiece (const NumEffectState &state, PieceMask pins, MoveVector &moves)
static void | escapeAll (const NumEffectState &state, MoveVector &moves)
static void | escapeNormalPiece (const NumEffectState &state, Piece escape, MoveVector &moves, bool add_support_only=false)
template<class EvalT >
static void | escapeFromLastMove (const NumEffectState &state, Move last_move, MoveVector &moves)
| 直前に指手から逃げる More...
template<class EvalT >
static void | escapeFromLastMoveOtherThanPawn (const NumEffectState &state, Move last_move, MoveVector &moves)
static bool | escapeByMoveOnly (const NumEffectState &state, Piece piece, MoveVector &moves)
static void | attackGoldWithPawn (const NumEffectState &state, PieceMask pins, MoveVector &moves)
static void | attackWithKnight (const NumEffectState &state, PieceMask pins, Square attack_from, bool has_knight, MoveVector &moves)
static void | attackSilverWithPawn (const NumEffectState &state, PieceMask pins, MoveVector &moves)
static void | attackKnightWithPawn (const NumEffectState &state, PieceMask pins, MoveVector &moves)
static void | advanceBishop (const NumEffectState &state, MoveVector &moves)
| 角が前に進む. More...
template<Direction DIR>
static void | advanceBishop (const NumEffectState &state, const Square from, MoveVector &moves)
static void | attackKing8 (const NumEffectState &state, PieceMask pins, MoveVector &moves)
static void | attackToPinned (const NumEffectState &state, PieceMask pins, MoveVector &moves)
static void | utilizePromoted (const NumEffectState &state, Piece target, MoveVector &moves)
static void | breakThreatmate (const NumEffectState &state, Move threatmate, PieceMask pins, MoveVector &moves)
static void | kingWalk (const NumEffectState &state, MoveVector &moves)

## Static Private Member Functions
static void | attackMajorPieceSecondSelection (bool target_has_support, const MoveVector &src, MoveVector &out)
static void | attackMajorPieceFirstSelection (const NumEffectState &state, PieceMask pins, const MoveVector &all_moves, MoveVector &moves, MoveVector &expensive_drops)
static void | attackMajorPieceZerothSelection (const NumEffectState &state, const MoveVector &src, Square target, MoveVector &open_out, MoveVector &out)

## Detailed Description

### template<Player P>
struct osl::search::QuiescenceGenerator< P >

QuiescenceSearch で使う指手生成

Definition at line 28 of file quiescenceGenerator.h.

## Member Function Documentation

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::advanceBishop | ( | const NumEffectState & | state,
|  | MoveVector & | moves
| ) |  |
| static

角が前に進む.

覗いて成を受けにくい読み抜けを防ぐ

Definition at line 1408 of file quiescenceGenerator.tcc.

References osl::BISHOP, osl::Piece::isOnBoardByOwner(), moves, osl::Piece::ptype(), and osl::Piece::square().

template<Player P>
template<Direction DIR>

static void osl::search::QuiescenceGenerator< P >::advanceBishop | ( | const NumEffectState & | state,
|  | const Square | from,
|  | MoveVector & | moves
| ) |  |
| static

template<Player P>
template<osl::Direction DIR>

void osl::search::QuiescenceGenerator< P >::advanceBishop | ( | const NumEffectState & | state,
|  | const Square | from,
|  | MoveVector & | moves
| ) |  |

Definition at line 1429 of file quiescenceGenerator.tcc.

References osl::BISHOP, and osl::PTYPE_EMPTY.

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackGoldWithPawn | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 1004 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, osl::Square::canPromote(), osl::Piece::isOnBoardByOwner(), osl::KNIGHT, osl::LANCE, osl::Piece::owner(), osl::PAWN, osl::Piece::ptype(), osl::PTYPE_EMPTY, osl::SILVER, osl::Piece::square(), and osl::Square::x().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackKing8 | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 668 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BLACK, osl::captured(), osl::Move::capturePtype(), osl::move_generator::capture::generate(), osl::PtypeTable::getMoveMask(), osl::Move::isDrop(), osl::isMajor(), osl::isPromoted(), osl::Move::isPromotion(), osl::LANCE, osl::PAWN, osl::Move::ptype(), osl::PTYPE_EMPTY, osl::Ptype_Table, osl::Move::to(), osl::WHITE, and osl::Square::x().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackKnightWithPawn | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 1160 of file quiescenceGenerator.tcc.

References osl::alt(), osl::Square::canPromote(), osl::Piece::isOnBoard(), osl::KNIGHT, osl::Piece::owner(), osl::PAWN, osl::Piece::ptype(), osl::PTYPE_EMPTY, osl::Piece::square(), and osl::Square::x().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackMajorPiece | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 179 of file quiescenceGenerator.tcc.

References osl::alt(), osl::isMajor(), osl::Piece::isOnBoardByOwner(), osl::Piece::ptype(), osl::ROOK, osl::Piece::square(), target, and osl::U.

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackMajorPieceFirstSelection | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | const MoveVector & | all_moves,
|  | MoveVector & | moves,
|  | MoveVector & | expensive_drops
| ) |  |
| inlinestaticprivate

Definition at line 64 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, osl::Square::canPromote(), osl::Move::isDrop(), osl::newPtypeO(), osl::PAWN, osl::Move::ptype(), osl::eval::Ptype_Eval_Table, osl::Piece::ptypeO(), osl::ROOK, osl::Move::to(), osl::unpromote(), and osl::eval::PtypeEvalTable::value().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackMajorPieceSecondSelection | ( | bool | target_has_support,
|  | const MoveVector & | src,
|  | MoveVector & | out
| ) |  |
| inlinestaticprivate

Definition at line 127 of file quiescenceGenerator.tcc.

References osl::Move::ptype(), and osl::eval::Ptype_Eval_Table.

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackMajorPieceZerothSelection | ( | const NumEffectState & | state,
|  | const MoveVector & | src,
|  | Square | target,
|  | MoveVector & | open_out,
|  | MoveVector & | out
| ) |  |
| staticprivate

Definition at line 145 of file quiescenceGenerator.tcc.

References osl::BISHOP, osl::Move::from(), osl::Move::isCaptureOrPromotion(), osl::Move::isDrop(), osl::LANCE, osl::Move::ptypeO(), osl::ROOK, target, and osl::Move::to().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackSilverWithPawn | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 1202 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, osl::Square::canPromote(), osl::Move::from(), osl::move_generator::capture::generate(), osl::move_generator::addeffect8::hasEffect(), osl::Piece::isOnBoardByOwner(), osl::Move::isPromotion(), osl::KNIGHT, osl::LANCE, osl::Piece::owner(), osl::PAWN, osl::Piece::ptype(), osl::PTYPE_EMPTY, osl::Piece::ptypeO(), osl::SILVER, osl::Piece::square(), and osl::Square::x().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackToPinned | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 771 of file quiescenceGenerator.tcc.

References osl::alt(), osl::captured(), osl::Move::capturePtype(), osl::move_generator::capture::generate(), osl::Move::isDrop(), osl::Move::isPromotion(), osl::newPtypeO(), osl::PAWN, osl::Move::ptype(), osl::PTYPE_EMPTY, osl::Piece::ptypeO(), and osl::Move::to().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::attackWithKnight | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | Square | attack_from,
|  | bool | has_knight,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 1095 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, BOOST_STATIC_ASSERT(), osl::GOLD, osl::Piece::isOnBoardByOwner(), osl::Piece::isPromoted(), osl::KNIGHT, osl::Piece::ptype(), osl::PTYPE_EMPTY, and osl::Piece::square().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::breakThreatmate | ( | const NumEffectState & | state,
|  | Move | threatmate,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 872 of file quiescenceGenerator.tcc.

References osl::alt(), osl::Board_Table, osl::PtypeTable::canDropTo(), osl::captured(), osl::Move::capturePtype(), osl::Move::from(), osl::move_generator::capture::generate(), osl::GOLD, osl::Move::isDrop(), osl::isMajor(), osl::Move::isNormal(), osl::Piece::isPiece(), osl::Move::isPromotion(), osl::KING, osl::KNIGHT, osl::LANCE, osl::BoardTable::nextSquare(), osl::Piece::owner(), osl::PAWN, osl::Move::ptype(), osl::PTYPE_EMPTY, osl::eval::Ptype_Eval_Table, osl::Ptype_Table, osl::SHORT8_DIRECTION_MAX, osl::SHORT8_DIRECTION_MIN, osl::SILVER, osl::Piece::square(), target, osl::Move::to(), and osl::Square::x().

template<Player P>
template<osl::Ptype PTYPE, bool has_dont_capture>

void osl::search::QuiescenceGenerator< P >::capture | ( | const NumEffectState & | state,
|  | MoveVector & | moves,
|  | Piece | dont_capture
| ) |  |

Definition at line 22 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, osl::ntesuki::capture(), osl::move_generator::capture::generate(), osl::Piece::isPiece(), osl::KNIGHT, osl::LANCE, moves, osl::PAWN, osl::Piece::ptype(), osl::Piece::square(), and target.

template<Player P>
template<Ptype PTYPE, bool has_dont_capture>

template void osl::search::QuiescenceGenerator< P >::capture< ROOK, false > | ( | const NumEffectState & | ,
|  | MoveVector & | moves,
|  | Piece | dont_capture
| ) |  |
| static

P が敵の PTYPE を取る手を生成する．

Parameters

  dont_capture | これを取る手は除く

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::capture | ( | const NumEffectState & | state,
|  | Square | target,
|  | MoveVector & | moves
| ) |  |
| inlinestatic

P が敵の target を取る手を生成する．

Definition at line 148 of file quiescenceGenerator.h.

References osl::move_generator::capture::generate().

template<Player P>

static void osl::search::QuiescenceGenerator< P >::capture1 | ( | const NumEffectState & | state,
|  | Square | target,
|  | MoveVector & | moves
| ) |  |
| inlinestatic

P が敵の target を取る手を最大1手生成する．

Definition at line 45 of file quiescenceGenerator.h.

References osl::move_generator::GenerateCapture::generate1().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::check | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves,
|  | bool | no_liberty = `false`
| ) |  |
| static

Definition at line 505 of file quiescenceGenerator.tcc.

References osl::alt().

Referenced by main().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::check | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | bool | no_liberty,
|  | const Square8 & | sendoffs,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 517 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, osl::Square::canPromote(), osl::captured(), osl::Move::capturePtype(), osl::Move::from(), osl::Move::isDrop(), osl::Move::isPromotion(), osl::KNIGHT, osl::LANCE, osl::newPtypeO(), osl::PAWN, osl::Move::ptype(), osl::PTYPE_EMPTY, osl::eval::Ptype_Eval_Table, osl::Piece::ptypeO(), osl::Move::ptypeO(), osl::ROOK, osl::Move::to(), and osl::unpromote().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::dropMajorPiece | ( | const NumEffectState & | state,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 1504 of file quiescenceGenerator.tcc.

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::dropMajorPiece3 | ( | const NumEffectState & | state,
|  | MoveVector & | moves,
|  | const HistoryTable & | table
| ) |  |
| static

Definition at line 1511 of file quiescenceGenerator.tcc.

References osl::eval::min(), and osl::search::HistoryTable::value().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::escapeAll | ( | const NumEffectState & | state,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 352 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, finish, osl::GOLD, osl::Piece::isOnBoardByOwner(), osl::KNIGHT, osl::LANCE, osl::PAWN, osl::PKNIGHT, osl::Piece::ptype(), osl::ROOK, osl::SILVER, and osl::Piece::square().

template<osl::Player P>

bool osl::search::QuiescenceGenerator< P >::escapeByMoveOnly | ( | const NumEffectState & | state,
|  | Piece | piece,
|  | MoveVector & | moves
| ) |  |
| static

Returns
  利きのない場所に移動可能

Definition at line 460 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, osl::Board_Table, osl::Move::from(), osl::move_generator::capture::generate(), osl::BoardTable::getShortOffset(), osl::move_generator::addeffect8::hasEffect(), osl::Move::isCapture(), osl::isMajor(), osl::Piece::isOnBoardByOwner(), osl::LANCE, osl::ROOK, osl::Square::square, and osl::Move::to().

Referenced by osl::search::QSearch2SafeEscape< Eval, P >::operator()().

template<Player P>
template<class EvalT >

template void osl::search::QuiescenceGenerator< P >::escapeFromLastMove< eval::ml::OpenMidEndingEval > | ( | const NumEffectState & | state,
|  | Move | last_move,
|  | MoveVector & | moves
| ) |  |
| static

直前に指手から逃げる

template<Player P>
template<class EvalT >

void osl::search::QuiescenceGenerator< P >::escapeFromLastMove | ( | const NumEffectState & | state,
|  | Move | last_move,
|  | MoveVector & | moves
| ) |  |

Definition at line 1450 of file quiescenceGenerator.tcc.

References osl::alt(), osl::Move::capturePtype(), osl::Move::from(), osl::move_generator::capture::generate(), osl::Move::isCapture(), osl::Move::isDrop(), osl::Move::isNormal(), osl::Piece::isOnBoardByOwner(), osl::Move::isPromotion(), moves, osl::PAWN, osl::Move::ptype(), target, and osl::Move::to().

template<Player P>
template<class EvalT >

static void osl::search::QuiescenceGenerator< P >::escapeFromLastMoveOtherThanPawn | ( | const NumEffectState & | state,
|  | Move | last_move,
|  | MoveVector & | moves
| ) |  |
| static

template<Player P>
template<class EvalT >

void osl::search::QuiescenceGenerator< P >::escapeFromLastMoveOtherThanPawn | ( | const NumEffectState & | state,
|  | Move | last_move,
|  | MoveVector & | moves
| ) |  |

Definition at line 433 of file quiescenceGenerator.tcc.

References osl::Move::isNormal(), osl::KING, osl::KNIGHT, osl::PAWN, osl::Move::ptype(), osl::eval::Ptype_Eval_Table, osl::Move::ptypeO(), osl::Move::to(), and osl::eval::PtypeEvalTable::value().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::escapeKing | ( | const NumEffectState & | state,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 1319 of file quiescenceGenerator.tcc.

References osl::alt(), osl::Move::isCapture(), osl::Move::isDrop(), osl::KING, osl::PAWN, osl::Move::ptype(), and osl::Move::to().

template<osl::Player P>

bool osl::search::QuiescenceGenerator< P >::escapeKingInTakeBack | ( | const NumEffectState & | state,
|  | MoveVector & | moves,
|  | bool | check_by_lance
| ) |  |
| static

Returns
  existance of safe (in takeback) move

Definition at line 1356 of file quiescenceGenerator.tcc.

References osl::alt(), osl::move_generator::capture::generate(), osl::Move::isCapture(), osl::Move::isDrop(), osl::KING, osl::Move::ptype(), and osl::Move::to().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::escapeNormalPiece | ( | const NumEffectState & | state,
|  | Piece | escape,
|  | MoveVector & | moves,
|  | bool | add_support_only = `false`
| ) |  |
| static

Parameters

  escape | KING以外の駒

Definition at line 231 of file quiescenceGenerator.tcc.

References osl::alt(), osl::BISHOP, osl::Board_Table, osl::Move::from(), osl::BoardTable::getShortOffset(), osl::Move::isCaptureOrPromotion(), osl::Move::isDrop(), osl::KING, osl::LANCE, osl::PAWN, osl::Piece::ptype(), osl::Move::ptype(), osl::eval::Ptype_Eval_Table, osl::Piece::square(), osl::Move::to(), osl::unpromote(), and osl::eval::PtypeEvalTable::value().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::kingWalk | ( | const NumEffectState & | state,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 1303 of file quiescenceGenerator.tcc.

References osl::alt(), osl::move_generator::capture::generate(), and osl::Move::to().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::promote | ( | const NumEffectState & | state,
|  | PieceMask | pins,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 613 of file quiescenceGenerator.tcc.

References osl::alt(), osl::Move::from(), osl::move_generator::capture::generate(), osl::Piece::isOnBoardByOwner(), osl::LANCE, moves, osl::PPAWN, osl::PROOK, osl::Piece::ptype(), osl::Move::ptype(), osl::PTYPE_EMPTY, osl::ROOK, osl::Piece::square(), osl::Move::to(), osl::Square::x(), and osl::Square::y().

template<Player P>
template<Ptype PTYPE>

static void osl::search::QuiescenceGenerator< P >::promote | ( | const NumEffectState & | ,
|  | MoveVector & | moves
| ) |  |
| static

template<Player P>
template<osl::Ptype PTYPE>

void osl::search::QuiescenceGenerator< P >::promote | ( | const NumEffectState & | state,
|  | MoveVector & | moves
| ) |  |
| inline

Definition at line 161 of file quiescenceGenerator.h.

References moves.

template<Player P>
template<Ptype PTYPE, size_t N>

static void osl::search::QuiescenceGenerator< P >::promoteN | ( | const NumEffectState & | ,
|  | MoveVector & | moves,
|  | const HistoryTable & | table
| ) |  |
| static

template<Player P>
template<osl::Ptype PTYPE, size_t N>

void osl::search::QuiescenceGenerator< P >::promoteN | ( | const NumEffectState & | state,
|  | MoveVector & | moves,
|  | const HistoryTable & | table
| ) |  |
| inline

Definition at line 170 of file quiescenceGenerator.h.

References osl::alt(), osl::eval::min(), osl::Move::to(), and osl::search::HistoryTable::value().

template<osl::Player P>

void osl::search::QuiescenceGenerator< P >::utilizePromoted | ( | const NumEffectState & | state,
|  | Piece | target,
|  | MoveVector & | moves
| ) |  |
| static

Definition at line 823 of file quiescenceGenerator.tcc.

References osl::BISHOP, osl::Move::capturePtype(), osl::Move::from(), osl::move_generator::capture::generate(), osl::Move::isCapture(), osl::Piece::isPromoted(), osl::PAWN, osl::Piece::ptype(), osl::ROOK, osl::Piece::square(), and osl::Move::to().

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

- quiescenceGenerator.h
- quiescenceGenerator.tcc
- quiescenceGenerator.cc