4 #ifndef EVAL_ML_KING8_H 5 #define EVAL_ML_KING8_H 21 enum {
DIM = 32 + 32 + 288 + 288 };
63 template <
class MakeEffectState>
65 template <
class MakeEffectState>
69 template <
class MakeEffectState>
73 const table_t&,
const table_t&);
80 return dir * 4 + state;
84 template <
bool Opening>
114 template <
bool Opening>
147 enum { ONE_DIM = 32,
DIM = 32 * 5 * 2};
185 const table_t& table);
186 template <osl::Player P>
188 template <osl::Player P>
196 const table_t& table_o,
const table_t& table_e);
221 const table_t& table);
225 template <osl::Player P>
265 const int x = king.
x();
266 return (x > 5 ? 9 - x : x - 1);;
271 const int x = king.
x();
272 const int y = (P ==
BLACK ? king.
y() : 10 - king.
y());
273 return (y - 1) * 5 + (x > 5 ? 9 - x : x - 1);
308 bool u_blocked,
bool opp_u_blocked,
bool opp_blocked)
319 else if (P ==
WHITE && x <= 4)
323 return x - 1 + 5 * ((is_l ? 1 : 0) + 2 * ((u_blocked ? 1 : 0) + 2 * ((opp_u_blocked ? 1 : 0) +2 * (opp_blocked ? 1 : 0))));
327 bool u_blocked,
bool opp_u_blocked,
331 const int y = (P ==
BLACK ? king.
y() : 10 - king.
y());
340 else if (P ==
WHITE && x <= 4)
344 return x - 1 + 5 * (y - 1 + 9 * ((is_l ? 1 : 0) + 2 * ((u_blocked ? 1 : 0) + 2 * ((opp_u_blocked ? 1 : 0) + 2 * (opp_blocked ? 1 : 0)))));
364 template <osl::Player Defense>
373 #endif // EVAL_ML_KING8_H
static void setUp(const Weights &weights)
CArray< PiecePair::IndexTable, 10 > & y_table
static CArray< MultiInt, 720 > y_table
static void effectState(const NumEffectState &state, const Player defense, const Direction dir, EffectState &empty, EffectState &)
static CArray< int, ONE_DIM > l_defense_piece_table
static CArray< MultiInt, 80 > table
int y() const
将棋としてのY座標を返す.
static CArray< int, ONE_DIM > r_defense_piece_table
static int index(const Square king, bool is_l, bool u_blocked, bool opp_u_blocked, bool opp_blocked)
static CArray< int, ONE_DIM > base_table
static CArray< int, ONE_DIM > u_defense_piece_table
static void adjust(int index_y, MultiInt &result)
static CArray< int, ONE_DIM > base_defense_piece_table
int x() const
将棋としてのX座標を返す.
static CArray< int, 32 > defense_table
CArray< int, 32 > table_t
static CArray< int, 288 > defense_y_table
static const MultiIntPair eval(const NumEffectState &state)
CArray< MultiInt, 10 > table_t
static CArray< int, 32 > empty_table
CArray< MultiInt, 90 > table_t
static int index(const Direction dir, EffectState state)
static int index(const Square king)
static CArray< MultiInt, 4 > table
static CArray< int, ONE_DIM > r_table
static CArray< MultiInt, ONE_DIM > table
static CArray< int, ONE_DIM > d_table
static const MultiIntPair eval(const NumEffectState &state, const table_t &table)
static int indexY(const Square king, bool is_l, bool u_blocked, bool opp_u_blocked, bool opp_blocked)
static CArray< int, ONE_DIM > u_table
static int index(const Direction dir, EffectState state)
static CArray< MultiInt, ONE_DIM > table
static int indexY(Piece king, const Direction dir, EffectState state)
static int eval(const NumEffectState &state)
static CArray< int, 288 > empty_y_table
static CArray< int, ONE_DIM > d_defense_piece_table
static const MultiIntPair eval(const NumEffectState &state, const table_t &table)
static CArray< int, 32 > table
static MultiIntPair eval(const NumEffectState &state)
static int indexY(const Square king)
static CArray< int, ONE_DIM > l_table