osl::rating::FeatureSet Class Reference

`#include <featureSet.h>`

Inheritance diagram for osl::rating::FeatureSet:

## 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
int | checkmate_if_capture_group
int | sendoff_group
std::vector< char > | normal_groups
std::vector< CArray< stat::Average, 8 > > | frequency
| 統計測定用
std::vector< CArray< stat::Variance, 8 > > | variance_match
std::vector< stat::Variance > | variance_all
std::vector< Statistics > | statistics

## Detailed Description

Definition at line 30 of file rating/featureSet.h.

## Constructor & Destructor Documentation

## FeatureSet() [1/2]

osl::rating::FeatureSet::FeatureSet | ( | const FeatureSet & |  | ) |

private delete

References FeatureSet().

Referenced by FeatureSet(), and operator=().

## FeatureSet() [2/2]

osl::rating::FeatureSet::FeatureSet | ( |  | ) |

Definition at line 51 of file featureSet.cc.

References capture_group, checkmate_if_capture_group, and sendoff_group.

## ~FeatureSet()

osl::rating::FeatureSet::~FeatureSet | ( |  | ) |

virtual

Definition at line 57 of file featureSet.cc.

References showStatistics().

## Member Function Documentation

## add() [1/5]

void osl::rating::FeatureSet::add | ( | CaptureGroup * | g | ) |

protected

Definition at line 118 of file featureSet.cc.

References addCommon(), capture_group, and normal_groups.

## add() [2/5]

void osl::rating::FeatureSet::add | ( | CheckmateIfCaptureGroup * | g | ) |

protected

Definition at line 134 of file featureSet.cc.

References addCommon(), checkmate_if_capture_group, and normal_groups.

## add() [3/5]

void osl::rating::FeatureSet::add | ( | Feature * | f | ) |

protected

Definition at line 94 of file featureSet.cc.

References add().

Referenced by add(), osl::rating::CaptureSet::CaptureSet(), and osl::rating::StandardFeatureSet::StandardFeatureSet().

## add() [4/5]

void osl::rating::FeatureSet::add | ( | Group * | g | ) |

protected

Definition at line 111 of file featureSet.cc.

References addCommon(), and normal_groups.

## add() [5/5]

void osl::rating::FeatureSet::add | ( | SendOffGroup * | g | ) |

protected

Definition at line 126 of file featureSet.cc.

References addCommon(), normal_groups, and sendoff_group.

## addCommon()

void osl::rating::FeatureSet::addCommon | ( | Group * | g | ) |

protected

Definition at line 100 of file featureSet.cc.

References effective_in_check, osl::rating::Group::effectiveInCheck(), features, and groups.

Referenced by add(), add(), add(), and add().

## addFinished()

void osl::rating::FeatureSet::addFinished | ( |  | ) |

protected

Definition at line 78 of file featureSet.cc.

References features, frequency, groups, makeRange(), normal_groups, ranges, statistics, variance_all, variance_match, weights, and weightslog10.

Referenced by osl::rating::CaptureSet::CaptureSet(), and osl::rating::StandardFeatureSet::StandardFeatureSet().

## annotate()

const std::string osl::rating::FeatureSet::annotate | ( | const NumEffectState & | state,
|  | const RatingEnv & | env,
|  | Move | move ) const

Definition at line 614 of file featureSet.cc.

References effectiveInCheck(), groups, osl::NumEffectState::inCheck(), ranges, and weightslog10.

## defaultDirectory()

std::string osl::rating::FeatureSet::defaultDirectory | ( |  | ) |

static

Definition at line 672 of file featureSet.cc.

References osl::OslConfig::home().

Referenced by osl::rating::CaptureSet::CaptureSet(), osl::rating::StandardFeatureSet::healthCheck(), and osl::rating::StandardFeatureSet::StandardFeatureSet().

## effectiveInCheck()

bool osl::rating::FeatureSet::effectiveInCheck | ( | size_t | group_id | ) | const

inline

Definition at line 58 of file rating/featureSet.h.

References effective_in_check.

Referenced by annotate(), makeRate(), and makeRateWithCut().

## feature()

const Feature & osl::rating::FeatureSet::feature | ( | size_t | feature_id | ) | const

inline

Definition at line 59 of file rating/featureSet.h.

References features.

## featureSize()

size_t osl::rating::FeatureSet::featureSize | ( |  | ) | const

inline

Definition at line 63 of file rating/featureSet.h.

References features.

## generateLogProb()

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 388 of file featureSet.cc.

