3#ifndef _LIBERTYESTIMATOR_H
4#define _LIBERTYESTIMATOR_H
15 template <
class State>
18 unsigned int& proof_number,
19 unsigned int& disproof_number)
22 const Square king_position = state.kingSquare(defender);
28 template <
class State>
30 unsigned int& proof_number,
31 unsigned int& disproof_number)
46 template <
class State>
48 unsigned int& proof_number,
unsigned int& disproof_number);
50 template <
class State>
52 unsigned int& proof_number,
unsigned int& disproof_number);
59template<
typename State>
62 unsigned int& proof_number,
unsigned int& disproof_number)
66 (attacker, state, info, move, proof_number, disproof_number);
69 if (state.hasMultipleEffectAt(defender, move.
to()))
74 const int attack_support = state.countEffect(attacker,to);
75 const int defense_support = state.countEffect(defender,to);
76 if ((attack_support + (from.
isPieceStand() ? 1 : 0)) > defense_support)
85 if ((capturePtype ==
SILVER)
86 || (capturePtype ==
GOLD))
103template<
typename State>
106 unsigned int& proof_number,
unsigned int& disproof_number)
122 if ((state.countEffect(attacker,to) + (move.
isDrop() ? 1 : 0))
123 <= state.countEffect(
alt(attacker),to))
Ptype capturePtype() const
const Square from() const
bool isPieceStand() const
unsigned int libertyCount() const
libertyの数
const Liberty countLiberty(Ptype ptype, Direction d, unsigned int liberty_mask) const
dir 方向からの王手をかけた時のlibertyの予想
ProofNumberTable Proof_Number_Table
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す
constexpr Player alt(Player player)
static void attackH(Player attacker, const State &, King8Info, Move move, unsigned int &proof_number, unsigned int &disproof_number)
攻撃側の move に対する proof_number と disproof_number を予想する
static void defenseH(Player attacker, const State &, Move move, unsigned int &proof_number, unsigned int &disproof_number)
防御側の move に対する proof_number と disproof_number を予想する
static void attackH(Player attacker, const State &state, King8Info info, Move move, unsigned int &proof_number, unsigned int &disproof_number)
static void defenseH(Player, const State &, Move, unsigned int &proof_number, unsigned int &disproof_number)