osl::rating::FeatureSet Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
osl::rating::FeatureSet Class Reference

`#include <featureSet.h>`

Inheritance diagram for osl::rating::FeatureSet:
[legend]
Collaboration diagram for osl::rating::FeatureSet:
[legend]

## 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
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
vector< char > | effective_in_check
vector< Feature * > | features
vector< range_t > | ranges
vector< double > | weights
vector< int > | weightslog10
int | capture_group
| makeRateで特別扱いのgroup More...
int | checkmate_if_capture_group
int | sendoff_group
vector< char > | normal_groups
vector< CArray< stat::Average, 8 > > | frequency
| 統計測定用 More...
vector< CArray< stat::Variance, 8 > > | variance_match
vector< stat::Variance > | variance_all
vector< Statistics > | statistics

## Detailed Description

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

## Constructor & Destructor Documentation

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

Definition at line 54 of file rating/featureSet.cc.

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

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

References showStatistics().

## Member Function Documentation

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

Definition at line 97 of file rating/featureSet.cc.

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

Definition at line 114 of file rating/featureSet.cc.

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

Definition at line 121 of file rating/featureSet.cc.

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

Definition at line 129 of file rating/featureSet.cc.

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

Definition at line 137 of file rating/featureSet.cc.

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

Definition at line 103 of file rating/featureSet.cc.

References osl::rating::Group::effectiveInCheck().

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

Definition at line 81 of file rating/featureSet.cc.

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

Definition at line 635 of file rating/featureSet.cc.

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

Definition at line 692 of file rating/featureSet.cc.

References osl::OslConfig::home().

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

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

References effective_in_check.

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

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

References features.

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

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

References features.

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 391 of file rating/featureSet.cc.

References make_prob(), and osl::rating::RatingEnv::progress.

Referenced by osl::search::MoveGenerator::generateAll(), osl::game_playing::UsiResponse::genmoveProbability(), and show().

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 202 of file rating/featureSet.cc.

References osl::alt(), osl::GenerateAllMoves::generate(), osl::GenerateEscapeKing::generate(), osl::move_classifier::PlayerMoveAdaptor< Classifier >::isMember(), osl::KING, MinRating, moves, osl::rating::RatingEnv::my_pin, osl::rating::RatedMove::rating(), and osl::rating::RatedMoveVector::sort().

Referenced by osl::search::AlphaBeta3::generateAllMoves(), osl::search::AlphaBeta3::searchRoot(), show(), and test_position().

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

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

References groups.

Referenced by range().

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

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

References groups.

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

Definition at line 445 of file rating/featureSet.cc.

References osl::eval::max(), osl::eval::min(), min_score, osl::rating::RatingEnv::progress, sc_length, sc_start, sc_width, and score_to_depth.

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

Definition at line 433 of file rating/featureSet.cc.

References osl::eval::max(), osl::eval::min(), min_score, osl::rating::RatingEnv::progress, sc_length, sc_start, sc_width, and score_to_depth.

Referenced by osl::search::MoveGenerator::addCapture().

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

Definition at line 422 of file rating/featureSet.cc.

References osl::eval::max(), osl::eval::min(), min_score, osl::rating::RatingEnv::progress, sc_length, sc_start, sc_width, and score_to_depth.

Referenced by osl::search::MoveGenerator::generateTakeBack().

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

Definition at line 68 of file rating/featureSet.cc.

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

Definition at line 483 of file rating/featureSet.cc.

References osl::ntesuki::capture(), and osl::eval::max().

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 593 of file rating/featureSet.cc.

References osl::ntesuki::capture(), osl::eval::max(), MinRating, and osl::rating::RatingEnv::progress.

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

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

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

References group(), and ranges.

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

Definition at line 460 of file rating/featureSet.cc.

References osl::rating::RatingEnv::progress.

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

Definition at line 669 of file rating/featureSet.cc.

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

Definition at line 195 of file rating/featureSet.cc.

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

Definition at line 662 of file rating/featureSet.cc.

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

Definition at line 675 of file rating/featureSet.cc.

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

Definition at line 145 of file rating/featureSet.cc.

References osl::rating::FeatureSet::Statistics::average, osl::rating::FeatureSet::Statistics::probability, result, and osl::rating::FeatureSet::Statistics::variance.

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

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

References weights.

## Member Data Documentation

int osl::rating::FeatureSet::capture_group
| private

makeRateで特別扱いのgroup

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

int osl::rating::FeatureSet::checkmate_if_capture_group
| private

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

vector<char> osl::rating::FeatureSet::effective_in_check
| private

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

Referenced by effectiveInCheck().

vector<Feature*> osl::rating::FeatureSet::features
| private

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

Referenced by feature(), and featureSize().

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

統計測定用

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

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

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

Referenced by group(), and groupSize().

vector<char> osl::rating::FeatureSet::normal_groups
| private

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

vector<range_t> osl::rating::FeatureSet::ranges
| private

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

Referenced by range().

int osl::rating::FeatureSet::sendoff_group
| private

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

vector<Statistics> osl::rating::FeatureSet::statistics
| private

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

vector<stat::Variance> osl::rating::FeatureSet::variance_all
| mutableprivate

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

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

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

vector<double> osl::rating::FeatureSet::weights
| private

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

Referenced by weight().

vector<int> osl::rating::FeatureSet::weightslog10
| private

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

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

- rating/featureSet.h
- rating/featureSet.cc