osl::OslConfig Struct Reference

osl の実行環境に関する指定 More...

`#include <oslConfig.h>`

## Public Types

enum | UsiMode { NoUSI , PortableUSI , ExtendedUSI }

## Static Public Member Functions

static const std::string & | home (const std::string &initialize_if_first_invocation="")
| compile時に指定されたディレクトリを返す.
static const char * | home_c_str ()
static const std::string | gpsusiConf ()
static const std::string | testPrivate ()
| テストケースのデータ
static const std::string | testPublic ()
static const char * | testPrivateFile (const std::string &filename)
static const char * | testPublicFile (const std::string &filename)
static const char * | testCsaFile (const std::string &filename)
static const char * | openingBook (const std::string &filenamme="")
| 標準の定跡ファイルを返す
static void | setVerbose (bool verbose)
static bool | verbose ()
static void | showOslHome ()
static void | setNumCPUs (int ncpu)
static int | concurrency ()
static int | dfpnMaxDepth ()
static void | setDfpnMaxDepth (int)
static UsiMode | usiMode ()
static void | setUsiMode (UsiMode new_mode=PortableUSI)
static bool | usiModeInSilent ()
static void | setUsiSilent (bool silent=true)
static bool | searchExactValueInOneReply ()
static void | setSearchExactValueInOneReply (bool new_value)
static size_t | residentMemoryUse ()
static size_t | memoryUseLimit ()
static void | setMemoryUseLimit (size_t limit)
static double | memoryUseRatio ()
static bool | isMemoryLimitEffective ()
static void | setMemoryUsePercent (double limit)
static unsigned int | evalRandom ()
static void | setEvalRandom (unsigned int sigma)
static void | setUsiOutputPawnValue (int new_value)
static int | usiOutputPawnValue ()
static int | inUnitTest ()
static bool | inUnitTestShort ()
static bool | inUnitTestLong ()
static void | setInUnitTest (int new_value)
static void | setUp ()
| 評価関数等を初期化.
static bool | hasByoyomi ()
static void | setHasByoyomi (bool)
static bool | healthCheck ()
static int | resignThreshold ()
static std::string | configuration ()
static void | registerInitializer (std::function< void()>)

## Static Public Attributes

static const int | MaxThreads =64
static std::mutex | lock_io

## Static Private Member Functions

static const std::string | makeHome (const std::string &first_try="")
static const std::string | makeTest ()
static const std::string | makeTestPublic ()
static bool | isGoodDir (const std::string &)
static void | trySetDir (std::string &, const std::string &)
static void | showOslHome (const std::string &)

## Static Private Attributes

static size_t | memory_use_limit = system_memory_use_limit()
static double | memory_use_percent = 100.0
static const size_t | memory_use_limit_system_max
static unsigned int | eval_random = 0
static bool | is_verbose = false
static const int | default_ncpus = std::thread::hardware_concurrency()
static int | num_cpu = default_ncpus
static volatile UsiMode | usi_mode = osl::OslConfig::NoUSI
static volatile bool | usi_mode_silent = false
static int | usi_output_pawn_value = 100
static bool | search_exact_value_in_one_reply = false
static bool | has_byoyomi = false
static volatile bool | force_root_window = false
static volatile int | root_window_alpha = 0
static volatile int | root_window_beta = 0
static volatile int | in_unit_test = 0
static int | dfpn_max_depth = 256

## Detailed Description

osl の実行環境に関する指定

Definition at line 18 of file oslConfig.h.

## Member Enumeration Documentation

## UsiMode

enum osl::OslConfig::UsiMode

Enumerator
NoUSI |
PortableUSI |
ExtendedUSI |

Definition at line 49 of file oslConfig.h.

## Member Function Documentation

## concurrency()

int osl::OslConfig::concurrency | ( |  | ) |

static

Definition at line 133 of file oslConfig.cc.

References MaxThreads, and num_cpu.

## configuration()

std::string osl::OslConfig::configuration | ( |  | ) |

static

Definition at line 500 of file oslConfig.cc.

References OSL_WORDSIZE.

## dfpnMaxDepth()

int osl::OslConfig::dfpnMaxDepth | ( |  | ) |

static

Definition at line 491 of file oslConfig.cc.

References dfpn_max_depth.

## evalRandom()

unsigned int osl::OslConfig::evalRandom | ( |  | ) |

inline static

Returns
  standard deviation of normal distribution

Definition at line 81 of file oslConfig.h.

References eval_random.

## gpsusiConf()

const std::string osl::OslConfig::gpsusiConf | ( |  | ) |

static

Definition at line 250 of file oslConfig.cc.

References makeHome().

## hasByoyomi()

