osl::rating::BradleyTerry Class Reference

`#include <bradleyTerry.h>`

## Classes

class | Thread

## Public Member Functions

| BradleyTerry (FeatureSet &features, const std::string &kisen_file, int kisen_start=0)
| ~BradleyTerry ()
void | setNumCpus (int new_num_cpus)
void | setNumRecords (size_t new_num_records)
void | setOutputDirectory (const std::string &new_output)
void | setFixGroup (int new_fix_group)
void | setVerbose (int new_verbose)
void | setMinRating (int new_min)
void | iterate ()

## Private Types

typedef std::valarray< double > | valarray_t

## Private Member Functions

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
size_t | accumulate (size_t g, size_t first, size_t last, valarray_t &wins, std::valarray< long double > &denominator) const

## Private Attributes

FeatureSet & | features
std::string | kisen_filename
std::string | output_directory
int | kisen_start
size_t | num_cpus
size_t | num_records
int | verbose
int | fix_group
size_t | min_rating

## Friends

class | Thread

## Detailed Description

Definition at line 13 of file bradleyTerry.h.

## Member Typedef Documentation

## valarray_t

typedef std::valarray<double> osl::rating::BradleyTerry::valarray_t

private

Definition at line 15 of file bradleyTerry.h.

## Constructor & Destructor Documentation

## BradleyTerry()

osl::rating::BradleyTerry::BradleyTerry | ( | FeatureSet & | features,
|  | const std::string & | kisen_file,
|  | int | kisen_start = 0 )

Definition at line 13 of file bradleyTerry.cc.

References features, fix_group, kisen_filename, kisen_start, min_rating, num_cpus, num_records, and verbose.

Referenced by osl::rating::BradleyTerry::Thread::Thread().

## ~BradleyTerry()

osl::rating::BradleyTerry::~BradleyTerry | ( |  | ) |

Definition at line 20 of file bradleyTerry.cc.

## Member Function Documentation

## accumulate()

size_t osl::rating::BradleyTerry::accumulate | ( | size_t | g,
|  | size_t | first,
|  | size_t | last,
|  | valarray_t & | wins,
|  | std::valarray< long double > & | denominator ) const

private

Definition at line 98 of file bradleyTerry.cc.

References addSquare(), osl::BLACK, features, osl::ImmediateCheckmate::hasCheckmateMove(), osl::NumEffectState::inCheck(), osl::record::KisenFile::initialState(), osl::KisenFile::ipxFileName(), kisen_filename, kisen_start, osl::rating::RatingEnv::make(), osl::NumEffectState::makeMove(), min_rating, osl::record::KisenFile::moves(), osl::record::KisenIpxFile::rating(), osl::SimpleState::turn(), osl::rating::RatingEnv::update(), and osl::WHITE.

Referenced by update().

## addSquare()

bool osl::rating::BradleyTerry::addSquare | ( | size_t | g,
|  | const NumEffectState & | state,
|  | const RatingEnv & | env,
|  | Move | selected,
|  | valarray_t & | wins,
|  | std::valarray< long double > & | denominator ) const

private

Definition at line 24 of file bradleyTerry.cc.

References features, osl::NumEffectState::generateLegal(), osl::FixedCapacityVector< T, Capacity >::isMember(), osl::FixedCapacityVector< T, Capacity >::size(), and osl::SimpleState::turn().

Referenced by accumulate().

## iterate()

void osl::rating::BradleyTerry::iterate | ( |  | ) |

Definition at line 188 of file bradleyTerry.cc.

References features, fix_group, output_directory, and update().

## setFixGroup()

void osl::rating::BradleyTerry::setFixGroup | ( | int | new_fix_group | ) |

inline

Definition at line 31 of file bradleyTerry.h.

References fix_group.

## setMinRating()

void osl::rating::BradleyTerry::setMinRating | ( | int | new_min | ) |

inline

Definition at line 33 of file bradleyTerry.h.

References min_rating.

## setNumCpus()

void osl::rating::BradleyTerry::setNumCpus | ( | int | new_num_cpus | ) |

inline

Definition at line 28 of file bradleyTerry.h.

References num_cpus.

## setNumRecords()

void osl::rating::BradleyTerry::setNumRecords | ( | size_t | new_num_records | ) |

inline

Definition at line 29 of file bradleyTerry.h.

References num_records.

## setOutputDirectory()

void osl::rating::BradleyTerry::setOutputDirectory | ( | const std::string & | new_output | ) |

inline

Definition at line 30 of file bradleyTerry.h.

References output_directory.

## setVerbose()

void osl::rating::BradleyTerry::setVerbose | ( | int | new_verbose | ) |

inline

Definition at line 32 of file bradleyTerry.h.

References verbose.

## update()

void osl::rating::BradleyTerry::update | ( | size_t | g | ) |

private

Definition at line 136 of file bradleyTerry.cc.

References accumulate(), osl::rating::BradleyTerry::Thread::denominator, features, kisen_filename, num_cpus, num_records, osl::record::KisenFile::size(), osl::rating::BradleyTerry::Thread::skip, Thread, and osl::rating::BradleyTerry::Thread::wins.

Referenced by iterate().

## Friends And Related Symbol Documentation

## Thread

friend class Thread

friend

Definition at line 43 of file bradleyTerry.h.

Referenced by update().

## Member Data Documentation

## features

FeatureSet& osl::rating::BradleyTerry::features

private

Definition at line 16 of file bradleyTerry.h.

Referenced by accumulate(), addSquare(), BradleyTerry(), iterate(), and update().

## fix_group

int osl::rating::BradleyTerry::fix_group

private

Definition at line 22 of file bradleyTerry.h.

Referenced by BradleyTerry(), iterate(), and setFixGroup().

## kisen_filename

std::string osl::rating::BradleyTerry::kisen_filename

private

Definition at line 18 of file bradleyTerry.h.

Referenced by accumulate(), BradleyTerry(), and update().

## kisen_start

int osl::rating::BradleyTerry::kisen_start

private

Definition at line 19 of file bradleyTerry.h.

Referenced by accumulate(), and BradleyTerry().

## min_rating

size_t osl::rating::BradleyTerry::min_rating

private

Definition at line 23 of file bradleyTerry.h.

Referenced by accumulate(), BradleyTerry(), and setMinRating().

## num_cpus

size_t osl::rating::BradleyTerry::num_cpus

private

Definition at line 20 of file bradleyTerry.h.

Referenced by BradleyTerry(), setNumCpus(), and update().

## num_records

size_t osl::rating::BradleyTerry::num_records

private

Definition at line 20 of file bradleyTerry.h.

Referenced by BradleyTerry(), setNumRecords(), and update().

## output_directory

std::string osl::rating::BradleyTerry::output_directory

private

Definition at line 18 of file bradleyTerry.h.

Referenced by iterate(), and setOutputDirectory().

## verbose

int osl::rating::BradleyTerry::verbose

private

Definition at line 21 of file bradleyTerry.h.

Referenced by BradleyTerry(), and setVerbose().

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

- bradleyTerry.h
- bradleyTerry.cc