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 |
osl::eval::endgame::AttackDefense::AttackDefense | ( | const SimpleState & | state | ) | [explicit] |
Definition at line 21 of file attackDefense.cc.
References addValue(), osl::BLACK, target, and osl::WHITE.
void osl::eval::endgame::AttackDefense::addValue | ( | Player | owner, |
int | value | ||
) | [inline, private] |
Definition at line 31 of file attackDefense.h.
References osl::playerToIndex(), value(), and values.
Referenced by addValue().
void osl::eval::endgame::AttackDefense::addValue | ( | Piece | king_black, |
Piece | king_white, | ||
Piece | target | ||
) | [inline, private] |
Definition at line 35 of file attackDefense.h.
References addValue(), osl::BLACK, osl::KING, osl::Piece::owner(), osl::Piece::ptype(), valueOf(), and osl::WHITE.
void osl::eval::endgame::AttackDefense::changeTurn | ( | ) | [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.
static int osl::eval::endgame::AttackDefense::infty | ( | ) | [inline, static] |
Definition at line 59 of file attackDefense.h.
Referenced by osl::eval::ProgressEvalGeneral< progress_eval_opening_t >::infty().
static bool osl::eval::endgame::AttackDefense::initialized | ( | ) | [inline, static] |
Definition at line 46 of file attackDefense.h.
void osl::eval::endgame::AttackDefense::reset | ( | ) | [inline, private] |
Definition at line 30 of file attackDefense.h.
References values.
void osl::eval::endgame::AttackDefense::resetWeights | ( | const int * | w | ) | [static] |
Definition at line 170 of file attackDefense.cc.
void osl::eval::endgame::AttackDefense::setValues | ( | const SimpleState & | , |
container::PieceValues & | |||
) | [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.
void osl::eval::endgame::AttackDefense::updateKingMove | ( | const SimpleState & | state, |
Square | from, | ||
Square | to | ||
) | [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().
void osl::eval::endgame::AttackDefense::updateKingMove | ( | const SimpleState & | state, |
Square | from, | ||
Square | to, | ||
Piece | target | ||
) | [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.
int osl::eval::endgame::AttackDefense::value | ( | ) | const [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().
int osl::eval::endgame::AttackDefense::value | ( | Player | p | ) | const [inline] |
Definition at line 49 of file attackDefense.h.
References osl::playerToIndex(), and values.
static int osl::eval::endgame::AttackDefense::valueOf | ( | Piece | black_king, |
Piece | white_king, | ||
Piece | target | ||
) | [inline, static] |
Definition at line 64 of file attackDefense.h.
References osl::Piece::ptypeO(), and osl::Piece::square().
Referenced by addValue(), and valueOf().
static int osl::eval::endgame::AttackDefense::valueOf | ( | Piece | black_king, |
Piece | white_king, | ||
PtypeO | ptypeo, | ||
Square | position | ||
) | [inline, static] |
Definition at line 70 of file attackDefense.h.
References osl::BLACK, osl::getOwner(), osl::eval::max(), osl::Piece::owner(), valueOf(), and osl::WHITE.
CArray<int,2> osl::eval::endgame::AttackDefense::values [private] |
Definition at line 29 of file attackDefense.h.
Referenced by addValue(), reset(), and value().