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

SimpleHashTable の中に記録するエントリ More...

#include <simpleHashRecord.h>

Collaboration diagram for osl::search::SimpleHashRecord:
Collaboration graph
[legend]

Public Member Functions

 SimpleHashRecord ()
 
void addNodeCount (size_t diff)
 
void setAbsoluteValue (Move best_move, int value, int limit)
 値を書き込む. More...
 
void setBestMove (Move m, int logprob=100)
 
void setAbsoluteValue (MoveLogProb best_move, int value, int limit)
 
void setLowerBound (Player P, int limit, const MoveLogProb &best_move, int value)
 lowerBound の設定. More...
 
void setUpperBound (Player P, int limit, const MoveLogProb &best_move, int value)
 upperBound の設定. More...
 
int upperLimit () const
 upperBound を記録したときのlimit More...
 
int upperBound () const
 手番のプレイヤからみた評価値の上限 More...
 
int lowerLimit () const
 lowerBound を記録したときのlimit More...
 
int lowerBound () const
 手番のプレイヤからみた評価値の下限 More...
 
int checkmateNodes () const
 今までに詰将棋で探したノード数 More...
 
int threatmateNodes () const
 
const MoveLogProb bestMove () const
 
bool hasUpperBound (int limit) const
 
bool hasLowerBound (int limit) const
 
bool hasAbsoluteUpperBound (Player p, int limit) const
 
bool hasAbsoluteLowerBound (Player p, int limit) const
 
int absoluteUpperBound (Player p) const
 
int absoluteLowerBound (Player p) const
 
void resetValue ()
 
template<Player P>
bool hasGreaterLowerBound (int limit, int threshold, int &val) const
 high fail するか More...
 
template<Player P>
bool hasLesserUpperBound (int limit, int threshold, int &val) const
 low fail するか More...
 
const DualThreatmateStatethreatmate () const
 
DualThreatmateStatethreatmate ()
 
void dump (std::ostream &) const
 
size_t nodeCount () const
 
bool inCheck () const
 
void setInCheck (bool new_value)
 

Public Attributes

QuiescenceRecord qrecord
 静止探索用 More...
 

Private Member Functions

template<bool PreferLowerBound>
void makeConsistent (Player P)
 上限と下限に矛盾があったら調整する. More...
 

Private Attributes

MoveLogProb best_move
 
int upper_bound
 
int lower_bound
 
signed short upper_limit
 
signed short lower_limit
 
unsigned int search_nodes
 CAVEAT: 32bit では 100万局面/秒で1時間ちょっと考えると溢れる More...
 

Detailed Description

SimpleHashTable の中に記録するエントリ

Definition at line 22 of file simpleHashRecord.h.

Constructor & Destructor Documentation

osl::search::SimpleHashRecord::SimpleHashRecord ( )
inline

Definition at line 36 of file simpleHashRecord.h.

Member Function Documentation

int osl::search::SimpleHashRecord::absoluteLowerBound ( Player  p) const
inline

Definition at line 196 of file simpleHashRecord.h.

References osl::BLACK, lowerBound(), and upperBound().

int osl::search::SimpleHashRecord::absoluteUpperBound ( Player  p) const
inline

Definition at line 192 of file simpleHashRecord.h.

References osl::BLACK, lowerBound(), and upperBound().

void osl::search::SimpleHashRecord::addNodeCount ( size_t  diff)
inline
const MoveLogProb osl::search::SimpleHashRecord::bestMove ( ) const
inline
int osl::search::SimpleHashRecord::checkmateNodes ( ) const
inline

今までに詰将棋で探したノード数

Definition at line 167 of file simpleHashRecord.h.

References osl::search::QuiescenceRecordBase::checkmate_nodes, and qrecord.

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

void osl::search::SimpleHashRecord::dump ( std::ostream &  os) const

Definition at line 11 of file simpleHashRecord.cc.

References osl::record::csa::show().

Referenced by osl::search::SearchState2Core::abort().

bool osl::search::SimpleHashRecord::hasAbsoluteLowerBound ( Player  p,
int  limit 
) const
inline

Definition at line 188 of file simpleHashRecord.h.

References osl::BLACK, hasLowerBound(), and hasUpperBound().

bool osl::search::SimpleHashRecord::hasAbsoluteUpperBound ( Player  p,
int  limit 
) const
inline

Definition at line 184 of file simpleHashRecord.h.

References osl::BLACK, hasLowerBound(), and hasUpperBound().