References osl::FixedCapacityVector< T, Capacity >::empty(), generateRating(), make_prob(), osl::rating::RatingEnv::progress, osl::container::MoveLogProbVector::push_back(), rating(), osl::FixedCapacityVector< T, Capacity >::size(), and osl::progress::ProgressN< N >::value().

## generateRating()

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 199 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().

## group()

const Group & osl::rating::FeatureSet::group | ( | size_t | group_id | ) | const

inline

Definition at line 57 of file rating/featureSet.h.

References groups.

Referenced by makeRange(), normalize(), range(), save(), and showGroup().

## groupSize()

size_t osl::rating::FeatureSet::groupSize | ( |  | ) | const

inline

Definition at line 62 of file rating/featureSet.h.

References groups.

## logProbKingEscape()

int osl::rating::FeatureSet::logProbKingEscape | ( | const NumEffectState & | state,
|  | const RatingEnv & | env,
|  | Move | move ) const

Definition at line 442 of file featureSet.cc.

References osl::NumEffectState::inCheck(), makeRate(), max_score, min_score, osl::rating::RatingEnv::progress, sc_length, sc_start, sc_width, score_to_depth, score_to_depth_kingescape, and osl::progress::ProgressN< N >::value().

## logProbSeePlus()

int osl::rating::FeatureSet::logProbSeePlus | ( | const NumEffectState & | state,
|  | const RatingEnv & | env,
|  | Move | move ) const

Definition at line 430 of file featureSet.cc.

References osl::NumEffectState::inCheck(), makeRate(), max_score, min_score, osl::rating::RatingEnv::progress, sc_length, sc_start, sc_width, score_to_depth, score_to_depth_seeplus, and osl::progress::ProgressN< N >::value().

## logProbTakeBack()

int osl::rating::FeatureSet::logProbTakeBack | ( | const NumEffectState & | state,
|  | const RatingEnv & | env,
|  | Move | move ) const

Definition at line 419 of file featureSet.cc.

References osl::NumEffectState::inCheck(), makeRate(), max_score, min_score, osl::rating::RatingEnv::progress, sc_length, sc_start, sc_width, score_to_depth, score_to_depth_takeback, and osl::progress::ProgressN< N >::value().

## makeRange()

const osl::rating::range_t osl::rating::FeatureSet::makeRange | ( | size_t | group | ) | const

private

Definition at line 65 of file featureSet.cc.

References group(), and groups.

Referenced by addFinished().

## makeRate()

const osl::rating::RatedMove osl::rating::FeatureSet::makeRate | ( | const NumEffectState & | state,
|  | bool | in_check,
|  | const RatingEnv & | env,
|  | Move | move ) const

Definition at line 480 of file featureSet.cc.

References capture_group, checkmate_if_capture_group, effectiveInCheck(), groups, normal_groups, rating(), and sendoff_group.

Referenced by generateRating(), logProbKingEscape(), logProbSeePlus(), logProbTakeBack(), and makeRateWithCut().

## makeRateWithCut()

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 572 of file featureSet.cc.

References capture_group, checkmate_if_capture_group, effectiveInCheck(), groups, makeRate(), MinRating, osl::rating::RatingEnv::progress, rating(), statistics, threshold, and osl::progress::ProgressN< N >::value().

Referenced by generateRating().

## normalize()

void osl::rating::FeatureSet::normalize | ( | const RatedMoveVector & | ,
|  | MoveLogProbVector & | out )

static

References group(), and rating().

## operator=()

FeatureSet & osl::rating::FeatureSet::operator= | ( | const FeatureSet & |  | ) |

private delete

References FeatureSet().

## range()

const range_t & osl::rating::FeatureSet::range | ( | size_t | group | ) | const

inline

Definition at line 60 of file rating/featureSet.h.

References group(), and ranges.

Referenced by save(), and showGroup().

## rating()

int osl::rating::FeatureSet::rating | ( | const NumEffectState & | state,
|  | const RatingEnv & | env,
|  | Move | move,
|  | size_t | group_id ) const

private

Definition at line 457 of file featureSet.cc.

References frequency, groups, osl::rating::RatingEnv::progress, ranges, osl::progress::ProgressN< N >::value(), variance_all, variance_match, and weightslog10.

Referenced by generateLogProb(), makeRate(), makeRateWithCut(), and normalize().

## save()

void osl::rating::FeatureSet::save | ( | const std::string & | output_directory,
|  | size_t | group_id ) const

Definition at line 648 of file featureSet.cc.

References group(), range(), and weights.

