My Project
squareGroup.h
Go to the documentation of this file.
1/* squareGroup.h
2 */
3#ifndef _POSITIONGROUP_H
4#define _POSITIONGROUP_H
5
6#include "osl/rating/group.h"
8
9namespace osl
10{
11 namespace rating
12 {
13 struct RelativeKingXGroup : public Group
14 {
15 bool attack;
16 RelativeKingXGroup(bool a);
17 void show(std::ostream& os, int name_width, const range_t& range,
18 const std::vector<double>& weights) const
19 {
20 showTopN(os, name_width, range, weights, 3);
21 }
22 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
23 {
24 const int progress8 = env.progress.value()/2;
25 const int index = RelativeKingX::index(attack, state, move);
26 return index*8 + progress8;
27 }
28 bool effectiveInCheck() const { return true; }
29 };
30
31 struct RelativeKingYGroup : public Group
32 {
33 bool attack;
34 RelativeKingYGroup(bool a);
35 void show(std::ostream& os, int name_width, const range_t& range,
36 const std::vector<double>& weights) const
37 {
38 showTopN(os, name_width, range, weights, 3);
39 }
40 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
41 {
42 const int progress8 = env.progress.value()/2;
43 const int index = RelativeKingY::index(attack, state, move);
44 return index*8+progress8;
45 }
46 bool effectiveInCheck() const { return true; }
47 };
48
49 struct SquareXGroup : public Group
50 {
52 void show(std::ostream& os, int name_width, const range_t& range,
53 const std::vector<double>& weights) const
54 {
55 showTopN(os, name_width, range, weights, 3);
56 }
57 int findMatch(const NumEffectState& , Move move, const RatingEnv& env) const
58 {
59 const int progress8 = env.progress.value()/2;
60 int index = DropPtype::UNIT*(SquareX::makeX(move)-1);
61 index += DropPtype::index(move);
62 return index*8+progress8;
63 }
64 bool effectiveInCheck() const { return true; }
65 };
66
67 struct SquareYGroup : public Group
68 {
70 void show(std::ostream& os, int name_width, const range_t& range,
71 const std::vector<double>& weights) const
72 {
73 showTopN(os, name_width, range, weights, 3);
74 }
75 int findMatch(const NumEffectState&, Move move, const RatingEnv& env) const
76 {
77 const int progress8 = env.progress.value()/2;
78 int index = DropPtype::UNIT*(SquareY::makeY(move)-1);
79 index += DropPtype::index(move);
80 return index*8+progress8;
81 }
82 bool effectiveInCheck() const { return true; }
83 };
84 }
85}
86
87
88#endif /* _POSITIONGROUP_H */
89// ;;; Local Variables:
90// ;;; mode:c++
91// ;;; c-basic-offset:2
92// ;;; End:
圧縮していない moveの表現 .
利きを持つ局面
mutually exclusive set of features
Definition group.h:17
void showTopN(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights, int n) const
Definition group.cc:100
static int index(bool attack, const NumEffectState &state, Move move)
Definition square.h:72
static int index(bool attack, const NumEffectState &state, Move move)
Definition square.h:115
static int makeX(Move move)
Definition square.h:131
static int makeY(Move move)
Definition square.h:153
std::pair< int, int > range_t
Definition range.h:10
static int index(Move move)
Definition square.h:31
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const
Definition squareGroup.h:22
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:17
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:35
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const
Definition squareGroup.h:40
int findMatch(const NumEffectState &, Move move, const RatingEnv &env) const
Definition squareGroup.h:57
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:52
bool effectiveInCheck() const
Definition squareGroup.h:64
int findMatch(const NumEffectState &, Move move, const RatingEnv &env) const
Definition squareGroup.h:75
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:70
bool effectiveInCheck() const
Definition squareGroup.h:82