template<Player P>
bool osl::search::SimpleHashRecord::hasGreaterLowerBound ( int  limit,
int  threshold,
int &  val 
) const
inline
template<Player P>
bool osl::search::SimpleHashRecord::hasLesserUpperBound ( int  limit,
int  threshold,
int &  val 
) const
inline
bool osl::search::SimpleHashRecord::hasLowerBound ( int  limit) const
inline
bool osl::search::SimpleHashRecord::hasUpperBound ( int  limit) const
inline
bool osl::search::SimpleHashRecord::inCheck ( ) const
inline
int osl::search::SimpleHashRecord::lowerBound ( ) const
inline
int osl::search::SimpleHashRecord::lowerLimit ( ) const
inline
template<bool PreferLowerBound>
void osl::search::SimpleHashRecord::makeConsistent ( Player  P)
inlineprivate

上限と下限に矛盾があったら調整する.

同じ深さだったら後から来た方を優先しないと,再々探索の結果を記録できない

Parameters
PreferLowerBound同じ深さだったら lower bound を優先する

Definition at line 140 of file simpleHashRecord.h.

References osl::eval::betterThan(), hasLowerBound(), hasUpperBound(), lower_bound, lower_limit, upper_bound, and upper_limit.

size_t osl::search::SimpleHashRecord::nodeCount ( ) const
inline
void osl::search::SimpleHashRecord::resetValue ( )
inline
void osl::search::SimpleHashRecord::setAbsoluteValue ( Move  best_move,
int  value,
int  limit 
)
inline
void osl::search::SimpleHashRecord::setAbsoluteValue ( MoveLogProb  best_move,
int  value,
int  limit 
)
inline
void osl::search::SimpleHashRecord::setBestMove ( Move  m,
int  logprob = 100 
)
inline
void osl::search::SimpleHashRecord::setInCheck ( bool  new_value)
inline
void osl::search::SimpleHashRecord::setLowerBound ( Player  P,
int  limit,
const MoveLogProb best_move,
int  value 
)
inline

lowerBound の設定.

  • 深さ優先
  • 同じ深さなら良い値優先

Definition at line 89 of file simpleHashRecord.h.

References hasUpperBound(), limit, lower_bound, lower_limit, qrecord, SCOPED_LOCK_CHAR, and osl::MoveLogProb::validMove().

Referenced by osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot(), and osl::search::AlphaBeta3::searchRoot().

void osl::search::SimpleHashRecord::setUpperBound ( Player  P,
int  limit,
const MoveLogProb best_move,
int  value 
)
inline

upperBound の設定.

  • 深さ優先
  • 同じ深さなら悪い値優先

Definition at line 112 of file simpleHashRecord.h.

References best_move, hasLowerBound(), limit, qrecord, SCOPED_LOCK_CHAR, upper_bound, upper_limit, and osl::MoveLogProb::validMove().

const DualThreatmateState& osl::search::SimpleHashRecord::threatmate ( ) const
inline
DualThreatmateState& osl::search::SimpleHashRecord::threatmate ( )
inline

Definition at line 236 of file simpleHashRecord.h.

References qrecord, and osl::search::QuiescenceRecordBase::threatmate.

int osl::search::SimpleHashRecord::threatmateNodes ( ) const
inline
int osl::search::SimpleHashRecord::upperBound ( ) const
inline
int osl::search::SimpleHashRecord::upperLimit ( ) const
inline

upperBound を記録したときのlimit

Definition at line 159 of file simpleHashRecord.h.

References upper_limit.

Referenced by hasLesserUpperBound(), hasUpperBound(), and osl::search::analyzer::DotWriter::showNode().

Member Data Documentation

MoveLogProb osl::search::SimpleHashRecord::best_move
private

Definition at line 28 of file simpleHashRecord.h.

Referenced by bestMove(), setAbsoluteValue(), setBestMove(), and setUpperBound().

int osl::search::SimpleHashRecord::lower_bound
private

Definition at line 30 of file simpleHashRecord.h.

Referenced by lowerBound(), makeConsistent(), setAbsoluteValue(), and setLowerBound().

signed short osl::search::SimpleHashRecord::lower_limit
private
QuiescenceRecord osl::search::SimpleHashRecord::qrecord
unsigned int osl::search::SimpleHashRecord::search_nodes
private

CAVEAT: 32bit では 100万局面/秒で1時間ちょっと考えると溢れる

Definition at line 34 of file simpleHashRecord.h.

Referenced by addNodeCount(), and nodeCount().

int osl::search::SimpleHashRecord::upper_bound
private

Definition at line 29 of file simpleHashRecord.h.

Referenced by makeConsistent(), setAbsoluteValue(), setUpperBound(), and upperBound().

signed short osl::search::SimpleHashRecord::upper_limit
private

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