## setWeight()

void osl::rating::FeatureSet::setWeight | ( | size_t | feature_id,
|  | const double & | value )

Definition at line 192 of file featureSet.cc.

References weights, and weightslog10.

## showGroup()

void osl::rating::FeatureSet::showGroup | ( | std::ostream & | os,
|  | size_t | group_id ) const

Definition at line 641 of file featureSet.cc.

References group(), range(), and weights.

## showStatistics()

void osl::rating::FeatureSet::showStatistics | ( | std::ostream & | os | ) | const

Definition at line 654 of file featureSet.cc.

References frequency, groups, variance_all, and variance_match.

Referenced by ~FeatureSet().

## tryLoad()

bool osl::rating::FeatureSet::tryLoad | ( | const std::string & | input_directory | ) |

Definition at line 142 of file featureSet.cc.

References features, groups, ranges, statistics, weights, and weightslog10.

Referenced by osl::rating::CaptureSet::CaptureSet(), and osl::rating::StandardFeatureSet::StandardFeatureSet().

## weight()

const double & osl::rating::FeatureSet::weight | ( | size_t | feature_id | ) | const

inline

Definition at line 61 of file rating/featureSet.h.

References weights.

## Member Data Documentation

## capture_group

int osl::rating::FeatureSet::capture_group

private

makeRateで特別扱いのgroup

Definition at line 43 of file rating/featureSet.h.

Referenced by add(), FeatureSet(), makeRate(), and makeRateWithCut().

## checkmate_if_capture_group

int osl::rating::FeatureSet::checkmate_if_capture_group

private

Definition at line 43 of file rating/featureSet.h.

Referenced by add(), FeatureSet(), makeRate(), and makeRateWithCut().

## effective_in_check

std::vector<char> osl::rating::FeatureSet::effective_in_check

private

Definition at line 37 of file rating/featureSet.h.

Referenced by addCommon(), and effectiveInCheck().

## features

std::vector<Feature*> osl::rating::FeatureSet::features

private

Definition at line 38 of file rating/featureSet.h.

Referenced by addCommon(), addFinished(), feature(), featureSize(), and tryLoad().

## frequency

std::vector<CArray<stat::Average,8> > osl::rating::FeatureSet::frequency

mutable private

統計測定用

Definition at line 46 of file rating/featureSet.h.

Referenced by addFinished(), rating(), and showStatistics().

## groups

boost::ptr_vector<Group> osl::rating::FeatureSet::groups

private

Definition at line 36 of file rating/featureSet.h.

Referenced by addCommon(), addFinished(), annotate(), group(), groupSize(), makeRange(), makeRate(), makeRateWithCut(), rating(), showStatistics(), and tryLoad().

## normal_groups

std::vector<char> osl::rating::FeatureSet::normal_groups

private

Definition at line 44 of file rating/featureSet.h.

Referenced by add(), add(), add(), add(), addFinished(), and makeRate().

## ranges

std::vector<range_t> osl::rating::FeatureSet::ranges

private

Definition at line 39 of file rating/featureSet.h.

Referenced by addFinished(), annotate(), range(), rating(), and tryLoad().

## sendoff_group

int osl::rating::FeatureSet::sendoff_group

private

Definition at line 43 of file rating/featureSet.h.

Referenced by add(), FeatureSet(), and makeRate().

## statistics

std::vector<Statistics> osl::rating::FeatureSet::statistics

private

Definition at line 50 of file rating/featureSet.h.

Referenced by addFinished(), makeRateWithCut(), and tryLoad().

## variance_all

std::vector<stat::Variance> osl::rating::FeatureSet::variance_all

mutable private

Definition at line 48 of file rating/featureSet.h.

Referenced by addFinished(), rating(), and showStatistics().

## variance_match

std::vector<CArray<stat::Variance,8> > osl::rating::FeatureSet::variance_match

mutable private

Definition at line 47 of file rating/featureSet.h.

Referenced by addFinished(), rating(), and showStatistics().

## weights

std::vector<double> osl::rating::FeatureSet::weights

private

Definition at line 40 of file rating/featureSet.h.

Referenced by addFinished(), save(), setWeight(), showGroup(), tryLoad(), and weight().

## weightslog10

std::vector<int> osl::rating::FeatureSet::weightslog10

private

Definition at line 41 of file rating/featureSet.h.

Referenced by addFinished(), annotate(), rating(), setWeight(), and tryLoad().

The documentation for this class was generated from the following files:

- rating/featureSet.h
- featureSet.cc