ratingEnv.cc
Go to the documentation of this file.
/* ratingEnv.cc
*/
#include "osl/rating/ratingEnv.h"
#include "osl/rating/feature/king8.h"
#include "osl/effect_util/sendOffSquare.h"
#include "osl/progress/effect5x3.h"
void osl::rating::
RatingEnv::update(const NumEffectState& new_state, Move last_move)
{
history.push(last_move);
make(new_state);
}
void osl::rating::
RatingEnv::make(const NumEffectState& state,
const PieceMask& my_pin, const PieceMask& op_pin, Progress16 progress)
{
sendoffs.clear();
const Square king_position = state.kingSquare(alt(state.turn()));
effect_util::SendOffSquare::find(state.turn(), state, king_position,
sendoffs);
this->my_pin = my_pin;
this->op_pin = op_pin;
this->progress = progress;
attack_count_for_turn = DefenseKing8::count(state);
counteffect2_cache.fill(-1);
pattern_cache.fill(-1);
}
void osl::rating::
RatingEnv::make(const NumEffectState& state)
{
progress::Effect5x3 progress(state);
make(state,
state.pin(state.turn()),
state.pin(alt(state.turn())),
progress.progress16());
}
/* ------------------------------------------------------------------------- */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::NumEffectState::pin
const PieceMask pin(Player king) const
Definition numEffectState.h:65
osl::PieceMask
駒番号のビットセット.
Definition pieceMask.h:21
osl::SimpleState::turn
Player turn() const
Definition simpleState.h:220
osl::SimpleState::kingSquare
Square kingSquare() const
Definition simpleState.h:94
osl::Square
Definition basic_type.h:532
osl::rating::DefenseKing8::count
static int count(const NumEffectState &state)
Definition std/osl/rating/feature/king8.h:57
osl::rating::RatingEnv::attack_count_for_turn
int attack_count_for_turn
Definition ratingEnv.h:21
osl::rating::RatingEnv::history
MoveStack history
Definition ratingEnv.h:18
osl::rating::RatingEnv::sendoffs
Square8 sendoffs
Definition ratingEnv.h:19
osl::rating::RatingEnv::make
void make(const NumEffectState &new_state)
Definition ratingEnv.cc:32
osl::rating::RatingEnv::progress
Progress16 progress
Definition ratingEnv.h:22
osl::rating::RatingEnv::op_pin
PieceMask op_pin
Definition ratingEnv.h:20
osl::rating::RatingEnv::counteffect2_cache
CArray< signed char, Square::SIZE > counteffect2_cache
Definition ratingEnv.h:23
osl::rating::RatingEnv::update
void update(const NumEffectState &new_state, Move last_move)
Definition ratingEnv.cc:9
osl::rating::RatingEnv::my_pin
PieceMask my_pin
Definition ratingEnv.h:20
osl::rating::RatingEnv::pattern_cache
CArray< int, Square::SIZE > pattern_cache
Definition ratingEnv.h:24
effect5x3.h
osl::progress::Progress16
ProgressN< 16 > Progress16
Definition progress.h:42
osl::alt
constexpr Player alt(Player player)
Definition basic_type.h:13
ratingEnv.h
sendOffSquare.h
king8.h
osl::effect_util::SendOffSquare::find
static SendOff8 find(const NumEffectState &state, Square king_position, Square8 &out)
osl::progress::Effect5x3
玉の周囲5x3の領域の利きの数と持駒から計算した進行度.
Definition effect5x3.h:27