All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
osl::checkmate::FixedDepthSearcher Class Reference

深さ固定で,その深さまで depth first searchで読む詰将棋. More...

#include <fixedDepthSearcher.h>

Collaboration diagram for osl::checkmate::FixedDepthSearcher:
Collaboration graph
[legend]

Public Member Functions

 FixedDepthSearcher ()
 
 FixedDepthSearcher (NumEffectState &s)
 
void setState (NumEffectState &s)
 
int getCount () const
 
const PieceStand stand (Player P) const
 
template<Player P, bool SetPieces, bool HasGuide>
const ProofDisproof attack (int depth, Move &best_move, PieceStand &proof_pieces)
 
template<Player P, bool SetPieces, bool HasGuide>
const ProofDisproof attackMayUnsafe (int depth, Move &best_move, PieceStand &proof_pieces)
 
template<Player P, bool SetPieces>
const ProofDisproof defense (Move last_move, int depth, PieceStand &proof_pieces)
 
template<Player P>
const ProofDisproof hasCheckmateMove (int depth, Move &best_move, PieceStand &proof_pieces)
 stateがPから詰む局面かを返す. More...
 
template<Player P>
const ProofDisproof hasCheckmateWithGuide (int depth, Move &guide, PieceStand &proof_pieces)
 guide を最初に試す. guide.isNormal() である必要はあるが,その局面でvalid でなくても良い More...
 
template<Player P>
const ProofDisproof hasCheckmateMove (int depth, Move &best_move)
 
template<Player P>
const ProofDisproof hasCheckmateMove (int depth)
 
template<Player P>
const ProofDisproof hasEscapeMove (Move last_move, int depth, PieceStand &proof_pieces)
 stateがPによって詰んでいる局面かを返す. More...
 
template<Player P>
const ProofDisproof hasEscapeMove (Move last_move, int depth)
 
template<Player P>
const ProofDisproof hasEscapeByMove (Move next_move, int depth, Move &check_move, PieceStand &proof_pieces)
 next_move を指して逃げられるかどうかを調べる More...
 
template<Player P>
const ProofDisproof hasEscapeByMove (Move next_move, int depth)
 
const ProofDisproof hasCheckmateMoveOfTurn (int depth, Move &best_move)
 
const ProofDisproof hasCheckmateMoveOfTurn (int depth, Move &best_move, PieceStand &proof_pieces)
 
const ProofDisproof hasCheckmateWithGuideOfTurn (int depth, Move &guide, PieceStand &proof_pieces)
 
const ProofDisproof hasEscapeMoveOfTurn (Move last_move, int depth)
 
const ProofDisproof hasEscapeByMoveOfTurn (Move next_move, int depth, Move &check_move, PieceStand &proof_pieces)
 
const ProofDisproof hasEscapeByMoveOfTurn (Move next_move, int depth)
 
template<Player Defense>
void generateBlockingWhenLiberty0 (Piece defense_king, Square attack_from, CheckMoveVector &moves) const
 無駄合をなるべく生成しない,合駒生成 More...
 
template<Player Defense>
int blockEstimation (Square attack_from, Square defense_king) const
 
template<osl::Player P, bool SetPieces, bool HasGuide>
const osl::checkmate::ProofDisproof attackMayUnsafe (int depth, Move &best_move, PieceStand &proof_pieces)
 
template<osl::Player P, bool SetPieces, bool HasGuide>
const osl::checkmate::ProofDisproof attack (int depth, Move &best_move, PieceStand &proof_pieces)
 
template<osl::Player P, bool SetPieces>
const osl::checkmate::ProofDisproof defenseEstimation (Move last_move, PieceStand &proof_pieces, Piece attacker_piece, Square target_position) const
 
template<osl::Player P, bool SetPieces>
const osl::checkmate::ProofDisproof defense (Move last_move, int depth, PieceStand &proof_pieces)
 
template<osl::Player P>
const osl::checkmate::ProofDisproof hasEscapeByMove (Move next_move, int depth, Move &check_move, PieceStand &proof_pieces)
 