bool osl::OslConfig::hasByoyomi | ( |  | ) |

static

Definition at line 175 of file oslConfig.cc.

References has_byoyomi.

## healthCheck()

bool osl::OslConfig::healthCheck | ( |  | ) |

static

Definition at line 453 of file oslConfig.cc.

References osl::progress::ml::NewProgress::defaultFilename(), home(), osl::progress::ml::NewProgress::setUp(), setVerbose(), showOslHome(), and verbose().

## home()

const std::string & osl::OslConfig::home | ( | const std::string & | initialize_if_first_invocation = "" | ) |

static

compile時に指定されたディレクトリを返す.

実行時の指定は環境変数が基本

Definition at line 239 of file oslConfig.cc.

References makeHome().

Referenced by osl::rating::FeatureSet::defaultDirectory(), osl::eval::ml::OpenMidEndingEval::defaultFilename(), osl::progress::ml::NewProgress::defaultFilename(), healthCheck(), home_c_str(), makeTest(), makeTestPublic(), openingBook(), osl::move_probability::StandardFeatureSet::setUp(), showOslHome(), showOslHome(), and osl::rating::StandardFeatureSet::StandardFeatureSet().

## home_c_str()

const char * osl::OslConfig::home_c_str | ( |  | ) |

static

Definition at line 245 of file oslConfig.cc.

References home().

## inUnitTest()

int osl::OslConfig::inUnitTest | ( |  | ) |

inline static

Returns
  0 not testing, 1 short test, 2 long test

Definition at line 87 of file oslConfig.h.

References in_unit_test.

Referenced by osl::csa::CsaFileMinimal::parseLine(), and osl::record::CsaFile::read().

## inUnitTestLong()

bool osl::OslConfig::inUnitTestLong | ( |  | ) |

inline static

Definition at line 89 of file oslConfig.h.

References in_unit_test.

## inUnitTestShort()

bool osl::OslConfig::inUnitTestShort | ( |  | ) |

inline static

Definition at line 88 of file oslConfig.h.

References in_unit_test.

## isGoodDir()

bool osl::OslConfig::isGoodDir | ( | const std::string & | dir | ) |

static private

Definition at line 196 of file oslConfig.cc.

Referenced by trySetDir().

## isMemoryLimitEffective()

bool osl::OslConfig::isMemoryLimitEffective | ( |  | ) |

inline static

Definition at line 68 of file oslConfig.h.

References memory_use_limit, memory_use_limit_system_max, and residentMemoryUse().

## makeHome()

const std::string osl::OslConfig::makeHome | ( | const std::string & | first_try = "" | ) |

static private

Definition at line 213 of file oslConfig.cc.

References showOslHome(), trySetDir(), and verbose().

Referenced by gpsusiConf(), and home().

## makeTest()

const std::string osl::OslConfig::makeTest | ( |  | ) |

static private

Definition at line 274 of file oslConfig.cc.

References home(), and trySetDir().

Referenced by testPrivate().

## makeTestPublic()

const std::string osl::OslConfig::makeTestPublic | ( |  | ) |

static private

Definition at line 287 of file oslConfig.cc.

References home(), and trySetDir().

Referenced by testPublic().

## memoryUseLimit()

size_t osl::OslConfig::memoryUseLimit | ( |  | ) |

inline static

Definition at line 59 of file oslConfig.h.

References memory_use_limit, and memory_use_percent.

Referenced by memoryUseRatio(), and osl::checkmate::DualDfpn::runGC().

## memoryUseRatio()

double osl::OslConfig::memoryUseRatio | ( |  | ) |

inline static

Definition at line 64 of file oslConfig.h.

References memoryUseLimit(), and residentMemoryUse().

Referenced by osl::checkmate::DfpnPathTable::runGC(), and osl::checkmate::DfpnTable::runGC().

## openingBook()

const char * osl::OslConfig::openingBook | ( | const std::string & | filenamme = "" | ) |

static

標準の定跡ファイルを返す

Parameters

  filename | specify to use non-standard file (absolute path, or home()/data/filename otherwise)

Definition at line 369 of file oslConfig.cc.

References home().

Referenced by osl::book::BookInMemory::readAll().

## registerInitializer()

void osl::OslConfig::registerInitializer | ( | std::function< void()> | f | ) |

static

Definition at line 449 of file oslConfig.cc.

References function_vector().

Referenced by osl::SetUpRegister::SetUpRegister().

## residentMemoryUse()

size_t osl::OslConfig::residentMemoryUse | ( |  | ) |

static

Definition at line 388 of file oslConfig.cc.

Referenced by isMemoryLimitEffective(), and memoryUseRatio().

## resignThreshold()

int osl::OslConfig::resignThreshold | ( |  | ) |

