squareGroup.h
Go to the documentation of this file.
/* squareGroup.h
*/
#ifndef _POSITIONGROUP_H
#define _POSITIONGROUP_H
#include "osl/rating/group.h"
#include "osl/rating/feature/square.h"
namespace osl
{
namespace rating
{
struct RelativeKingXGroup : public Group
{
bool attack;
RelativeKingXGroup(bool a);
void show(std::ostream& os, int name_width, const range_t& range,
const std::vector<double>& weights) const
{
showTopN(os, name_width, range, weights, 3);
}
int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
{
const int progress8 = env.progress.value()/2;
const int index = RelativeKingX::index(attack, state, move);
return index*8 + progress8;
}
bool effectiveInCheck() const { return true; }
};
struct RelativeKingYGroup : public Group
{
bool attack;
RelativeKingYGroup(bool a);
void show(std::ostream& os, int name_width, const range_t& range,
const std::vector<double>& weights) const
{
showTopN(os, name_width, range, weights, 3);
}
int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
{
const int progress8 = env.progress.value()/2;
const int index = RelativeKingY::index(attack, state, move);
return index*8+progress8;
}
bool effectiveInCheck() const { return true; }
};
struct SquareXGroup : public Group
{
SquareXGroup();
void show(std::ostream& os, int name_width, const range_t& range,
const std::vector<double>& weights) const
{
showTopN(os, name_width, range, weights, 3);
}
int findMatch(const NumEffectState& , Move move, const RatingEnv& env) const
{
const int progress8 = env.progress.value()/2;
int index = DropPtype::UNIT*(SquareX::makeX(move)-1);
index += DropPtype::index(move);
return index*8+progress8;
}
bool effectiveInCheck() const { return true; }
};
struct SquareYGroup : public Group
{
SquareYGroup();
void show(std::ostream& os, int name_width, const range_t& range,
const std::vector<double>& weights) const
{
showTopN(os, name_width, range, weights, 3);
}
int findMatch(const NumEffectState&, Move move, const RatingEnv& env) const
{
const int progress8 = env.progress.value()/2;
int index = DropPtype::UNIT*(SquareY::makeY(move)-1);
index += DropPtype::index(move);
return index*8+progress8;
}
bool effectiveInCheck() const { return true; }
};
}
}
#endif /* _POSITIONGROUP_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::progress::ProgressN::value
int value() const
Definition progress.h:22
osl::rating::Group::showTopN
void showTopN(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights, int n) const
Definition group.cc:100
osl::rating::Group::Group
Group(const std::string &name)
Definition group.cc:15
osl::rating::RatingEnv
Definition ratingEnv.h:16
osl::rating::RatingEnv::progress
Progress16 progress
Definition ratingEnv.h:22
osl::rating::RelativeKingX::index
static int index(bool attack, const NumEffectState &state, Move move)
Definition square.h:72
osl::rating::RelativeKingY::index
static int index(bool attack, const NumEffectState &state, Move move)
Definition square.h:115
osl::rating::SquareX::makeX
static int makeX(Move move)
Definition square.h:131
osl::rating::SquareY::makeY
static int makeY(Move move)
Definition square.h:153
group.h
osl::rating
Definition construct.h:18
osl::rating::range_t
std::pair< int, int > range_t
Definition range.h:10
osl
Definition additionalEffect.h:6
square.h
osl::rating::DropPtype::UNIT
@ UNIT
Definition square.h:30
osl::rating::DropPtype::index
static int index(Move move)
Definition square.h:31
osl::rating::RelativeKingXGroup::findMatch
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const
Definition squareGroup.h:22
osl::rating::RelativeKingXGroup::attack
bool attack
Definition squareGroup.h:15
osl::rating::RelativeKingXGroup::RelativeKingXGroup
RelativeKingXGroup(bool a)
Definition squareGroup.cc:6
osl::rating::RelativeKingXGroup::effectiveInCheck
bool effectiveInCheck() const
Definition squareGroup.h:28
osl::rating::RelativeKingXGroup::show
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:17
osl::rating::RelativeKingYGroup::attack
bool attack
Definition squareGroup.h:33
osl::rating::RelativeKingYGroup::show
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:35
osl::rating::RelativeKingYGroup::findMatch
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const
Definition squareGroup.h:40
osl::rating::RelativeKingYGroup::RelativeKingYGroup
RelativeKingYGroup(bool a)
Definition squareGroup.cc:19
osl::rating::RelativeKingYGroup::effectiveInCheck
bool effectiveInCheck() const
Definition squareGroup.h:46
osl::rating::SquareXGroup::findMatch
int findMatch(const NumEffectState &, Move move, const RatingEnv &env) const
Definition squareGroup.h:57
osl::rating::SquareXGroup::show
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:52
osl::rating::SquareXGroup::effectiveInCheck
bool effectiveInCheck() const
Definition squareGroup.h:64
osl::rating::SquareXGroup::SquareXGroup
SquareXGroup()
Definition squareGroup.cc:31
osl::rating::SquareYGroup::findMatch
int findMatch(const NumEffectState &, Move move, const RatingEnv &env) const
Definition squareGroup.h:75
osl::rating::SquareYGroup::show
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition squareGroup.h:70
osl::rating::SquareYGroup::effectiveInCheck
bool effectiveInCheck() const
Definition squareGroup.h:82
osl::rating::SquareYGroup::SquareYGroup
SquareYGroup()
Definition squareGroup.cc:47