My Project
std
osl
rating
group
bigramGroup.cc
Go to the documentation of this file.
1
/* bigramGroup.cc
2
*/
3
#include "
osl/rating/group/bigramGroup.h
"
4
#include <sstream>
5
6
std::string
osl::rating::BigramAttackGroup::name
(
bool
same,
bool
focus_x)
7
{
8
std::ostringstream ss;
9
ss <<
"BigramA"
<< (
same
?
'='
:
'!'
) << (
focus_x
?
'X'
:
'Y'
);
10
return
ss.str();
11
}
12
13
osl::rating::BigramAttackGroup::BigramAttackGroup
(
bool
s,
bool
f)
14
:
Group
(name(s, f)), same(s), focus_x(f)
15
{
16
for
(
int
x=-2; x<=2; ++x) {
17
for
(
int
y=-2; y<=2; ++y) {
18
for
(
int
x2=-2; x2<=2; ++x2) {
19
for
(
int
y2=-2; y2<=2; ++y2) {
20
for
(
int
king=0; king<5; ++king) {
21
push_back(
new
BigramAttack
(x, y, x2, y2, king,
same
,
focus_x
));
22
}
23
}
24
}
25
}
26
}
27
}
28
29
int
osl::rating::BigramAttackGroup::findMatch
(
const
NumEffectState
& state,
Move
move,
const
RatingEnv
& env)
const
30
{
31
const
int
index =
BigramAttack::index
(state, move, env, same, focus_x);
32
return
index;
33
}
34
35
/* ------------------------------------------------------------------------- */
36
// ;;; Local Variables:
37
// ;;; mode:c++
38
// ;;; c-basic-offset:2
39
// ;;; End:
osl::rating::BigramAttack::index
static int index(const NumEffectState &state, Move move, const RatingEnv &env, bool same, bool focus_x)
Definition:
bigramAttack.h:50
osl::Move
圧縮していない moveの表現 .
Definition:
basic_type.h:1052
osl::rating::Group
mutually exclusive set of features
Definition:
group.h:17
osl::rating::BigramAttackGroup::same
bool same
Definition:
bigramGroup.h:15
osl::rating::BigramAttackGroup::findMatch
int findMatch(const NumEffectState &state, Move m, const RatingEnv &env) const
Definition:
bigramGroup.cc:29
osl::rating::RatingEnv
Definition:
ratingEnv.h:16
osl::rating::BigramAttack
Definition:
bigramAttack.h:13
osl::NumEffectState
利きを持つ局面
Definition:
numEffectState.h:34
osl::rating::BigramAttackGroup::name
static std::string name(bool same, bool focus_x)
Definition:
bigramGroup.cc:6
bigramGroup.h
osl::rating::BigramAttackGroup::focus_x
bool focus_x
Definition:
bigramGroup.h:15
osl::rating::BigramAttackGroup::BigramAttackGroup
BigramAttackGroup(bool same, bool focus_x)
Definition:
bigramGroup.cc:13
Generated by
1.8.20