template<osl::Player P>
const osl::checkmate::ProofDisproof hasEscapeByMove (Move next_move, int depth)
 
template<osl::Player P>
const osl::checkmate::ProofDisproof hasCheckmateWithGuide (int depth, Move &guide, PieceStand &proof_pieces)
 

Private Member Functions

void addCount ()
 
template<Player P, bool SetPieces>
const ProofDisproof defenseEstimation (Move last_move, PieceStand &proof_pieces, Piece attacker_piece, Square target_position) const
 move を作らずに ProofDisproof の予測を計算する More...
 

Private Attributes

NumEffectState * state
 
int count
 

Detailed Description

深さ固定で,その深さまで depth first searchで読む詰将棋.

深さ0で詰み状態かどうか(攻め手の手番の場合),王手をかける手がないかを判定可能 深さ1で通常の一手詰みを判定(攻め手の手番の場合) 使うのは深さ3位まで? NumEffectState専用

Definition at line 23 of file fixedDepthSearcher.h.

Constructor & Destructor Documentation

osl::checkmate::FixedDepthSearcher::FixedDepthSearcher ( )
inline

Definition at line 29 of file fixedDepthSearcher.h.

osl::checkmate::FixedDepthSearcher::FixedDepthSearcher ( NumEffectState &  s)
inlineexplicit

Definition at line 32 of file fixedDepthSearcher.h.

Member Function Documentation

void osl::checkmate::FixedDepthSearcher::addCount ( )
inlineprivate

Definition at line 41 of file fixedDepthSearcher.h.

References count.

template<Player P, bool SetPieces, bool HasGuide>
const ProofDisproof osl::checkmate::FixedDepthSearcher::attack ( int  depth,
Move best_move,
PieceStand proof_pieces 
)
template<osl::Player P, bool SetPieces, bool HasGuide>
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::attack ( int  depth,
Move best_move,
PieceStand proof_pieces 
)
template<Player P, bool SetPieces, bool HasGuide>
const ProofDisproof osl::checkmate::FixedDepthSearcher::attackMayUnsafe ( int  depth,
Move best_move,
PieceStand proof_pieces 
)
template<osl::Player P, bool SetPieces, bool HasGuide>
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::attackMayUnsafe ( int  depth,
Move best_move,
PieceStand proof_pieces 
)

Definition at line 73 of file fixedDepthSearcher.tcc.

References depth, osl::checkmate::ProofDisproof::NoEscape(), and state.

template<osl::Player Defense>
int osl::checkmate::FixedDepthSearcher::blockEstimation ( Square  attack_from,
Square  defense_king 
) const
inline

Definition at line 258 of file fixedDepthSearcher.tcc.

template<Player P, bool SetPieces>
const ProofDisproof osl::checkmate::FixedDepthSearcher::defense ( Move  last_move,
int  depth,
PieceStand proof_pieces 
)
template<osl::Player P, bool SetPieces>
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::defense ( Move  last_move,
int  depth,
PieceStand proof_pieces 
)
template<Player P, bool SetPieces>
const ProofDisproof osl::checkmate::FixedDepthSearcher::defenseEstimation ( Move  last_move,
PieceStand proof_pieces,
Piece  attacker_piece,
Square  target_position 
) const
private

move を作らずに ProofDisproof の予測を計算する

template<osl::Player P, bool SetPieces>
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::defenseEstimation ( Move  last_move,
PieceStand proof_pieces,
Piece  attacker_piece,
Square  target_position 
) const
inline
template<osl::Player Defense>
void osl::checkmate::FixedDepthSearcher::generateBlockingWhenLiberty0 ( Piece  defense_king,
Square  attack_from,
CheckMoveVector moves 
) const

無駄合をなるべく生成しない,合駒生成

Definition at line 223 of file fixedDepthSearcher.tcc.

References osl::Move::from(), osl::Move::isDrop(), osl::Neighboring8::isNeighboring8(), osl::Piece::square(), store(), and osl::Move::to().

int osl::checkmate::FixedDepthSearcher::getCount ( ) const
inline

Definition at line 46 of file fixedDepthSearcher.h.

References count.

Referenced by main().

