My Project
ratingEnv.cc
Go to the documentation of this file.
1 /* ratingEnv.cc
2  */
3 #include "osl/rating/ratingEnv.h"
7 
9 RatingEnv::update(const NumEffectState& new_state, Move last_move)
10 {
11  history.push(last_move);
12  make(new_state);
13 }
14 
16 RatingEnv::make(const NumEffectState& state,
17  const PieceMask& my_pin, const PieceMask& op_pin, Progress16 progress)
18 {
19  sendoffs.clear();
20  const Square king_position = state.kingSquare(alt(state.turn()));
21  effect_util::SendOffSquare::find(state.turn(), state, king_position,
22  sendoffs);
23  this->my_pin = my_pin;
24  this->op_pin = op_pin;
25  this->progress = progress;
26  attack_count_for_turn = DefenseKing8::count(state);
27  counteffect2_cache.fill(-1);
28  pattern_cache.fill(-1);
29 }
30 
32 RatingEnv::make(const NumEffectState& state)
33 {
34  progress::Effect5x3 progress(state);
35  make(state,
36  state.pin(state.turn()),
37  state.pin(alt(state.turn())),
38  progress.progress16());
39 }
40 
41 /* ------------------------------------------------------------------------- */
42 // ;;; Local Variables:
43 // ;;; mode:c++
44 // ;;; c-basic-offset:2
45 // ;;; End:
ratingEnv.h
osl::progress::Progress16
ProgressN< 16 > Progress16
Definition: progress.h:42
osl::Square
Definition: basic_type.h:532
osl::alt
constexpr Player alt(Player player)
Definition: basic_type.h:13
osl::Move
圧縮していない moveの表現 .
Definition: basic_type.h:1052
osl::progress::Effect5x3::progress16
static const Progress16 progress16(int progress)
0-15 の値を返す
Definition: effect5x3.h:54
king8.h
osl::progress::Effect5x3
玉の周囲5x3の領域の利きの数と持駒から計算した進行度.
Definition: effect5x3.h:27
osl::rating::RatingEnv::update
void update(const NumEffectState &new_state, Move last_move)
Definition: ratingEnv.cc:9
osl::NumEffectState
利きを持つ局面
Definition: numEffectState.h:34
osl::NumEffectState::pin
const PieceMask pin(Player king) const
Definition: numEffectState.h:65
sendOffSquare.h
osl::SimpleState::kingSquare
Square kingSquare() const
Definition: simpleState.h:94
osl::rating::RatingEnv::make
void make(const NumEffectState &new_state)
Definition: ratingEnv.cc:32
osl::SimpleState::turn
Player turn() const
Definition: simpleState.h:220
effect5x3.h
osl::PieceMask
駒番号のビットセット.
Definition: pieceMask.h:21