static

Definition at line 267 of file oslConfig.cc.

## searchExactValueInOneReply()

bool osl::OslConfig::searchExactValueInOneReply | ( |  | ) |

static

Definition at line 166 of file oslConfig.cc.

References search_exact_value_in_one_reply.

## setDfpnMaxDepth()

void osl::OslConfig::setDfpnMaxDepth | ( | int | new_depth | ) |

static

Definition at line 495 of file oslConfig.cc.

References dfpn_max_depth.

## setEvalRandom()

void osl::OslConfig::setEvalRandom | ( | unsigned int | sigma | ) |

inline static

Definition at line 82 of file oslConfig.h.

References eval_random.

## setHasByoyomi()

void osl::OslConfig::setHasByoyomi | ( | bool | value | ) |

static

Definition at line 180 of file oslConfig.cc.

References has_byoyomi.

## setInUnitTest()

void osl::OslConfig::setInUnitTest | ( | int | new_value | ) |

inline static

Definition at line 90 of file oslConfig.h.

References in_unit_test.

## setMemoryUseLimit()

void osl::OslConfig::setMemoryUseLimit | ( | size_t | limit | ) |

inline static

Definition at line 63 of file oslConfig.h.

References memory_use_limit.

## setMemoryUsePercent()

void osl::OslConfig::setMemoryUsePercent | ( | double | limit | ) |

inline static

Definition at line 73 of file oslConfig.h.

References memory_use_percent.

## setNumCPUs()

void osl::OslConfig::setNumCPUs | ( | int | ncpu | ) |

static

Definition at line 124 of file oslConfig.cc.

References MaxThreads, and num_cpu.

## setSearchExactValueInOneReply()

void osl::OslConfig::setSearchExactValueInOneReply | ( | bool | new_value | ) |

static

Definition at line 170 of file oslConfig.cc.

References search_exact_value_in_one_reply.

## setUp()

void osl::OslConfig::setUp | ( |  | ) |

static

評価関数等を初期化.

mainの中で一度呼ぶ必要がある

Definition at line 438 of file oslConfig.cc.

References function_vector(), osl::eval::OpenMidEndingEval::setUp(), and osl::progress::NewProgress::setUp().

## setUsiMode()

void osl::OslConfig::setUsiMode | ( | UsiMode | new_mode = PortableUSI | ) |

static

Definition at line 154 of file oslConfig.cc.

References usi_mode.

## setUsiOutputPawnValue()

void osl::OslConfig::setUsiOutputPawnValue | ( | int | new_value | ) |

inline static

Definition at line 84 of file oslConfig.h.

References usi_output_pawn_value.

## setUsiSilent()

void osl::OslConfig::setUsiSilent | ( | bool | silent = true | ) |

static

Definition at line 162 of file oslConfig.cc.

References usi_mode_silent.

## setVerbose()

void osl::OslConfig::setVerbose | ( | bool | verbose | ) |

static

Definition at line 140 of file oslConfig.cc.

References is_verbose.

Referenced by healthCheck().

## showOslHome() [1/2]

void osl::OslConfig::showOslHome | ( |  | ) |

static

Definition at line 191 of file oslConfig.cc.

References home(), and showOslHome().

Referenced by healthCheck(), makeHome(), and showOslHome().

## showOslHome() [2/2]

void osl::OslConfig::showOslHome | ( | const std::string & | home | ) |

static private

Definition at line 185 of file oslConfig.cc.

References home(), and OSL_WORDSIZE.

## testCsaFile()

const char * osl::OslConfig::testCsaFile | ( | const std::string & | filename | ) |

static

Definition at line 359 of file oslConfig.cc.

References testPublic().

## testPrivate()

const std::string osl::OslConfig::testPrivate | ( |  | ) |

static

テストケースのデータ

Definition at line 300 of file oslConfig.cc.

References makeTest().

Referenced by testPrivateFile().

## testPrivateFile()

const char * osl::OslConfig::testPrivateFile | ( | const std::string & | filename | ) |

static

Definition at line 339 of file oslConfig.cc.

References testPrivate().

## testPublic()

const std::string osl::OslConfig::testPublic | ( |  | ) |

static

Definition at line 306 of file oslConfig.cc.

References makeTestPublic().

Referenced by testCsaFile(), and testPublicFile().

## testPublicFile()

const char * osl::OslConfig::testPublicFile | ( | const std::string & | filename | ) |

static

Definition at line 349 of file oslConfig.cc.

References testPublic().

## trySetDir()

void osl::OslConfig::trySetDir | ( | std::string & | dir,
|  | const std::string & | candidate )

static private

Definition at line 202 of file oslConfig.cc.

References isGoodDir(), and verbose().

