osl::search::SearchTimer 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
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
osl::search::SearchTimer Class Reference

`#include <searchTimer.h>`

Inheritance diagram for osl::search::SearchTimer:
[legend]

## Public Member Functions
| SearchTimer ()
| SearchTimer (const SearchTimer &src)
virtual | ~SearchTimer ()
void | setTimeAssign (const TimeAssigned &a)
void | setStartTime (MilliSeconds start)
void | setStable (bool new_stable)
bool | isStableNow () const
bool | hasSchedule () const
const TimeAssigned & | timeAssigned () const
const MilliSeconds | startTime () const
double | elapsed (MilliSeconds now) const
double | elapsed () const
void | setNextIterationCoefficient (double new_value)
void | setNodeCountHardLimit (uint64_t new_value)
double | nextIterationCoefficient () const
bool | stopping () const
void | stopNow ()
SearchTimerCommon::StopReason | stopReason ()
void | throwIfNoMoreTime (uint64_t node_count)
int | nodeAffordable () const
void | addMonitor (const boost::shared_ptr< SearchMonitor > &)
bool | hasMonitor () const
const vector < boost::shared_ptr < SearchMonitor > > & | monitors () const
int | lastMemoryUseRatio1000 () const

## Static Public Member Functions
static void | adjustMemoryUseLimit (double scale=0.9)
| メモリとノード数の関係を調整. More...

## Private Types
typedef SearchTimerCommon::Mutex | Mutex

## Private Member Functions
void | testAndUpdateNextTimeTest (uint64_t node_count)
void | throwStop ()

## Private Attributes
boost::shared_ptr < SearchTimerCommon > | shared_timer

## Detailed Description

Definition at line 66 of file searchTimer.h.

## Member Typedef Documentation

typedef SearchTimerCommon::Mutex osl::search::SearchTimer::Mutex
| private

Definition at line 69 of file searchTimer.h.

## Constructor & Destructor Documentation

osl::search::SearchTimer::SearchTimer | ( | ) |  |
| inline

Definition at line 71 of file searchTimer.h.

osl::search::SearchTimer::SearchTimer | ( | const SearchTimer & | src) |  |
| inline

Definition at line 72 of file searchTimer.h.

osl::search::SearchTimer::~SearchTimer | ( | ) |  |
| virtual

Definition at line 8 of file searchTimer.cc.

## Member Function Documentation

void osl::search::SearchTimer::addMonitor | ( | const boost::shared_ptr< SearchMonitor > & | monitor) |  |

Definition at line 91 of file searchTimer.cc.

void osl::search::SearchTimer::adjustMemoryUseLimit | ( | double | scale = `0.9`) |  |
| static

メモリとノード数の関係を調整.

探索中は利用不可．

Definition at line 85 of file searchTimer.cc.

References maximum_node_count.

Referenced by osl::game_playing::SearchPlayer::adjust().

double osl::search::SearchTimer::elapsed | ( | MilliSeconds | now) |  | const
| inline

Definition at line 101 of file searchTimer.h.

References shared_timer.

double osl::search::SearchTimer::elapsed | ( | ) |  | const
| inline

Definition at line 105 of file searchTimer.h.

References elapsed().

Referenced by elapsed().

bool osl::search::SearchTimer::hasMonitor | ( | ) |  | const
| inline

Definition at line 157 of file searchTimer.h.

References shared_timer.

bool osl::search::SearchTimer::hasSchedule | ( | ) |  | const
| inline

Definition at line 88 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

Referenced by throwIfNoMoreTime().

bool osl::search::SearchTimer::isStableNow | ( | ) |  | const
| inline

Definition at line 87 of file searchTimer.h.

References shared_timer.

int osl::search::SearchTimer::lastMemoryUseRatio1000 | ( | ) |  | const
| inline

Definition at line 165 of file searchTimer.h.

References shared_timer.

const vector<boost::shared_ptr<SearchMonitor> >& osl::search::SearchTimer::monitors | ( | ) |  | const
| inline

