max(AttackKing, DefenseKing). More...
#include <attackDefense.h>
Public Member Functions | |
AttackDefense (const SimpleState &) | |
void | changeTurn () |
int | value () const |
int | value (Player p) const |
void | update (const SimpleState &new_state, Move last_move) |
int | expect (const SimpleState &state, Move move) const |
Static Public Member Functions | |
static bool | initialized () |
static int | infty () |
static int | valueOf (Piece black_king, Piece white_king, Piece target) |
static int | valueOf (Piece black_king, Piece white_king, PtypeO ptypeo, Square position) |
static void | setValues (const SimpleState &, container::PieceValues &) |
static void | resetWeights (const int *w) |
Private Member Functions | |
void | reset () |
void | addValue (Player owner, int value) |
void | addValue (Piece king_black, Piece king_white, Piece target) |
void | updateKingMove (const SimpleState &, Square from, Square to) |
void | updateKingMove (const SimpleState &, Square from, Square to, Piece target) |
Private Attributes | |
CArray< int, 2 > | values |
|
explicit |
Definition at line 21 of file attackDefense.cc.
References addValue(), osl::BLACK, target, and osl::WHITE.
|
inlineprivate |
Definition at line 31 of file attackDefense.h.
References osl::playerToIndex(), value(), and values.
Referenced by addValue().
|
inlineprivate |
Definition at line 35 of file attackDefense.h.
References addValue(), osl::BLACK, osl::KING, osl::Piece::owner(), osl::Piece::ptype(), valueOf(), and osl::WHITE.
|
inline |
Definition at line 45 of file attackDefense.h.
int osl::eval::endgame::AttackDefense::expect | ( | const SimpleState & | state, |
Move | move | ||
) | const |
Definition at line 133 of file attackDefense.cc.
References osl::BLACK, osl::captured(), osl::Move::capturePtype(), osl::Move::capturePtypeO(), osl::Move::from(), osl::getPtype(), osl::Move::isDrop(), osl::KING, osl::Piece::ptype(), osl::PTYPE_EMPTY, osl::Piece::ptypeO(), osl::Move::ptypeO(), osl::Move::to(), updateKingMove(), value(), and osl::WHITE.
|
inlinestatic |
Definition at line 59 of file attackDefense.h.
References osl::eval::PieceEval::infty().
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::infty().
|
inlinestatic |
Definition at line 46 of file attackDefense.h.
|
inlineprivate |
Definition at line 30 of file attackDefense.h.
References values.
|
static |
Definition at line 170 of file attackDefense.cc.
|
static |
Definition at line 7 of file attackDefense.cc.
References osl::BLACK, target, and osl::WHITE.
void osl::eval::endgame::AttackDefense::update | ( | const SimpleState & | new_state, |
Move | last_move | ||
) |
Definition at line 33 of file attackDefense.cc.
References addValue(), osl::alt(), osl::BLACK, osl::captured(), osl::Move::capturePtype(), osl::Move::capturePtypeO(), osl::Move::from(), osl::Move::isDrop(), osl::Move::isPass(), osl::KING, osl::Move::oldPtypeO(), osl::Move::ptype(), osl::PTYPE_EMPTY, osl::Move::ptypeO(), target, osl::Move::to(), and osl::WHITE.
|
private |
Definition at line 81 of file attackDefense.cc.
References addValue(), osl::BLACK, osl::KING, osl::Piece::owner(), osl::Piece::ptype(), target, and osl::WHITE.
Referenced by expect().
|
private |
Definition at line 106 of file attackDefense.cc.
References addValue(), osl::BLACK, osl::Piece::captured(), osl::KING, osl::Piece::owner(), osl::Piece::ptype(), target, and osl::WHITE.
|
inline |
Definition at line 48 of file attackDefense.h.
References values.
Referenced by addValue(), osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::endgameValue(), expect(), and osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::value().
|
inline |
Definition at line 49 of file attackDefense.h.
References osl::playerToIndex(), and values.
|
inlinestatic |
Definition at line 64 of file attackDefense.h.
References osl::Piece::ptypeO(), and osl::Piece::square().
Referenced by addValue().
|
inlinestatic |
Definition at line 70 of file attackDefense.h.
References osl::BLACK, osl::getOwner(), osl::eval::max(), osl::Piece::owner(), osl::eval::endgame::DefenseKing::valueOf(), osl::eval::endgame::AttackKing::valueOf(), and osl::WHITE.
|
private |
Definition at line 29 of file attackDefense.h.
Referenced by addValue(), reset(), and value().