template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateMove ( int  depth,
Move best_move,
PieceStand proof_pieces 
)
inline
template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateMove ( int  depth,
Move best_move 
)
inline

Definition at line 90 of file fixedDepthSearcher.h.

References depth.

template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateMove ( int  depth)
inline

Definition at line 96 of file fixedDepthSearcher.h.

References depth.

const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateMoveOfTurn ( int  depth,
Move best_move 
)
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateMoveOfTurn ( int  depth,
Move best_move,
PieceStand proof_pieces 
)

Definition at line 9 of file fixedDepthSearcher.cc.

References osl::BLACK, depth, and state.

template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateWithGuide ( int  depth,
Move guide,
PieceStand proof_pieces 
)

guide を最初に試す. guide.isNormal() である必要はあるが,その局面でvalid でなくても良い

template<osl::Player P>
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateWithGuide ( int  depth,
Move guide,
PieceStand proof_pieces 
)
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasCheckmateWithGuideOfTurn ( int  depth,
Move guide,
PieceStand proof_pieces 
)

Definition at line 29 of file fixedDepthSearcher.cc.

References osl::BLACK, and depth.

template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeByMove ( Move  next_move,
int  depth,
Move check_move,
PieceStand proof_pieces 
)

next_move を指して逃げられるかどうかを調べる

Parameters
check_move詰の場合の攻撃側の指手
depthnext_move を指した後からカウント

Referenced by osl::checkmate::Dfpn::defense(), and osl::checkmate::Dfpn::proofOracleDefense().

template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeByMove ( Move  next_move,
int  depth 
)
template<osl::Player P>
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeByMove ( Move  next_move,
int  depth,
Move check_move,
PieceStand proof_pieces 
)

Definition at line 429 of file fixedDepthSearcher.tcc.

template<osl::Player P>
const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeByMove ( Move  next_move,
int  depth 
)

Definition at line 444 of file fixedDepthSearcher.tcc.

const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeByMoveOfTurn ( Move  next_move,
int  depth,
Move check_move,
PieceStand proof_pieces 
)

Definition at line 49 of file fixedDepthSearcher.cc.

References osl::BLACK, and depth.

Referenced by osl::checkmate::CheckmateIfCapture::cannotCapture().

const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeByMoveOfTurn ( Move  next_move,
int  depth 
)

Definition at line 60 of file fixedDepthSearcher.cc.

References osl::BLACK, and depth.

template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeMove ( Move  last_move,
int  depth,
PieceStand proof_pieces 
)
inline

stateがPによって詰んでいる局面かを返す.

王手がかかっていない時には呼ばない stateの手番はalt(P)と一致しているという前提 stateはPによって王手がかかっているという前提

Parameters
last_move打ち歩詰めの判定に必要

Definition at line 110 of file fixedDepthSearcher.h.

References depth.

Referenced by osl::ntesuki::NtesukiRecord::setUpDefenseNode().

template<Player P>
const ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeMove ( Move  last_move,
int  depth 
)
inline

Definition at line 116 of file fixedDepthSearcher.h.

References depth.

const osl::checkmate::ProofDisproof osl::checkmate::FixedDepthSearcher::hasEscapeMoveOfTurn ( Move  last_move,
int  depth 
)

Definition at line 39 of file fixedDepthSearcher.cc.

References osl::BLACK, and depth.

void osl::checkmate::FixedDepthSearcher::setState ( NumEffectState &  s)
inline

Definition at line 36 of file fixedDepthSearcher.h.

References state.

const PieceStand osl::checkmate::FixedDepthSearcher::stand ( Player  P) const
inline

Definition at line 50 of file fixedDepthSearcher.h.

References state.

Member Data Documentation

int osl::checkmate::FixedDepthSearcher::count
private

Definition at line 27 of file fixedDepthSearcher.h.

Referenced by addCount(), and getCount().

NumEffectState* osl::checkmate::FixedDepthSearcher::state
private

Definition at line 26 of file fixedDepthSearcher.h.

Referenced by attackMayUnsafe(), hasCheckmateMoveOfTurn(), setState(), and stand().


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