My Project
fixedDepthSearcher.h
Go to the documentation of this file.
1/* fixedDepthSearcher.h
2 */
3#ifndef OSL_CHECKMATE_FIXED_DEPTH_SERCHER_H
4#define OSL_CHECKMATE_FIXED_DEPTH_SERCHER_H
9
10namespace osl
11{
12 namespace checkmate
13 {
15 {
16 static void setAttackLeaf(Move /*best_move*/, PieceStand& /*proof_pieces*/) {
17 }
18 static void attack(Move /*best_move*/, PieceStand, PieceStand& /*proof_pieces*/) {
19 }
21 }
22 static void clear(PieceStand& /*proof_pieces*/) {
23 }
24 static void updateMax(PieceStand /*child*/, PieceStand& /*proof_pieces*/) {
25 }
32 };
41 {
42 protected:
44 int count;
45 public:
47 {
48 }
50 : state(&s), count(0)
51 {
52 }
54 {
55 state = &s;
56 }
57 private:
58 void addCount()
59 {
60 count++;
61 }
62 public:
63 int getCount() const
64 {
65 return count;
66 }
67 const PieceStand stand(Player P) const
68 {
69 return PieceStand(P, *state);
70 }
71 public:
72 // private: Note: helper の都合
73 template <Player P, class SetPieces, bool HasGuide>
74 const ProofDisproof attack(int depth, Move& best_move, PieceStand& proof_pieces);
75 template <Player P, class SetPieces, bool HasGuide>
76 const ProofDisproof attackMayUnsafe(int depth, Move& best_move, PieceStand& proof_pieces);
77 template <Player P, class SetPieces>
78 const ProofDisproof defense(Move last_move,int depth,
79 PieceStand& proof_pieces);
80 private:
84 template <Player P, class SetPieces>
85 const ProofDisproof defenseEstimation(Move last_move, PieceStand& proof_pieces,
88 public:
89 template <Player P>
90 const ProofDisproof hasCheckmateMove(int depth,Move& best_move)
91 {
92 PieceStand proof_pieces;
93 return attack<P,NoProofPieces,false>(depth, best_move, proof_pieces);
94 }
95 template <Player P>
97 {
100 }
101
102 template <Player P>
103 const ProofDisproof hasEscapeMove(Move last_move,int depth)
104 {
105 PieceStand proof_pieces;
106 return defense<P,NoProofPieces>(last_move, depth, proof_pieces);
107 }
108 template <Player P>
110
111 const ProofDisproof hasCheckmateMoveOfTurn(int depth,Move& best_move);
112 const ProofDisproof hasEscapeMoveOfTurn(Move last_move,int depth);
114
118 template <Player Defense>
120 CheckMoveVector& moves) const;
121 template <Player Defense>
123 };
124 } // namespace checkmate
125} // namespace osl
126
127#endif /* OSL_CHECKMATE_FIXED_DEPTH_SERCHER_H */
128// ;;; Local Variables:
129// ;;; mode:c++
130// ;;; c-basic-offset:2
131// ;;; End:
圧縮していない moveの表現 .
利きを持つ局面
片方の手番の持駒の枚数を記録するクラス.
深さ固定で,その深さまで depth first searchで読む詰将棋.
const ProofDisproof defenseEstimation(Move last_move, PieceStand &proof_pieces, Piece attacker_piece, Square target_position) const
move を作らずに ProofDisproof の予測を計算する
void generateBlockingWhenLiberty0(Piece defense_king, Square attack_from, CheckMoveVector &moves) const
無駄合をなるべく生成しない,合駒生成
const ProofDisproof hasEscapeByMove(Move next_move, int depth)
const ProofDisproof hasCheckmateMoveOfTurn(int depth, Move &best_move)
const PieceStand stand(Player P) const
const ProofDisproof hasCheckmateMove(int depth)
const ProofDisproof attack(int depth, Move &best_move, PieceStand &proof_pieces)
const ProofDisproof defense(Move last_move, int depth, PieceStand &proof_pieces)
const ProofDisproof hasEscapeByMoveOfTurn(Move next_move, int depth)
const ProofDisproof hasEscapeMove(Move last_move, int depth)
const ProofDisproof hasEscapeMoveOfTurn(Move last_move, int depth)
int blockEstimation(Square attack_from, Square defense_king) const
const ProofDisproof hasCheckmateMove(int depth, Move &best_move)
const ProofDisproof attackMayUnsafe(int depth, Move &best_move, PieceStand &proof_pieces)
敵玉の8近傍の状態を表す.
Definition king8Info.h:29
証明数(proof number)と反証数(disproof number).
Player
Definition basic_type.h:8
static void setAttackLeaf(Move, PieceStand &)
static void setLeaf(const NumEffectState &, Player, PieceStand, PieceStand &)
static void clear(PieceStand &)
static ProofDisproof attackEstimation(const NumEffectState &, Player, King8Info)
static void attack(Move, PieceStand, PieceStand &)
static void addMonopolizedPieces(const NumEffectState &, Player, PieceStand, PieceStand &)
static void updateMax(PieceStand, PieceStand &)