My Project
checkmateGroup.h
Go to the documentation of this file.
1/* checkmateGroup.h
2 */
3#ifndef _CHECKMATEGROUP_H
4#define _CHECKMATEGROUP_H
5
6#include "osl/rating/group.h"
8
9namespace osl
10{
11 namespace rating
12 {
14 {
15 public:
16 CheckmateIfCaptureGroup() : Group("CheckmateCap")
17 {
18 for (int p=0; p<8; ++p) // progress8
19 push_back(new CheckmateIfCapture);
20 }
21 void show(std::ostream& os, int name_width, const range_t& range,
22 const std::vector<double>& weights) const
23 {
24 showAll(os, name_width, range, weights);
25 }
26 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
27 {
28 const int progress8 = env.progress.value()/2;
29 if ((*this)[0].match(state, move, env))
30 return progress8;
31 return -1;
32 }
33 };
34 struct ThreatmateGroup : public Group
35 {
36 ThreatmateGroup() : Group("Threatmate")
37 {
38 for (int p=0; p<8; ++p) // progress8
39 push_back(new Threatmate);
40 }
41 void show(std::ostream& os, int name_width, const range_t& range,
42 const std::vector<double>& weights) const
43 {
44 showAll(os, name_width, range, weights);
45 }
46 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
47 {
48 const int progress8 = env.progress.value()/2;
49 if ((*this)[0].match(state, move, env))
50 return progress8;
51 return -1;
52 }
53 };
54 }
55} // name_width osl
56
57#endif /* _CHECKMATEGROUP_H */
58// ;;; Local Variables:
59// ;;; mode:c++
60// ;;; c-basic-offset:2
61// ;;; End:
圧縮していない moveの表現 .
利きを持つ局面
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
mutually exclusive set of features
Definition group.h:17
void showAll(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition group.cc:74
std::pair< int, int > range_t
Definition range.h:10
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const