bradleyTerry.h
Go to the documentation of this file.
/* bradleyTerry.h
*/
#ifndef _BRADLEYTERRY_H
#define _BRADLEYTERRY_H
#include "osl/rating/featureSet.h"
#include <valarray>
namespace osl
{
namespace rating
{
class BradleyTerry
{
typedef std::valarray<double> valarray_t;
FeatureSet& features;
std::string kisen_filename, output_directory;
int kisen_start;
size_t num_cpus, num_records;
int verbose;
int fix_group;
size_t min_rating;
public:
BradleyTerry(FeatureSet& features, const std::string& kisen_file, int kisen_start=0);
~BradleyTerry();
void setNumCpus(int new_num_cpus) { num_cpus = new_num_cpus; };
void setNumRecords(size_t new_num_records) { num_records = new_num_records; };
void setOutputDirectory(const std::string& new_output) { output_directory = new_output; };
void setFixGroup(int new_fix_group) { fix_group = new_fix_group; };
void setVerbose(int new_verbose) { verbose = new_verbose; };
void setMinRating(int new_min) { min_rating = new_min; };
void iterate();
private:
void update(size_t g);
bool addSquare(size_t g, const NumEffectState& state,
const RatingEnv& env, Move selected,
valarray_t& wins, std::valarray<long double>& denominator) const;
class Thread;
friend class Thread;
size_t accumulate(size_t g, size_t first, size_t last, valarray_t& wins, std::valarray<long double>& denominator) const;
};
}
}
#endif /* _BRADLEYTERRY_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::rating::BradleyTerry::Thread
Definition bradleyTerry.cc:79
osl::rating::BradleyTerry::setNumRecords
void setNumRecords(size_t new_num_records)
Definition bradleyTerry.h:29
osl::rating::BradleyTerry::update
void update(size_t g)
Definition bradleyTerry.cc:137
osl::rating::BradleyTerry::num_records
size_t num_records
Definition bradleyTerry.h:20
osl::rating::BradleyTerry::kisen_filename
std::string kisen_filename
Definition bradleyTerry.h:18
osl::rating::BradleyTerry::valarray_t
std::valarray< double > valarray_t
Definition bradleyTerry.h:15
osl::rating::BradleyTerry::BradleyTerry
BradleyTerry(FeatureSet &features, const std::string &kisen_file, int kisen_start=0)
Definition bradleyTerry.cc:14
osl::rating::BradleyTerry::features
FeatureSet & features
Definition bradleyTerry.h:16
osl::rating::BradleyTerry::setVerbose
void setVerbose(int new_verbose)
Definition bradleyTerry.h:32
osl::rating::BradleyTerry::setNumCpus
void setNumCpus(int new_num_cpus)
Definition bradleyTerry.h:28
osl::rating::BradleyTerry::addSquare
bool addSquare(size_t g, const NumEffectState &state, const RatingEnv &env, Move selected, valarray_t &wins, std::valarray< long double > &denominator) const
Definition bradleyTerry.cc:25
osl::rating::BradleyTerry::~BradleyTerry
~BradleyTerry()
Definition bradleyTerry.cc:20
osl::rating::BradleyTerry::accumulate
size_t accumulate(size_t g, size_t first, size_t last, valarray_t &wins, std::valarray< long double > &denominator) const
Definition bradleyTerry.cc:99
osl::rating::BradleyTerry::setMinRating
void setMinRating(int new_min)
Definition bradleyTerry.h:33
osl::rating::BradleyTerry::setOutputDirectory
void setOutputDirectory(const std::string &new_output)
Definition bradleyTerry.h:30
osl::rating::BradleyTerry::setFixGroup
void setFixGroup(int new_fix_group)
Definition bradleyTerry.h:31
osl::rating::BradleyTerry::fix_group
int fix_group
Definition bradleyTerry.h:22
osl::rating::BradleyTerry::num_cpus
size_t num_cpus
Definition bradleyTerry.h:20
osl::rating::BradleyTerry::verbose
int verbose
Definition bradleyTerry.h:21
osl::rating::BradleyTerry::kisen_start
int kisen_start
Definition bradleyTerry.h:19
osl::rating::BradleyTerry::Thread
friend class Thread
Definition bradleyTerry.h:43
osl::rating::BradleyTerry::output_directory
std::string output_directory
Definition bradleyTerry.h:18
osl::rating::BradleyTerry::iterate
void iterate()
Definition bradleyTerry.cc:189
osl::rating::BradleyTerry::min_rating
size_t min_rating
Definition bradleyTerry.h:23
osl::rating::FeatureSet
Definition rating/featureSet.h:31
osl::rating::RatingEnv
Definition ratingEnv.h:16
osl::rating
Definition construct.h:18
osl
Definition additionalEffect.h:6
featureSet.h