Referenced by makeHome(), makeTest(), and makeTestPublic().

## usiMode()

osl::OslConfig::UsiMode osl::OslConfig::usiMode | ( |  | ) |

static

Definition at line 150 of file oslConfig.cc.

References usi_mode.

## usiModeInSilent()

bool osl::OslConfig::usiModeInSilent | ( |  | ) |

static

Definition at line 158 of file oslConfig.cc.

References usi_mode_silent.

## usiOutputPawnValue()

int osl::OslConfig::usiOutputPawnValue | ( |  | ) |

inline static

Definition at line 85 of file oslConfig.h.

References usi_output_pawn_value.

## verbose()

bool osl::OslConfig::verbose | ( |  | ) |

static

Definition at line 145 of file oslConfig.cc.

References is_verbose.

Referenced by healthCheck(), makeHome(), osl::misc::BinaryElementReader< T >::State< T >::tryRead(), and trySetDir().

## Member Data Documentation

## default_ncpus

const int osl::OslConfig::default_ncpus = std::thread::hardware_concurrency()

static private

Definition at line 112 of file oslConfig.h.

## dfpn_max_depth

int osl::OslConfig::dfpn_max_depth = 256

static private

Definition at line 121 of file oslConfig.h.

Referenced by dfpnMaxDepth(), and setDfpnMaxDepth().

## eval_random

unsigned int osl::OslConfig::eval_random = 0

static private

Definition at line 110 of file oslConfig.h.

Referenced by evalRandom(), and setEvalRandom().

## force_root_window

volatile bool osl::OslConfig::force_root_window = false

static private

Definition at line 118 of file oslConfig.h.

## has_byoyomi

bool osl::OslConfig::has_byoyomi = false

static private

Definition at line 117 of file oslConfig.h.

Referenced by hasByoyomi(), and setHasByoyomi().

## in_unit_test

volatile int osl::OslConfig::in_unit_test = 0

static private

Definition at line 120 of file oslConfig.h.

Referenced by inUnitTest(), inUnitTestLong(), inUnitTestShort(), and setInUnitTest().

## is_verbose

bool osl::OslConfig::is_verbose = false

static private

Definition at line 111 of file oslConfig.h.

Referenced by setVerbose(), and verbose().

## lock_io

std::mutex osl::OslConfig::lock_io

static

Definition at line 123 of file oslConfig.h.

## MaxThreads

const int osl::OslConfig::MaxThreads =64

static

Definition at line 20 of file oslConfig.h.

Referenced by concurrency(), and setNumCPUs().

## memory_use_limit

size_t osl::OslConfig::memory_use_limit = system_memory_use_limit()

static private

Definition at line 107 of file oslConfig.h.

Referenced by isMemoryLimitEffective(), memoryUseLimit(), and setMemoryUseLimit().

## memory_use_limit_system_max

const size_t osl::OslConfig::memory_use_limit_system_max

static private

Initial value:
=
std::numeric_limits<rlim_t>::max()

Definition at line 109 of file oslConfig.h.

Referenced by isMemoryLimitEffective().

## memory_use_percent

double osl::OslConfig::memory_use_percent = 100.0

static private

Definition at line 108 of file oslConfig.h.

Referenced by memoryUseLimit(), and setMemoryUsePercent().

## num_cpu

int osl::OslConfig::num_cpu = default_ncpus

static private

Definition at line 113 of file oslConfig.h.

Referenced by concurrency(), and setNumCPUs().

## root_window_alpha

volatile int osl::OslConfig::root_window_alpha = 0

static private

Definition at line 119 of file oslConfig.h.

## root_window_beta

volatile int osl::OslConfig::root_window_beta = 0

static private

Definition at line 119 of file oslConfig.h.

## search_exact_value_in_one_reply

bool osl::OslConfig::search_exact_value_in_one_reply = false

static private

Definition at line 117 of file oslConfig.h.

Referenced by searchExactValueInOneReply(), and setSearchExactValueInOneReply().

## usi_mode

volatile osl::OslConfig::UsiMode osl::OslConfig::usi_mode = osl::OslConfig::NoUSI

static private

Definition at line 114 of file oslConfig.h.

Referenced by setUsiMode(), and usiMode().

## usi_mode_silent

volatile bool osl::OslConfig::usi_mode_silent = false

static private

Definition at line 115 of file oslConfig.h.

Referenced by setUsiSilent(), and usiModeInSilent().

## usi_output_pawn_value

int osl::OslConfig::usi_output_pawn_value = 100

static private

Definition at line 116 of file oslConfig.h.

Referenced by setUsiOutputPawnValue(), and usiOutputPawnValue().

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

- oslConfig.h
- oslConfig.cc