序盤と終盤の内分を使う評価関数. More...
#include <progressEval.h>
Public Types | |
enum | { AdjustableDimension = PTYPE_SIZE + endgame::KingPieceTable::EffectiveDimension*2 } |
typedef OpeningEval | opening_eval_t |
typedef endgame::AttackDefense | endgame_eval_t |
typedef progress::Effect5x3WithBonus | progress_t |
typedef progress::Effect5x3d | defense_t |
Public Member Functions | |
ProgressEvalGeneral (const NumEffectState &state) | |
void | changeTurn () |
const Progress16 | progress16 () const |
const Progress16 | progress16bonus (Player p) const |
void | invalidateCache () |
int | value () const |
const Progress32 | progress32 () const |
int | expect (const NumEffectState &state, Move move) const |
Move | suggestMove (const NumEffectState &) const |
void | update (const NumEffectState &new_state, Move last_move) |
template<Player p> | |
int | calculateAttackBonusEach (const NumEffectState &state) const |
template<Player Attack, Direction Dir> | |
int | calculateAttackBonusOne (const NumEffectState &state) const |
int | calculateKnightCheck (const NumEffectState &state) const |
template<osl::Player P> | |
int | calculateKnightCheckEach (const NumEffectState &state) const |
template<Player p> | |
int | calculateEnterKingBonus (const NumEffectState &state) const |
template<Player p> | |
int | calculateMiddleKingBonus (const NumEffectState &state) const |
int | calculateRookRankBonus (const NumEffectState &state) const |
const PieceMask | pins (Player player) const |
int | minorPieceValue () const |
int | openingValue () const |
int | endgameValue () const |
ProgressDebugInfo | debugInfo (const NumEffectState &state) const |
int | calculatePinBonus (const NumEffectState &state) const |
int | calculateMobilityBonus () const |
int | calculateAttackRooks (const NumEffectState &state) const |
int | calculateAttackBonus (const NumEffectState &state) const |
int | calculateSilverPenalty (const NumEffectState &state) const |
int | calculateGoldPenalty (const NumEffectState &state) const |
int | attackDefenseBonus () const |
int | attackBonusScale (int val, Player attack) const |
void | debug () const |
Static Public Member Functions | |
static bool | initialized () |
static bool | setUp (const char *filename) |
static bool | setUp () |
static int | attackDefenseBonusT16 (Progress16 black, Progress16 white, Progress16 black_defense, Progress16 white_defense) |
危険度ペナルティの16倍 More... | |
static int | composeValue (int value_opening, int value_endgame, Progress16 progress16, Progress16 black, Progress16 white, Progress16 black_defense, Progress16 white_defense, int minor_piece_bonus, int progress_independent_bonus, int progress_dependent_bonus) |
static void | setValues (const SimpleState &, Progress16 progress16, container::PieceValues &) |
static void | setValues (const SimpleState &s, container::PieceValues &o) |
static int | infty () |
static int | captureValue (PtypeO ptypeO) |
static int | seeScale () |
static int | calculateMobilityBonusRook (const NumEffectState &state) |
static int | calculateMobilityBonusBishop (const NumEffectState &state) |
static int | calculateMobilityBonusLance (const NumEffectState &state) |
static void | resetWeights (const int *weight) |
Static Public Attributes | |
static const int | ROUND_UP = 64 |
roundup は 2^n であること More... | |
Private Types | |
enum | { INVALID =EvalTraits<BLACK>::MAX_VALUE+1 } |
Private Member Functions | |
template<Player P, Ptype PTYPE, Direction Dir, Direction LongDir> | |
void | initializeCheckPieceDir (const NumEffectState &state, int count) |
template<Player P, Ptype PTYPE> | |
void | initializeCheckPiece (const NumEffectState &state) |
Static Private Member Functions | |
static void | setUpInternal (const char *filename=0) |
Private Attributes | |
opening_eval_t | opening_eval |
endgame_eval_t | endgame_eval |
progress_t | current_progress |
defense_t | defense_effect |
MinorPieceBonus | minor_piece_bonus |
CArray< PieceMask, 2 > | pin_mask |
CArray2d< int, 2, SHORT8_DIRECTION_MAX+1 > | can_check_pieces |
int | progress_independent_bonus |
int | progress_dependent_bonus |
int | major_pieces |
CArray< int, 2 > | attack_bonus |
int | rook_mobility |
int | bishop_mobility |
int | lance_mobility |
int | cache |
Static Private Attributes | |
static CArray< int, PTYPEO_SIZE > | capture_values |
序盤と終盤の内分を使う評価関数.
Definition at line 50 of file progressEval.h.
typedef progress::Effect5x3d osl::eval::ProgressEvalGeneral< OpeningEval >::defense_t |
Definition at line 56 of file progressEval.h.
typedef endgame::AttackDefense osl::eval::ProgressEvalGeneral< OpeningEval >::endgame_eval_t |
Definition at line 54 of file progressEval.h.
typedef OpeningEval osl::eval::ProgressEvalGeneral< OpeningEval >::opening_eval_t |
Definition at line 53 of file progressEval.h.
typedef progress::Effect5x3WithBonus osl::eval::ProgressEvalGeneral< OpeningEval >::progress_t |
Definition at line 55 of file progressEval.h.
|
private |
Enumerator | |
---|---|
INVALID |
Definition at line 72 of file progressEval.h.
anonymous enum |
Enumerator | |
---|---|
AdjustableDimension |
Definition at line 263 of file progressEval.h.
osl::eval::ProgressEvalGeneral< Opening >::ProgressEvalGeneral | ( | const NumEffectState & | state) |
Definition at line 86 of file progressEval.cc.
References osl::eval::ProgressEvalGeneral< OpeningEval >::attack_bonus, osl::eval::ProgressEvalGeneral< OpeningEval >::attackBonusScale(), osl::eval::ProgressEvalGeneral< OpeningEval >::bishop_mobility, osl::BLACK, osl::eval::ProgressEvalGeneral< OpeningEval >::calculateAttackRooks(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateGoldPenalty(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateKnightCheck(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateMobilityBonus(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateMobilityBonusBishop(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateMobilityBonusLance(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateMobilityBonusRook(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculatePinBonus(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateRookRankBonus(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateSilverPenalty(), osl::eval::ProgressEvalGeneral< OpeningEval >::can_check_pieces, osl::eval::ProgressEvalGeneral< OpeningEval >::initialized(), osl::eval::ProgressEvalGeneral< OpeningEval >::lance_mobility, osl::eval::ProgressEvalGeneral< OpeningEval >::major_pieces, osl::eval::ProgressEvalGeneral< OpeningEval >::progress_dependent_bonus, osl::eval::ProgressEvalGeneral< OpeningEval >::progress_independent_bonus, osl::eval::ProgressEvalGeneral< OpeningEval >::rook_mobility, and osl::WHITE.
|
inline |
Definition at line 258 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
inline |
Definition at line 249 of file progressEval.h.
Referenced by show().
|
inlinestatic |
危険度ペナルティの16倍
Definition at line 109 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::attackDefenseBonus(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::composeValue().
int osl::eval::ProgressEvalGeneral< Opening >::calculateAttackBonus | ( | const NumEffectState & | state) | const |
Definition at line 457 of file progressEval.cc.
References osl::BLACK, and osl::WHITE.
int osl::eval::ProgressEvalGeneral< Opening >::calculateAttackBonusEach | ( | const NumEffectState & | state) | const |
Definition at line 515 of file progressEval.cc.
References result.
int osl::eval::ProgressEvalGeneral< Opening >::calculateAttackBonusOne | ( | const NumEffectState & | state) | const |
Definition at line 467 of file progressEval.cc.
References osl::alt(), osl::BISHOP, osl::BLACK, osl::GOLD, osl::Piece::isEdge(), osl::Piece::isEmpty(), osl::Piece::isOnBoard(), osl::L, osl::Piece::owner(), osl::R, result, osl::ROOK, osl::SILVER, target, osl::U, osl::UL, osl::UR, and osl::UUR.
int osl::eval::ProgressEvalGeneral< Opening >::calculateAttackRooks | ( | const NumEffectState & | state) | const |
Definition at line 430 of file progressEval.cc.
References osl::alt(), osl::BLACK, osl::Square::canPromote(), osl::Piece::isOnBoard(), osl::Piece::owner(), and osl::Piece::square().
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
int osl::eval::ProgressEvalGeneral< Opening >::calculateEnterKingBonus | ( | const NumEffectState & | state) | const |
Definition at line 659 of file progressEval.cc.
References osl::alt(), osl::BLACK, osl::Piece::isEmpty(), osl::eval::max(), osl::eval::min(), osl::Piece::owner(), osl::WHITE, osl::Square::x(), and osl::Square::y().
int osl::eval::ProgressEvalGeneral< Opening >::calculateGoldPenalty | ( | const NumEffectState & | state) | const |
Definition at line 570 of file progressEval.cc.
References osl::alt(), osl::BLACK, osl::Board_Table, osl::D, osl::Piece::isOnBoard(), osl::BoardTable::nextSquare(), osl::Piece::owner(), result, osl::Piece::square(), and osl::Square::y().
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
int osl::eval::ProgressEvalGeneral< Opening >::calculateKnightCheck | ( | const NumEffectState & | state) | const |
Definition at line 602 of file progressEval.cc.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
int osl::eval::ProgressEvalGeneral< Opening >::calculateKnightCheckEach | ( | const NumEffectState & | state) | const |
Definition at line 613 of file progressEval.cc.
References osl::BLACK, osl::GOLD, and osl::KNIGHT.
int osl::eval::ProgressEvalGeneral< Opening >::calculateMiddleKingBonus | ( | const NumEffectState & | state) | const |
Definition at line 714 of file progressEval.cc.
References osl::BLACK, osl::WHITE, and osl::Square::y().
|
inline |
Definition at line 256 of file progressEval.cc.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
static |
Definition at line 208 of file progressEval.cc.
References osl::eval::MobilityTable::bishop, osl::BLACK, osl::Piece::isOnBoardByOwner(), osl::Piece::isPromoted(), osl::eval::MobilityTable::pbishop, and osl::WHITE.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
static |
Definition at line 235 of file progressEval.cc.
References osl::BLACK, osl::Piece::isOnBoardByOwner(), osl::Piece::isPromoted(), osl::eval::MobilityTable::lance, and osl::WHITE.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
static |
Definition at line 171 of file progressEval.cc.
References osl::BLACK, osl::Piece::isOnBoardByOwner(), osl::Piece::isPromoted(), osl::eval::MobilityTable::prookHorizontal, osl::eval::MobilityTable::prookVertical, osl::eval::MobilityTable::rookHorizontal, osl::eval::MobilityTable::rookVertical, and osl::WHITE.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
int osl::eval::ProgressEvalGeneral< Opening >::calculatePinBonus | ( | const NumEffectState & | state) | const |
Definition at line 401 of file progressEval.cc.
References osl::BLACK, and osl::WHITE.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
int osl::eval::ProgressEvalGeneral< Opening >::calculateRookRankBonus | ( | const NumEffectState & | state) | const |
Definition at line 729 of file progressEval.cc.
References osl::alt(), osl::BLACK, osl::Square::canPromote(), osl::Piece::isOnBoard(), osl::Piece::isOnBoardByOwner(), osl::Piece::owner(), osl::PAWN, osl::Piece::ptype(), osl::SILVER, osl::Piece::square(), and osl::Square::x().
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
int osl::eval::ProgressEvalGeneral< Opening >::calculateSilverPenalty | ( | const NumEffectState & | state) | const |
Definition at line 532 of file progressEval.cc.
References osl::alt(), osl::BLACK, osl::Board_Table, osl::DL, osl::DR, osl::Square::isOnBoard(), osl::Piece::isOnBoard(), osl::Piece::isPromoted(), osl::BoardTable::nextSquare(), osl::Piece::owner(), result, osl::Piece::square(), and osl::Square::y().
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
inlinestatic |
Definition at line 214 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::seeScale().
|
inline |
Definition at line 86 of file progressEval.h.
|
inlinestatic |
Definition at line 118 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::infty(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
inline |
Definition at line 262 of file progressEval.h.
osl::eval::ProgressDebugInfo osl::eval::ProgressEvalGeneral< Opening >::debugInfo | ( | const NumEffectState & | state) | const |
Definition at line 832 of file progressEval.cc.
References osl::BLACK, osl::eval::ProgressDebugInfo::black_danger, osl::eval::ProgressDebugInfo::black_defense, osl::eval::ProgressDebugInfo::endgame, osl::eval::ProgressDebugInfo::enter_king_bonus, osl::eval::ProgressDebugInfo::eval, osl::eval::ProgressDebugInfo::gold_penalty, osl::eval::ProgressDebugInfo::king8_attack_bonus, osl::eval::ProgressDebugInfo::knight_check_bonus, osl::eval::ProgressDebugInfo::middle_king_bonus, osl::eval::ProgressDebugInfo::minor_piece_bonus, osl::eval::ProgressDebugInfo::minor_piece_bonus_info, osl::eval::ProgressDebugInfo::mobility_bonus, osl::eval::ProgressDebugInfo::opening, osl::eval::ProgressDebugInfo::pin_bonus, osl::eval::ProgressDebugInfo::progress, osl::eval::ProgressDebugInfo::progress_bonus, osl::eval::ProgressDebugInfo::progress_dependent_bonus, osl::eval::ProgressDebugInfo::progress_independent_bonus, osl::eval::ProgressDebugInfo::rook_rank_bonus, osl::eval::ProgressDebugInfo::silver_penalty, osl::eval::ProgressDebugInfo::two_rook_bonus, osl::WHITE, osl::eval::ProgressDebugInfo::white_danger, and osl::eval::ProgressDebugInfo::white_defense.
|
inline |
Definition at line 234 of file progressEval.h.
Referenced by show().
int osl::eval::ProgressEvalGeneral< Opening >::expect | ( | const NumEffectState & | state, |
Move | move | ||
) | const |
Definition at line 21 of file progressEval.cc.
References osl::BLACK, osl::progress::Effect5x3WithBonus::expect(), osl::Move::isPass(), osl::progress::Progress16::progress16, osl::progress::Effect5x3::progress16(), and osl::WHITE.
|
inlinestatic |
Definition at line 205 of file progressEval.h.
|
private |
Definition at line 140 of file progressEval.cc.
References count.
|
private |
Definition at line 160 of file progressEval.cc.
References count.
|
inlinestatic |
Definition at line 87 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
inline |
Definition at line 154 of file progressEval.h.
|
inline |
Definition at line 228 of file progressEval.h.
Referenced by show().
|
inline |
Definition at line 233 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
inline |
Definition at line 224 of file progressEval.h.
|
inline |
Definition at line 150 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::attackDefenseBonus(), osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::minorPieceValue(), test_position(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
inline |
Definition at line 151 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::minorPieceValue(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
inline |
Definition at line 177 of file progressEval.h.
|
static |
Definition at line 78 of file progressEval.cc.
References osl::PTYPE_SIZE.
|
inlinestatic |
Definition at line 218 of file progressEval.h.
|
inlinestatic |
Definition at line 91 of file progressEval.h.
|
inlinestatic |
Definition at line 98 of file progressEval.h.
|
staticprivate |
Definition at line 41 of file progressEval.cc.
References osl::PTYPEO_MIN, osl::PTYPEO_SIZE, and verbose.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::setUp().
|
static |
|
static |
|
inline |
Definition at line 186 of file progressEval.h.
void osl::eval::ProgressEvalGeneral< Opening >::update | ( | const NumEffectState & | new_state, |
Move | last_move | ||
) |
Definition at line 265 of file progressEval.cc.
References osl::BISHOP, osl::BLACK, osl::container::Board_Mask_Table3x3, osl::captured(), osl::Move::capturePtype(), osl::D, osl::DL, osl::DR, osl::Move::from(), osl::GOLD, osl::Move::isDrop(), osl::isMajor(), osl::Move::isPass(), osl::L, osl::LANCE, osl::container::BoardMaskTable3x3::mask(), osl::Move::player(), osl::playerToIndex(), osl::Move::ptype(), osl::PTYPE_EMPTY, osl::R, osl::ROOK, osl::SILVER, osl::Move::to(), osl::U, osl::UL, osl::unpromote(), osl::UR, and osl::WHITE.
Referenced by test_record().
|
inline |
Definition at line 157 of file progressEval.h.
Referenced by show().
|
private |
Definition at line 70 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
private |
Definition at line 71 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
mutableprivate |
Definition at line 75 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::invalidateCache(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
private |
Definition at line 66 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
staticprivate |
Definition at line 77 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::captureValue().
|
private |
Definition at line 60 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::attackBonusScale(), osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::attackDefenseBonus(), osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::progress16(), osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::progress16bonus(), osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::progress32(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
private |
Definition at line 61 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::attackDefenseBonus(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
private |
Definition at line 59 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::endgameValue(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
private |
Definition at line 71 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
private |
Definition at line 69 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
private |
|
private |
Definition at line 58 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::openingValue().
|
mutableprivate |
Definition at line 65 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::pins().
|
private |
|
private |
|
private |
Definition at line 71 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< OpeningEval >::ProgressEvalGeneral().
|
static |
roundup は 2^n であること
Definition at line 107 of file progressEval.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::composeValue().