#include <featureSet.h>
Classes | |
struct | Statistics |
Public Member Functions | |
FeatureSet () | |
virtual | ~FeatureSet () |
bool | tryLoad (const std::string &input_directory) |
void | setWeight (size_t feature_id, const double &value) |
const Group & | group (size_t group_id) const |
bool | effectiveInCheck (size_t group_id) const |
const Feature & | feature (size_t feature_id) const |
const range_t & | range (size_t group) const |
const double & | weight (size_t feature_id) const |
size_t | groupSize () const |
size_t | featureSize () const |
const RatedMove | makeRate (const NumEffectState &state, bool in_check, const RatingEnv &env, Move move) const |
const RatedMove | makeRateWithCut (const NumEffectState &state, bool in_check, const RatingEnv &env, int limit, Move move) const |
const std::string | annotate (const NumEffectState &state, const RatingEnv &env, Move move) const |
void | generateRating (const NumEffectState &state, const RatingEnv &env, int limit, RatedMoveVector &out, bool in_pv_or_all=true) const |
void | generateLogProb (const NumEffectState &state, const RatingEnv &env, int limit, MoveLogProbVector &out, bool in_pv_or_all=true) const |
int | logProbTakeBack (const NumEffectState &state, const RatingEnv &env, Move) const |
int | logProbSeePlus (const NumEffectState &state, const RatingEnv &env, Move) const |
int | logProbKingEscape (const NumEffectState &state, const RatingEnv &env, Move) const |
void | showGroup (std::ostream &, size_t group_id) const |
void | save (const std::string &output_directory, size_t group_id) const |
void | showStatistics (std::ostream &) const |
Static Public Member Functions | |
static void | normalize (const RatedMoveVector &, MoveLogProbVector &out) |
static std::string | defaultDirectory () |
Protected Member Functions | |
void | add (Feature *f) |
void | add (Group *g) |
void | add (CaptureGroup *g) |
void | add (SendOffGroup *g) |
void | add (CheckmateIfCaptureGroup *g) |
void | addCommon (Group *g) |
void | addFinished () |
Private Member Functions | |
FeatureSet (const FeatureSet &)=delete | |
FeatureSet & | operator= (const FeatureSet &)=delete |
const range_t | makeRange (size_t group) const |
int | rating (const NumEffectState &state, const RatingEnv &env, Move move, size_t group_id) const |
Private Attributes | |
boost::ptr_vector< Group > | groups |
std::vector< char > | effective_in_check |
std::vector< Feature * > | features |
std::vector< range_t > | ranges |
std::vector< double > | weights |
std::vector< int > | weightslog10 |
int | capture_group |
makeRateで特別扱いのgroup More... | |
int | checkmate_if_capture_group |
int | sendoff_group |
std::vector< char > | normal_groups |
std::vector< CArray< stat::Average, 8 > > | frequency |
統計測定用 More... | |
std::vector< CArray< stat::Variance, 8 > > | variance_match |
std::vector< stat::Variance > | variance_all |
std::vector< Statistics > | statistics |
Definition at line 30 of file rating/featureSet.h.
|
privatedelete |
osl::rating::FeatureSet::FeatureSet | ( | ) |
Definition at line 52 of file featureSet.cc.
References ~FeatureSet().
Referenced by osl::rating::FeatureSet::Statistics::Statistics().
|
virtual |
Definition at line 58 of file featureSet.cc.
References makeRange(), and showStatistics().
Referenced by FeatureSet().
|
protected |
Definition at line 95 of file featureSet.cc.
References addCommon().
Referenced by add(), addCommon(), addFinished(), osl::rating::CaptureSet::CaptureSet(), make_prob(), and osl::rating::StandardFeatureSet::StandardFeatureSet().
|
protected |
Definition at line 112 of file featureSet.cc.
References add(), addCommon(), and normal_groups.
|
protected |
Definition at line 119 of file featureSet.cc.
References add(), addCommon(), capture_group, and normal_groups.
|
protected |
Definition at line 127 of file featureSet.cc.
References add(), addCommon(), normal_groups, and sendoff_group.
|
protected |
Definition at line 135 of file featureSet.cc.
References addCommon(), checkmate_if_capture_group, normal_groups, and tryLoad().
|
protected |
Definition at line 101 of file featureSet.cc.
References add(), effective_in_check, osl::rating::Group::effectiveInCheck(), features, and groups.
Referenced by add().
|
protected |
Definition at line 79 of file featureSet.cc.
References add(), features, frequency, groups, makeRange(), normal_groups, ranges, statistics, variance_all, variance_match, weights, and weightslog10.
Referenced by osl::rating::CaptureSet::CaptureSet(), makeRange(), and osl::rating::StandardFeatureSet::StandardFeatureSet().
const std::string osl::rating::FeatureSet::annotate | ( | const NumEffectState & | state, |
const RatingEnv & | env, | ||
Move | move | ||
) | const |
Definition at line 615 of file featureSet.cc.
References effectiveInCheck(), groups, osl::NumEffectState::inCheck(), ranges, showGroup(), and weightslog10.
Referenced by makeRateWithCut().
|
static |
Definition at line 672 of file featureSet.cc.
References osl::OslConfig::home(), and osl::rating::StandardFeatureSet::StandardFeatureSet().
Referenced by osl::rating::CaptureSet::CaptureSet(), osl::rating::StandardFeatureSet::healthCheck(), and osl::rating::StandardFeatureSet::StandardFeatureSet().
|
inline |
Definition at line 58 of file rating/featureSet.h.
Referenced by osl::rating::BradleyTerry::addSquare(), annotate(), makeRate(), and makeRateWithCut().
|
inline |
Definition at line 59 of file rating/featureSet.h.
Referenced by osl::rating::BradleyTerry::update().
|
inline |
Definition at line 63 of file rating/featureSet.h.
Referenced by osl::rating::BradleyTerry::accumulate(), and osl::rating::BradleyTerry::update().
void osl::rating::FeatureSet::generateLogProb | ( | const NumEffectState & | state, |
const RatingEnv & | env, | ||
int | limit, | ||
MoveLogProbVector & | out, | ||
bool | in_pv_or_all = true |
||
) | const |
Definition at line 389 of file featureSet.cc.
References osl::FixedCapacityVector< T, Capacity >::empty(), generateRating(), make_prob(), osl::rating::RatingEnv::progress, osl::container::MoveLogProbVector::push_back(), rating(), and osl::FixedCapacityVector< T, Capacity >::size().
Referenced by make_prob().
void osl::rating::FeatureSet::generateRating | ( | const NumEffectState & | state, |
const RatingEnv & | env, | ||
int | limit, | ||
RatedMoveVector & | out, | ||
bool | in_pv_or_all = true |
||
) | const |
Definition at line 200 of file featureSet.cc.
References osl::alt(), osl::PieceMask::any(), osl::GenerateAllMoves::generate(), osl::GenerateEscapeKing::generate(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::inCheck(), osl::move_classifier::PlayerMoveAdaptor< Classifier >::isMember(), osl::KING, makeRate(), makeRateWithCut(), MinRating, osl::rating::RatingEnv::my_pin, osl::FixedCapacityVector< T, Capacity >::push_back(), osl::rating::RatedMove::rating(), osl::FixedCapacityVector< T, Capacity >::size(), osl::rating::RatedMoveVector::sort(), and osl::SimpleState::turn().
Referenced by generateLogProb(), and setWeight().
|
inline |
Definition at line 57 of file rating/featureSet.h.
Referenced by osl::rating::BradleyTerry::addSquare(), save(), and showGroup().
|
inline |
Definition at line 62 of file rating/featureSet.h.
Referenced by osl::rating::BradleyTerry::addSquare(), and osl::rating::BradleyTerry::iterate().
int osl::rating::FeatureSet::logProbKingEscape | ( | const NumEffectState & | state, |
const RatingEnv & | env, | ||
Move | move | ||
) | const |
Definition at line 443 of file featureSet.cc.
References osl::NumEffectState::inCheck(), makeRate(), osl::eval::max(), max_score, osl::eval::min(), min_score, osl::rating::RatingEnv::progress, osl::rating::RatedMove::rating(), rating(), sc_length, sc_start, and sc_width.
Referenced by logProbSeePlus().
int osl::rating::FeatureSet::logProbSeePlus | ( | const NumEffectState & | state, |
const RatingEnv & | env, | ||
Move | move | ||
) | const |
Definition at line 431 of file featureSet.cc.
References osl::NumEffectState::inCheck(), logProbKingEscape(), makeRate(), osl::eval::max(), max_score, osl::eval::min(), min_score, osl::rating::RatingEnv::progress, osl::rating::RatedMove::rating(), sc_length, sc_start, and sc_width.
Referenced by logProbTakeBack().
int osl::rating::FeatureSet::logProbTakeBack | ( | const NumEffectState & | state, |
const RatingEnv & | env, | ||
Move | move | ||
) | const |
Definition at line 420 of file featureSet.cc.
References osl::NumEffectState::inCheck(), logProbSeePlus(), makeRate(), osl::eval::max(), max_score, osl::eval::min(), min_score, osl::rating::RatingEnv::progress, osl::rating::RatedMove::rating(), sc_length, sc_start, and sc_width.
|
private |
Definition at line 66 of file featureSet.cc.
References addFinished(), and groups.
Referenced by addFinished(), and ~FeatureSet().
const osl::rating::RatedMove osl::rating::FeatureSet::makeRate | ( | const NumEffectState & | state, |
bool | in_check, | ||
const RatingEnv & | env, | ||
Move | move | ||
) | const |
Definition at line 481 of file featureSet.cc.
References capture_group, checkmate_if_capture_group, effectiveInCheck(), groups, osl::eval::max(), normal_groups, rating(), and sendoff_group.
Referenced by generateRating(), logProbKingEscape(), logProbSeePlus(), logProbTakeBack(), makeRateWithCut(), and rating().
const osl::rating::RatedMove osl::rating::FeatureSet::makeRateWithCut | ( | const NumEffectState & | state, |
bool | in_check, | ||
const RatingEnv & | env, | ||
int | limit, | ||
Move | move | ||
) | const |
Definition at line 573 of file featureSet.cc.
References annotate(), capture_group, checkmate_if_capture_group, effectiveInCheck(), groups, makeRate(), osl::eval::max(), MinRating, osl::rating::RatingEnv::progress, rating(), and statistics.
Referenced by generateRating().
|
static |
|
privatedelete |
|
inline |
Definition at line 60 of file rating/featureSet.h.
Referenced by osl::rating::BradleyTerry::addSquare(), save(), showGroup(), and osl::rating::BradleyTerry::update().
|
private |
Definition at line 458 of file featureSet.cc.
References frequency, groups, makeRate(), osl::rating::RatingEnv::progress, ranges, variance_all, variance_match, and weightslog10.
Referenced by generateLogProb(), logProbKingEscape(), make_prob(), makeRate(), and makeRateWithCut().
void osl::rating::FeatureSet::save | ( | const std::string & | output_directory, |
size_t | group_id | ||
) | const |
Definition at line 649 of file featureSet.cc.
References group(), range(), osl::rating::Group::saveResult(), showStatistics(), and weights.
Referenced by osl::rating::BradleyTerry::iterate(), and showGroup().
void osl::rating::FeatureSet::setWeight | ( | size_t | feature_id, |
const double & | value | ||
) |
Definition at line 193 of file featureSet.cc.
References generateRating(), weights, and weightslog10.
Referenced by tryLoad(), and osl::rating::BradleyTerry::update().
void osl::rating::FeatureSet::showGroup | ( | std::ostream & | os, |
size_t | group_id | ||
) | const |
Definition at line 642 of file featureSet.cc.
References group(), range(), save(), osl::rating::Group::show(), and weights.
Referenced by annotate(), and osl::rating::BradleyTerry::update().
void osl::rating::FeatureSet::showStatistics | ( | std::ostream & | os | ) | const |
Definition at line 655 of file featureSet.cc.
References frequency, groups, variance_all, and variance_match.
Referenced by save(), and ~FeatureSet().
bool osl::rating::FeatureSet::tryLoad | ( | const std::string & | input_directory | ) |
Definition at line 143 of file featureSet.cc.
References osl::rating::FeatureSet::Statistics::average, features, groups, osl::rating::FeatureSet::Statistics::probability, ranges, setWeight(), statistics, osl::rating::FeatureSet::Statistics::variance, weights, and weightslog10.
Referenced by add(), osl::rating::CaptureSet::CaptureSet(), and osl::rating::StandardFeatureSet::StandardFeatureSet().
|
inline |
Definition at line 61 of file rating/featureSet.h.
Referenced by osl::rating::BradleyTerry::addSquare(), and osl::rating::BradleyTerry::update().
|
private |
makeRateで特別扱いのgroup
Definition at line 43 of file rating/featureSet.h.
Referenced by add(), makeRate(), and makeRateWithCut().
|
private |
Definition at line 43 of file rating/featureSet.h.
Referenced by add(), makeRate(), and makeRateWithCut().
|
private |
Definition at line 37 of file rating/featureSet.h.
Referenced by addCommon().
|
private |
Definition at line 38 of file rating/featureSet.h.
Referenced by addCommon(), addFinished(), and tryLoad().
|
mutableprivate |
統計測定用
Definition at line 46 of file rating/featureSet.h.
Referenced by addFinished(), rating(), and showStatistics().
|
private |
Definition at line 36 of file rating/featureSet.h.
Referenced by addCommon(), addFinished(), annotate(), makeRange(), makeRate(), makeRateWithCut(), rating(), showStatistics(), and tryLoad().
|
private |
Definition at line 44 of file rating/featureSet.h.
Referenced by add(), addFinished(), and makeRate().
|
private |
Definition at line 39 of file rating/featureSet.h.
Referenced by addFinished(), annotate(), rating(), and tryLoad().
|
private |
Definition at line 43 of file rating/featureSet.h.
Referenced by add(), and makeRate().
|
private |
Definition at line 49 of file rating/featureSet.h.
Referenced by addFinished(), makeRateWithCut(), and tryLoad().
|
mutableprivate |
Definition at line 48 of file rating/featureSet.h.
Referenced by addFinished(), rating(), and showStatistics().
|
mutableprivate |
Definition at line 47 of file rating/featureSet.h.
Referenced by addFinished(), rating(), and showStatistics().
|
private |
Definition at line 40 of file rating/featureSet.h.
Referenced by addFinished(), save(), setWeight(), showGroup(), and tryLoad().
|
private |
Definition at line 41 of file rating/featureSet.h.
Referenced by addFinished(), annotate(), rating(), setWeight(), and tryLoad().