My Project
patternGroup.h
Go to the documentation of this file.
1/* patternGroup.h
2 */
3#ifndef _PATTERNGROUP_H
4#define _PATTERNGROUP_H
5
6#include "osl/rating/group.h"
8
9namespace osl
10{
11 namespace rating
12 {
13 struct PatternGroup : public Group
14 {
15 static std::string name(Direction direction, Direction direction2);
19 void show(std::ostream& os, int name_width, const range_t& range,
20 const std::vector<double>& weights) const
21 {
22 showTopN(os, name_width, range, weights, 3);
23 }
24 int findMatch(const NumEffectState& state, Move m, const RatingEnv&) const;
25 bool effectiveInCheck() const { return true; }
26 };
27
28
29 class PatternLongGroup : public Group
30 {
31 public:
34 private:
35 static std::string name(int direction_id);
37 public:
38 explicit PatternLongGroup(int d);
39
44 void show(std::ostream& os, int name_width, const range_t& range,
45 const std::vector<double>& weights) const
46 {
47 showTopN(os, name_width, range, weights, 3);
48 }
49 int findMatch(const NumEffectState& state, Move m, const RatingEnv& env) const;
50 bool effectiveInCheck() const { return true; }
51 };
52
53
54 class PatternLongGroup2 : public Group
55 {
56 static std::string name(int direction_id);
58 public:
59 PatternLongGroup2(int d);
60
67 void show(std::ostream& os, int name_width, const range_t& range,
68 const std::vector<double>& weights) const
69 {
70 showTopN(os, name_width, range, weights, 3);
71 }
72 int findMatch(const NumEffectState& state, Move m, const RatingEnv& env) const;
73 bool effectiveInCheck() const { return true; }
74 };
75
76 class PatternBlockGroup : public Group
77 {
79 public:
81 void show(std::ostream& os, int name_width, const range_t& range,
82 const std::vector<double>& weights) const
83 {
84 showTopN(os, name_width, range, weights, 3);
85 }
86 int findMatch(const NumEffectState& state, Move m, const RatingEnv& env) const;
87 };
88 }
89}
90
91#endif /* _PATTERNGROUP_H */
92// ;;; Local Variables:
93// ;;; mode:c++
94// ;;; c-basic-offset:2
95// ;;; 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
int findMatch(const NumEffectState &state, Move m, const RatingEnv &env) const
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
static std::string name(int direction_id)
int findMatch(const NumEffectState &state, Move m, const RatingEnv &env) const
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Direction makeDirection(Ptype ptype) const
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
int findMatch(const NumEffectState &state, Move m, const RatingEnv &env) const
Direction makeDirection(Ptype ptype) const
static const CArray< Direction, 4 > bishop_direction4
static const CArray< Direction, 4 > rook_direction4
static std::string name(int direction_id)
static const Direction INVALID
Definition pattern.h:16
std::pair< int, int > range_t
Definition range.h:10
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
@ BISHOP
Definition basic_type.h:99
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す
Definition basic_type.h:157
Direction
Definition basic_type.h:310
CArray2d< unsigned char, 2, Square::SIZE > target_table
int findMatch(const NumEffectState &state, Move m, const RatingEnv &) const
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
bool effectiveInCheck() const
static std::string name(Direction direction, Direction direction2)