2#ifndef PROGRESS_EXPERIMENTAL_NEW_PROGRESS_H
3#define PROGRESS_EXPERIMENTAL_NEW_PROGRESS_H
96 template <Player Owner>
99 template <Player Attack>
105 int &attack,
int &defense);
115 const int x_diff = std::abs(king.
x() - target.
x());
116 const int y_diff = (P ==
BLACK ? king.
y() - target.
y() :
117 target.
y() - king.
y()) + 2;
118 return x_diff * 5 + y_diff;
123 int target_x = (king.
x() > 5 ? 10 - king.
x() : king.
x());
124 int x_diff = king.
x() - target.
x();
125 if (P ==
BLACK && king.
x() >= 6)
129 else if (P ==
WHITE && king.
x() >= 5)
133 const int y_diff = (P ==
BLACK ? king.
y() - target.
y() :
134 target.
y() - king.
y()) + 2;
135 return ((x_diff + 4) * 5 + y_diff) * 5 + target_x - 1;
140 const int x_diff = std::abs(king.
x() - target.
x());
141 const int y_diff = (P ==
BLACK ? king.
y() - target.
y() :
142 target.
y() - king.
y()) + 2;
143 const int king_y = (P ==
BLACK ? king.
y() : 10 - king.
y());
144 return (x_diff * 5 + y_diff) * 9 + king_y - 1;
170 const int x_diff = std::abs(king.
x() - target.
x());
171 const int y_diff = (P ==
BLACK ? king.
y() - target.
y() :
172 target.
y() - king.
y()) + 2;
173 return x_diff * 5 + y_diff + std::min(8, count) * 25;
180 const int king_y = (P ==
BLACK ? king.
y() : 10 - king.
y());
181 const int x_diff = std::abs(king.
x() - target.
x());
182 const int y_diff = (P ==
BLACK ? king.
y() - target.
y() :
183 target.
y() - king.
y()) + 2;
184 return king_y - 1 + 9 * (x_diff * 5 + y_diff + std::min(8, count) * 25);
190 const int king_x = (king.
x() > 5 ? 10 - king.
x() : king.
x());
191 int x_diff = king.
x() - target.
x();
192 if ((P ==
BLACK && (king.
x() > 5)) ||
193 (P ==
WHITE && (king.
x() >= 5)))
195 const int y_diff = (P ==
BLACK ? king.
y() - target.
y() :
196 target.
y() - king.
y()) + 2;
197 return king_x - 1 + 5 * (x_diff + 4 +
198 9 * (y_diff + 5 * std::min(8, count)));
204 const int x = std::abs(pos.
x() - king.
x());
205 const int y = (king.
y() - pos.
y()) *
214 return indexRelative<BLACK>(king, piece.
ptype(),
219 return indexRelative<WHITE>(king, piece.
ptype(),
248 updateSub<WHITE>(new_state,last_move);
250 updateSub<BLACK>(new_state,last_move);
308 static bool setUp(
const char *filename);
313 bool operator==(
const NewProgressData& l,
const NewProgressData& r);
319 using ml::NewProgress;
323 using progress::NewProgress;
const Square square() const
int y() const
将棋としてのY座標を返す.
int x() const
将棋としてのX座標を返す.
void updateMain(const NumEffectState &new_state, Move last_move)
static CArray< int, 5625 > attack5x5_x_weight
static int index5x5x(int rook, int bishop, int gold, int silver, int promoted, int king_x)
const Progress16 progressAttack(Player p) const
static bool initialized()
void update(const NumEffectState &new_state, Move last_move)
static int indexRelative(const Square king, const Ptype ptype, const Square pos)
void updatePawnFacing(const NumEffectState &state)
void promotion37One(const NumEffectState &state, int rank)
void updateAttack5x5PiecesAndState(const NumEffectState &state)
static CArray< int, 75 > effectstate_weight
static void progressOne(const NumEffectState &state, int &attack, int &defense)
static int index5x5y(int rook, int bishop, int gold, int silver, int promoted, int king_y)
void updateSub(const NumEffectState &new_state, Move last_move)
static CArray< int, 16 > promotion37_weight
static int indexRelative(const Player player, const Square king, const Piece piece)
const Progress16 progress16(Player p) const
void updateAttack5x5Pieces(PieceMask, const NumEffectState &)
static CArray< int, 10 > pawn_facing_weight
static int indexPerEffectX(Square king, Square target, int count)
static CArray< int, 81 *15 *10 > defense_relative
const Progress16 progress16() const
static std::string defaultFilename()
static int indexY(Square king, Square target)
int attack5x5Value(const NumEffectState &state) const
const Progress16 progressDefense(Player p) const
static int indexPerEffectY(Square king, Square target, int count)
void updateNonPawnAttackedPtypePairOne(const NumEffectState &state)
static int indexX(Square king, Square target)
static int index(Square king, Square target)
static CArray< int, 56 > piecestand7_weight
void updatePromotion37(const NumEffectState &state)
static int index5x5(int rook, int bishop, int gold, int silver, int promoted)
static CArray< int, 262144 > attacked_ptype_pair_weight
void updatePieceKingRelativeBonus(const NumEffectState &state)
const NewProgressData rawData() const
void updatePieceStand7(const NumEffectState &state)
static int indexPerEffect(Square king, Square target, int count)
static CArray< int, 1125 > attack5x5_weight
static CArray< int, 81 *15 *10 > attack_relative
static CArray< int, Piece::SIZE > stand_weight
void updateNonPawnAttackedPtypePair(const NumEffectState &state)
static bool initialized_flag
static CArray< int, 4284 > king_relative_weight
static CArray< int, 10125 > attack5x5_y_weight
NewProgressDebugInfo debugInfo() const
bool operator==(const NewProgressData &l, const NewProgressData &r)
bool operator!=(ProgressN< N > l, ProgressN< N > r)
bool operator==(ProgressN< N > l, ProgressN< N > r)
ProgressN< 16 > Progress16
ProgressN< 32 > Progress32
bool operator<(ProgressN< N > l, ProgressN< N > r)
constexpr int playerToIndex(Player player)
constexpr Player alt(Player player)
CArray< int, 2 > effect_progresses
CArray< int, 2 > progresses
CArray< MultiInt, 2 > non_pawn_ptype_attacked_pair_eval
CArray< int, 2 > non_pawn_ptype_attacked_pair
CArray< int, 2 > king_relative_defense
CArray< int, 2 > promoted
CArray< int, 2 > attack5x5_progresses
CArray< int, 2 > king_relative_attack
MultiInt promotion37_eval
CArray< int, 2 > defenses
CArray< int, 2 > stand_progresses
CArray< int, FEATURE_LIMIT > black_values
CArray< int, FEATURE_LIMIT > white_values