6 template <
bool Opening, osl::Ptype MajorBasic>
10 template <
bool Opening, osl::Ptype MajorBasic>
14 for (
size_t i = 0; i < weights.
dimension(); ++i)
16 table[i] = weights.
value(i);
21 template <
bool Opening>
24 template <
bool Opening>
28 weight = weights.
value(0);
31 template <
bool Opening>
36 i < PtypeTraits<ROOK>::indexLimit;
62 for (
int i = 0; i < ONE_DIM; ++i)
66 RookPawnY::y_attack_table[i][s] = weights.
value(i + ONE_DIM * 2 * s);
67 RookPawnY::y_defense_table[i][s] = weights.
value(i + ONE_DIM * 2 * s + ONE_DIM);
76 for (
int i = 0; i < ONE_DIM; ++i)
79 table[i][s] = weights.
value(i + ONE_DIM*s);
93 i < PtypeTraits<ROOK>::indexLimit;
104 table[index(piece, pawn_y)] +
105 y_attack_table[indexY(kings[
WHITE], piece, pawn_y)] +
106 y_defense_table[indexY(kings[
BLACK], piece, pawn_y)];
114 table[index(piece, y)] +
115 y_attack_table[indexY(kings[
BLACK], piece, y)] +
116 y_defense_table[indexY(kings[
WHITE], piece, y)];
129 weight[stage] = weights.
value(0);
133 template <
bool Opening>
136 template <
bool Opening>
140 for (
size_t i = 0; i < weights.
dimension(); ++i)
142 table[i] = weights.
value(i);
146 template <
bool Opening>
154 template <
bool Opening>
155 template <osl::Ptype PTYPE>
161 i < PtypeTraits<PTYPE>::indexLimit;
168 const int weight = table[index(state, piece)];
178 template <
bool Opening>
183 result += evalOne<ROOK>(state);
184 result += evalOne<BISHOP>(state);
185 result += evalOne<GOLD>(state);
186 result += evalOne<SILVER>(state);
207 template<osl::Player P>
226 uPtypeO=(
PtypeO)(static_cast<int>(uPtypeO)^(~15));
227 dPtypeO=(
PtypeO)(static_cast<int>(dPtypeO)^(~15));
228 rPtypeO=(
PtypeO)(static_cast<int>(rPtypeO)^(~15));
229 lPtypeO=(
PtypeO)(static_cast<int>(lPtypeO)^(~15));
238 assert((myKing.
y()-dp.
y())<(myKing.
y()-up.
y()));
239 assert((myKing.
x()-lp.
x())<(myKing.
x()-rp.
x()));
273 result+=evalOne<BLACK>(state,pos,kings[0],kings[1],up,dp,rp,lp,isP);
275 result-=evalOne<WHITE>(state,pos,kings[1],kings[0],dp,up,lp,rp,isP);
282 for (
size_t i = 0; i <
ONE_DIM; ++i)
291 for (
size_t i = 0; i < 32; ++i)
303 for (
size_t i = 0; i <
ONE_DIM; ++i)
307 piece_attack_table[i][s] = weights.
value(i + ONE_DIM*2*s);
308 piece_defense_table[i][s] = weights.
value(i + ONE_DIM*2*s + ONE_DIM);
311 for(
int isP=0;isP<2;isP++)
312 for(
int y_diff=-9;y_diff<=9;y_diff++)
313 for(
int x_diff= -9;x_diff<=9;x_diff++){
314 int i2=
index2(x_diff,y_diff,isP);
315 if(abs(x_diff)<9 && abs(y_diff)<9){
326 int indexPieceH,indexPieceV;
327 int table_ptypeo=ptypeo;
330 indexPieceH= 0+0+(PTYPEO_EDGE-
PTYPEO_MIN)*17*9+4896+isP*9792;
331 indexPieceV= 0+0+(PTYPEO_EDGE-
PTYPEO_MIN)*17*9+ isP*9792;
334 indexPieceH=
index0(abs(x_diff),-y_diff,(
PtypeO)ptypeo,
true,isP);
335 indexPieceV=
index0(abs(x_diff),-y_diff,(
PtypeO)ptypeo,
false,isP);
338 defense_u[i1]=piece_defense_table[indexPieceV];
340 defense_d[i1]=piece_defense_table[indexPieceV];
342 for(
int y_diff_1=y_diff+1;y_diff_1<=8;y_diff_1++){
343 int i=
index(abs(x_diff),y_diff_1,
false,isP);
347 for(
int y_diff_1=
std::max(-8,y_diff);y_diff_1<=8;y_diff_1++){
348 int i=
index(abs(x_diff),y_diff_1,
false,isP);
354 defense_l[i1]=piece_defense_table[indexPieceH];
356 defense_r[i1]=piece_defense_table[indexPieceH];
358 for(
int x_diff_1=x_diff+1;x_diff_1<=8;x_diff_1++){
359 int i=
index(abs(x_diff_1),y_diff,
true,isP);
363 for(
int x_diff_1=
std::max(-8,x_diff);x_diff_1<=8;x_diff_1++){
364 int i=
index(abs(x_diff_1),y_diff,
true,isP);
380 for (
size_t i = 0; i <
ONE_DIM; ++i)
383 promote_defense_table[i][s] = weights.
value(i + ONE_DIM*s);
389 for (
size_t i = 0; i <
ONE_DIM; ++i)
393 weights.
value(i + ONE_DIM*s);
402 i < PtypeTraits<ROOK>::indexLimit;
417 result += promote_defense_table[
index];
419 effect_piece.
square().
x() != rookPos.
x())
422 promote_defense_rook_table[
423 attacked.
ptype() * 9 +
424 mobility::RookMobility::countHorizontalAll<BLACK>(state,
442 result -= promote_defense_table[
index];
444 effect_piece.
square().
x() != rookPos.
x())
447 promote_defense_rook_table[
448 attacked.
ptype() * 9 +
449 mobility::RookMobility::countHorizontalAll<WHITE>(state,
478 template<osl::Player P>
497 ulPtypeO=(
PtypeO)(static_cast<int>(ulPtypeO)^(~15));
498 urPtypeO=(
PtypeO)(static_cast<int>(urPtypeO)^(~15));
499 dlPtypeO=(
PtypeO)(static_cast<int>(dlPtypeO)^(~15));
500 drPtypeO=(
PtypeO)(static_cast<int>(drPtypeO)^(~15));
509 result+=attack_ul[
index1(opKing,ulp,ulPtypeO,isP)]+
510 attack_ur[
index1(opKing,urp,urPtypeO,isP)]+
511 attack_dl[
index1(opKing,dlp,dlPtypeO,isP)]+
512 attack_dr[
index1(opKing,drp,drPtypeO,isP)]+
513 defense_ul[
index1(myKing,ulp,ulPtypeO,isP)]+
514 defense_ur[
index1(myKing,urp,urPtypeO,isP)]+
515 defense_dl[
index1(myKing,dlp,dlPtypeO,isP)]+
516 defense_dr[
index1(myKing,drp,drPtypeO,isP)]+
543 result+=evalOne<BLACK>(state,pos,kings[0],kings[1],ulp,urp,dlp,drp,isP);
545 result-=evalOne<WHITE>(state,pos,kings[1],kings[0],drp,dlp,urp,ulp,isP);
552 for (
size_t i = 0; i <
ONE_DIM; ++i)
561 for (
size_t i = 0; i < 32; ++i)
574 for (
size_t i = 0; i <
ONE_DIM; ++i)
578 piece_attack_table[i][s] = weights.
value(i + ONE_DIM * 2 * s);
579 piece_defense_table[i][s] = weights.
value(i + ONE_DIM * 2 * s + ONE_DIM);
582 for(
int isP=0;isP<2;isP++)
583 for(
int y_diff=-9;y_diff<=9;y_diff++)
584 for(
int x_diff= -9;x_diff<=9;x_diff++){
585 int i2=
index2(x_diff,y_diff,isP);
586 if(abs(x_diff)<9 && abs(y_diff)<9){
597 int indexPieceUR,indexPieceUL;
598 int table_ptypeo=ptypeo;
601 indexPieceUR= 0+0+(PTYPEO_EDGE-
PTYPEO_MIN)*17*9+4896+isP*9792;
602 indexPieceUL= 0+0+(PTYPEO_EDGE-
PTYPEO_MIN)*17*9+ isP*9792;
605 indexPieceUR=
index0(x_diff,y_diff,(
PtypeO)ptypeo,
true,isP);
606 indexPieceUL=
index0(x_diff,y_diff,(
PtypeO)ptypeo,
false,isP);
609 defense_ul[i1]=piece_defense_table[indexPieceUL];
610 attack_dr[i1]=piece_attack_table[indexPieceUL]+piece_table[table_ptypeo-
PTYPEO_MIN];
611 defense_dr[i1]=piece_defense_table[indexPieceUL];
613 int y_diff_1=y_diff+1, x_diff_1=x_diff-1;
614 for(;y_diff_1<=8 && x_diff_1>=-8;y_diff_1++,x_diff_1--){
615 if(std::abs(x_diff_1)<=8 && std::abs(y_diff_1)<=8){
616 int i=
index(x_diff_1,y_diff_1,
false,isP);
623 int y_diff_1=y_diff, x_diff_1=x_diff;
624 for(;y_diff_1<=8 && x_diff_1>=-8;y_diff_1++,x_diff_1--){
625 if(std::abs(x_diff_1)<=8 && std::abs(y_diff_1)<=8){
626 int i=
index(x_diff_1,y_diff_1,
false,isP);
632 attack_ur[i1]=piece_attack_table[indexPieceUR]+piece_table[table_ptypeo-
PTYPEO_MIN];
633 defense_ur[i1]=piece_defense_table[indexPieceUR];
634 attack_dl[i1]=piece_attack_table[indexPieceUR]+piece_table[table_ptypeo-
PTYPEO_MIN];
635 defense_dl[i1]=piece_defense_table[indexPieceUR];
637 int y_diff_1=y_diff+1, x_diff_1=x_diff+1;
638 for(;y_diff_1<=8 && x_diff_1<=8;y_diff_1++,x_diff_1++){
639 if(std::abs(x_diff_1)<=8 && std::abs(y_diff_1)<=8){
640 int i=
index(x_diff_1,y_diff_1,
true,isP);
647 int y_diff_1=y_diff, x_diff_1=x_diff;
648 for(;y_diff_1<=8 && x_diff_1<=8;y_diff_1++,x_diff_1++){
649 if(std::abs(x_diff_1)<=8 && std::abs(y_diff_1)<=8){
650 int i=
index(x_diff_1,y_diff_1,
true,isP);
666 for (
size_t i = 0; i <
ONE_DIM; ++i)
669 table[i][s] = weights.
value(i + ONE_DIM*s);
676 for (
size_t i = 0; i <
ONE_DIM; ++i)
681 for(
int x_diff=0;x_diff<=8;x_diff++)
682 for(
int y_diff=-8;y_diff<=8;y_diff++){
683 for(
int i=0;i<32;i++)
688 for(
int x_diff=0;x_diff<=8;x_diff++)
689 for(
int y_diff=-8;y_diff<=8;y_diff++){
699 for (
size_t i = 0; i <
ONE_DIM; ++i)
711 i < PtypeTraits<BISHOP>::indexLimit;
722 const int index_k = indexK(
BLACK, ptypeo,
723 std::abs(pos.
x() - king.
x()),
725 result += king_table[index_k];
726 result +=
x_table[indexX<BLACK>(ptypeo, pos.
x())];
730 else if(pos.
y()<=8) {
735 const int index_k = indexK(
WHITE, ptypeo,
736 std::abs(pos.
x() - king.
x()),
738 result -= king_table[index_k];
739 result -=
x_table[indexX<WHITE>(ptypeo, pos.
x())];
752 for (
size_t i = 0; i <
ONE_DIM; ++i)
755 table[i][s] = weights.
value(i + ONE_DIM*s);
759 template<osl::Player P>
766 i < PtypeTraits<ROOK>::indexLimit;
775 j < PtypeTraits<BISHOP>::indexLimit;
783 result += table[index<P>(king, rook, bishop)];
792 return evalOne<BLACK>(state)-evalOne<WHITE>(state);
803 for (
size_t i = 0; i <
ONE_DIM; ++i)
807 weights.
value(i + ONE_DIM*s);
814 for (
size_t i = 0; i <
ONE_DIM; ++i)
818 weights.
value(i + ONE_DIM*s);
825 for (
size_t i = 0; i <
ONE_DIM; ++i)
829 weights.
value(i + ONE_DIM*s);
838 i < PtypeTraits<BISHOP>::indexLimit;
849 bishop,
self, opp, all);
852 result += (self_table[
self] + opp_table[opp] + all_table[all]);
856 result -= (self_table[
self] + opp_table[opp] + all_table[all]);
865 int &self_count,
int &opp_count,
int &total_count)
871 self_count = opp_count = total_count = 8;
875 assert(king.
x() != bishop.
square().
x());
876 assert(king.
y() != bishop.
square().
y());
901 self_count = opp_count = total_count = 0;
905 assert(pos.isOnBoard());
907 if (!piece.isEmpty())
910 if (piece.owner() == player)
925 for (
size_t i = 0; i <
ONE_DIM; ++i)
928 table[i][s] = weights.
value(i + ONE_DIM*s);
978 const bool black_with_support =
981 const bool white_with_support =
986 result += table[
index(p.
ptype(), black_with_support,
987 white_with_support)];
991 result -= table[
index(p.
ptype(), white_with_support,
992 black_with_support)];
1005 for (
size_t i = 0; i <
ONE_DIM; ++i)
1008 orig_table[i][s] = weights.
value(i + ONE_DIM*s);
1010 for (
int owner = 0; owner < 2; ++owner)
1012 const bool same_player = (owner == 0);
1013 for (
int y1 = 0; y1 < 10; ++y1)
1015 for (
int y2 = 0; y2 < 10; ++y2)
1017 for (
int promoted1 = 0; promoted1 < 2; ++promoted1)
1019 for (
int promoted2 = 0; promoted2 < 2; ++promoted2)
1025 int promoted1p = promoted1;
1026 int promoted2p = promoted2;
1027 if (y1 > y2 || (y1 == y2 && !promoted1 && promoted2))
1029 std::swap(y1p, y2p);
1030 std::swap(promoted1p, promoted2p);
1032 table[
index(same_player, promoted1, promoted2,
1034 orig_table[
index(same_player, promoted1p, promoted2p,
1039 if (y1 + y2 > 10 || y1 == 0 ||
1040 (y1 + y2 == 10 && promoted1))
1042 const int idx =
index(same_player, promoted1, promoted2,
1044 table[idx] = orig_table[idx];
1048 table[
index(same_player, promoted1, promoted2,
1050 -orig_table[
index(same_player, promoted2, promoted1,
1051 (10 - y2) % 10, (10 - y1) % 10)];
1071 result += table[index<true, BLACK>(rook1, rook2)];
1075 result -= table[index<true, WHITE>(rook1, rook2)];
1082 std::swap(rook1, rook2);
1084 result += table[index<false, BLACK>(rook1, rook2)];
1096 for (
size_t i = 0; i <
ONE_DIM; ++i)
1099 table[i][s] = weights.
value(i + ONE_DIM*s);
1117 bool vertical =
false;
1152 const bool black_with_support =
1155 const bool white_with_support =
1160 result += table[
index(p.
ptype(), black_with_support,
1161 white_with_support, vertical)];
1165 result -= table[
index(p.
ptype(), white_with_support,
1166 black_with_support, vertical)];
1179 for (
size_t i = 0; i <
ONE_DIM; ++i)
1182 table[i][s] = weights.
value(i + ONE_DIM*s);
1211 for (
size_t i = 0; i <
ONE_DIM; ++i)
1214 table[i][s] = weights.
value(i + ONE_DIM*s);
1218 template <osl::Player Owner>
1227 while (pieces.
any()) {
1251 return addOne<BLACK>(state) + addOne<WHITE>(state);
1261 for (
size_t i = 0; i <
ONE_DIM; ++i)
1264 table[i][s] = weights.
value(i + ONE_DIM*s);
1273 i < PtypeTraits<ROOK>::indexLimit;
1282 i < PtypeTraits<SILVER>::indexLimit;
1292 i < PtypeTraits<KNIGHT>::indexLimit;
1345 for (
size_t i = 0; i <
ONE_DIM; ++i)
1348 table[i][s] = weights.
value(i + ONE_DIM*s);
1357 i < PtypeTraits<BISHOP>::indexLimit;
1366 i < PtypeTraits<SILVER>::indexLimit;
1376 i < PtypeTraits<KNIGHT>::indexLimit;
1429 for (
size_t i = 0; i <
ONE_DIM; ++i) {
1431 table[i][s] = weights.
value(i + ONE_DIM*s);
1433 table[i] += table[0];
1437 template <osl::Player P>
1445 typedef std::pair<Offset,Square> pair_t;
1448 pair_t(Offset::make<P,U>(), sq.
neighbor<P,
UL>()),
1449 pair_t(Offset::make<P,U>(), sq.
neighbor<P,
UR>()),
1450 pair_t(Offset::make<P,L>(), sq.
neighbor<P,
UL>()),
1451 pair_t(Offset::make<P,R>(), sq.
neighbor<P,
UR>()),
1452 pair_t(Offset::make<P,D>(), sq.
neighbor<P,
UL>()),
1453 pair_t(Offset::make<P,D>(), sq.
neighbor<P,
UR>()),
1454 pair_t(Offset::make<P,U>(), sq.
neighbor<P,
U>()),
1457 const bool rook_support = state.
hasEffectAt(P, sq);
1458 for (pair_t pair: bishop_attack) {
1459 const Square attack_square = pair.second;
1460 if (! state[attack_square].isEmpty()
1463 const Square bishop_square = attack_square + pair.first;
1464 Piece p = state[bishop_square];
1473 has_gold, rook_support,
1492 addOne<BLACK>(state, rook, result);
1494 addOne<WHITE>(state, rook, result);
static int index0(int abs_x_diff, int y_diff, PtypeO ptypeO, bool horizontal, bool promoted)
黒の飛車(竜)から利きのある駒 (abs_x_diff, y_diff) - 駒を基準にした玉の相対位置 abs_x_diffは絶対値 pty...
int countEffect(Player player, Square target) const
利きの数を数える.
static CArray< MultiInt, 23104 > defense_ur
static CArray< MultiInt, 722 > attack_nospace
static void setUp(const Weights &weights)
static CArray< MultiInt, 722 > defense_nospace
static void setUp(const Weights &weights)
static MultiInt eval(const NumEffectState &state)
bool hasLongEffectAt(Player P, Square to) const
あるマスにPTYPEの長い利きがあるかどうか.
const Piece nth(int n) const
unpromote(PTYPE)のn番目の駒を帰す.
int max(Player p, int v1, int v2)
static CArray< MultiInt, ONE_DIM > table
static void setUp(const Weights &weights, int stage)
bool hasEffectIf(PtypeO ptypeo, Square attacker, Square target) const
attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる...
static CArray< MultiInt, 1620 > y_attack_table
static CArray< MultiInt, 23104 > attack_u
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
static MultiInt addOne(const NumEffectState &state)
bool canMoveOn() const
Player Pの駒が,thisの上に移動できるか? PIECE_EMPTY 0x00008000 BLACK_PIECE 0x000XxxYY X>=2...
constexpr Direction inverse(Direction d)
PtypeO altIfPiece(PtypeO ptypeO)
Pieceの時にはowner を反転する
constexpr Player alt(Player player)
static void setUp(const Weights &weights)
static void setUp(const Weights &weights)
static CArray< MultiInt, 32 > table
static void setUp(const Weights &weights)
static CArray< MultiInt, ONE_DIM > table
static CArray< MultiInt, 722 > attack_nospace
static void setUp(const Weights &weights)
static void setUp(const Weights &weights)
static void setUp(const Weights &weights)
static void setUp(const Weights &weights)
bool hasEffectByPtype(Player attack, Square target) const
target に ptype の利きがあるか? 成不成を区別しない
Ptype getPtype(PtypeO ptypeO)
static CArray< MultiInt, 64 > table
static CArray< MultiInt, 612 > attack_table
const Piece pieceAt(Square sq) const
static CArray< MultiInt, 800 > table
static CArray< MultiInt, 23104 > defense_d
int y() const
将棋としてのY座標を返す.
static void setUp(const Weights &weights)
static CArray< MultiInt, 23104 > defense_dr
static CArray< MultiInt, 23104 > attack_dl
static void setUp(const Weights &weights)
static CArray< MultiInt, 23104 > attack_l
static void setUp(const Weights &weights)
static MultiInt eval(const NumEffectState &state)
static void setUp(const Weights &weights)
int value(size_t index) const
static CArray< MultiInt, 23104 > defense_u
static CArray< MultiInt, 4896 > king_table
static int index(int abs_x_diff, int y_diff, bool horizontal, bool is_promoted)
(abs_x_diff, y_diff) - 玉を原点とした時の空マスの相対位置 horizontal - 飛車の横利きがある場合 is_prom...
int x() const
将棋としてのX座標を返す.
PtypeO newPtypeO(Player player, Ptype ptype)
static MultiInt eval(const NumEffectState &state)
static MultiInt eval(const NumEffectState &state)
const Piece pieceOf(int num) const
Square kingSquare() const
static void setUp(const Weights &weights)
static CArray< MultiInt, 9 > self_table
Square mobilityOf(Direction d, int num) const
static CArray< MultiInt, ONE_DIM > table
static int eval(const NumEffectState &state)
bool isOnBoard() const
盤面上を表すかどうかの判定. 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する. ...
static void countBetween(const NumEffectState &state, Square king, Piece bishop, int &self_count, int &opp_count, int &total_count)
static void setUp(const Weights &weights)
static CArray< MultiInt, 23104 > attack_d
static MultiInt eval(const NumEffectState &state)
static CArray< MultiInt, 374544 > table
static MultiInt eval(const NumEffectState &state)
static MultiInt evalOne(const NumEffectState &state, Square bishop, Square myKing, Square opKing, Square ulp, Square urp, Square dlp, Square drp, bool isP)
bool hasPieceOnStand(Player player, Ptype ptype) const
const NumBitmapEffect effectSetAt(Square sq) const
const Square rotate180() const
static CArray< MultiInt, 722 > defense_nospace
bool isPromoted() const
promoteした駒かどうかをチェックする
static void setUp(const Weights &weights)
static CArray< MultiInt, 32 > piece_table
static MultiInt eval(const NumEffectState &state)
static CArray< MultiInt, 9 > all_table
static MultiInt eval(const NumEffectState &state)
static MultiInt eval(const NumEffectState &state)
static CArray< MultiInt, 612 > attack_table
const Square neighbor() const
static int index(const NumEffectState &state, Piece piece)
const Square rotate180EdgeOK() const
static void setUp(const Weights &weights)
static int index1(Square king, Square from, PtypeO ptypeO, bool isP)
黒の飛車(竜)からの利きのある駒のindex {attack,defense}_{u,r,l,d} へのアクセスに使う from - 駒の位置 k...
CArray< PiecePair::IndexTable, 10 > & x_table
static CArray< MultiInt, 23104 > attack_ur
static MultiInt eval(const NumEffectState &state)
static void setUp(const Weights &weights)
const Square square() const
static CArray< MultiInt, 23104 > defense_dl
static void setUp(const Weights &weights)
static CArray< MultiInt, 32 > piece_table
static void setUp(const Weights &weights)
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
int countEffect(Player pl) const
static CArray< MultiInt, 128 > table
static CArray< MultiInt, 612 > defense_table
static CArray< MultiInt, 612 > defense_table
static CArray< MultiInt, 23104 > defense_r
static void setUp(const Weights &weights)
static void setUp(const Weights &weights, int stage)
bool isPawnMaskSet(Player player, int x) const
static CArray< MultiInt, 160 > x_table
static void addOne(const NumEffectState &state, Piece rook, MultiInt &)
const PieceMask & piecesOnBoard(Player p) const
static void setUp(const Weights &weights, int stage)
const PtypeO PTYPEO_EMPTY
const Piece findCheapAttack(Player P, Square square) const
static CArray< MultiInt, 9 > opp_table
bool isPlayerPtype(Player pl, Ptype ptype) const
あるpieceがPlayer pの持ち物でPtype ptypeであるかどうかをチェックする. TはEMPTY, EDGEではない. ...
static MultiInt eval(const NumEffectState &state)
const PieceMask effectedMask(Player pl) const
pl からの利きが(1つ以上)ある駒一覧
bool isOnBoardNotPromoted() const
promoteしていないOnBoardの駒であることのチェック Lance位しか使い道がない?
static void setUp(const Weights &weights)
static CArray< MultiInt, 23104 > attack_dr
const Square nextSquare(Player P, Square pos, Direction dr) const
next position from pos for player P.
bool hasEffectNotBy(Player player, Piece piece, Square target) const
対象とするマスにあるプレイヤーの(ただしある駒以外)利きがあるかどうか.
static MultiInt evalOne(const NumEffectState &state, Square rook, Square myKing, Square opKing, Square up, Square dp, Square rp, Square lp, bool isP)
static MultiInt eval(const NumEffectState &state, const CArray2d< int, 2, 9 > &pawns)
static MultiInt eval(const NumEffectState &state)
static CArray< MultiInt, 180 > table
static CArray< MultiInt, 32 > table
const Square squareForBlack(Player player) const
static int eval(const NumEffectState &state)
static void setUp(const Weights &weights)
static CArray< MultiInt, 23104 > defense_l
static void setUp(const Weights &weights)
static int evalOne(const NumEffectState &state)
unsigned int ptypeOIndex(PtypeO ptypeo)
static CArray< MultiInt, 23104 > defense_ul
static CArray< MultiInt, 23104 > attack_ul
static CArray< MultiInt, ONE_DIM > table
static CArray< MultiInt, 1620 > y_defense_table
static CArray< MultiInt, 23104 > attack_r
static MultiInt eval(const NumEffectState &state)
const BoardTable Board_Table
static int index2(Square king, Square from, bool isP)
黒の飛車(竜)がある場所は空マスでないのでその分を補正するテーブル {attack,defense}_nospace へのアクセ...
static MultiInt evalOne(const NumEffectState &state)