Definition at line 161 of file searchTimer.h.

References shared_timer.

double osl::search::SearchTimer::nextIterationCoefficient | ( | ) |  | const
| inline

Definition at line 115 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

int osl::search::SearchTimer::nodeAffordable | ( | ) |  | const
| inline

Definition at line 143 of file searchTimer.h.

References osl::eval::max(), SCOPED_LOCK, and shared_timer.

void osl::search::SearchTimer::setNextIterationCoefficient | ( | double | new_value) |  |
| inline

Definition at line 107 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

void osl::search::SearchTimer::setNodeCountHardLimit | ( | uint64_t | new_value) |  |
| inline

Definition at line 111 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

void osl::search::SearchTimer::setStable | ( | bool | new_stable) |  |
| inline

Definition at line 86 of file searchTimer.h.

References shared_timer.

void osl::search::SearchTimer::setStartTime | ( | MilliSeconds | start) |  |
| inline

Definition at line 78 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

void osl::search::SearchTimer::setTimeAssign | ( | const TimeAssigned & | a) |  |
| inline

Definition at line 74 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

const MilliSeconds osl::search::SearchTimer::startTime | ( | ) |  | const
| inline

Definition at line 97 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

void osl::search::SearchTimer::stopNow | ( | ) |  |
| inline

Definition at line 121 of file searchTimer.h.

References shared_timer, and osl::search::SearchTimerCommon::StopByOutside.

bool osl::search::SearchTimer::stopping | ( | ) |  | const
| inline

Definition at line 120 of file searchTimer.h.

References shared_timer.

Referenced by osl::search::AlphaBeta2Tree< EvalT >::stopping().

SearchTimerCommon::StopReason osl::search::SearchTimer::stopReason | ( | ) |  |
| inline

Definition at line 126 of file searchTimer.h.

References shared_timer.

void osl::search::SearchTimer::testAndUpdateNextTimeTest | ( | uint64_t | node_count) |  |
| private

Definition at line 23 of file searchTimer.cc.

References osl::OslConfig::lock_io, osl::eval::max(), maximum_memory_use_ratio, maximum_node_count, osl::OslConfig::memoryUseRatio(), osl::eval::min(), osl::search::SearchTimerCommon::NoMoreMemory, osl::search::SearchTimerCommon::NoMoreTime, and SCOPED_LOCK.

Referenced by throwIfNoMoreTime().

void osl::search::SearchTimer::throwIfNoMoreTime | ( | uint64_t | node_count) |  |
| inline

Definition at line 127 of file searchTimer.h.

References hasSchedule(), osl::search::SearchTimerCommon::next_node_count, SCOPED_LOCK, shared_timer, osl::search::SearchTimerCommon::stop_all, and testAndUpdateNextTimeTest().

Referenced by osl::search::AlphaBeta2Tree< EvalT >::testStop().

void osl::search::SearchTimer::throwStop | ( | ) |  |
| private

Definition at line 12 of file searchTimer.cc.

References osl::search::SearchTimerCommon::NoMoreMemory.

const TimeAssigned& osl::search::SearchTimer::timeAssigned | ( | ) |  | const
| inline

Definition at line 92 of file searchTimer.h.

References SCOPED_LOCK, and shared_timer.

## Member Data Documentation

boost::shared_ptr<SearchTimerCommon> osl::search::SearchTimer::shared_timer
| private

Definition at line 68 of file searchTimer.h.

Referenced by elapsed(), hasMonitor(), hasSchedule(), isStableNow(), lastMemoryUseRatio1000(), monitors(), nextIterationCoefficient(), nodeAffordable(), setNextIterationCoefficient(), setNodeCountHardLimit(), setStable(), setStartTime(), setTimeAssign(), startTime(), stopNow(), stopping(), stopReason(), throwIfNoMoreTime(), and timeAssigned().

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

- searchTimer.h
- searchTimer.cc