千日手の検出. [詳細]
#include <repetitionCounter.h>
構成 | |
struct | Table |
Public 型 | |
typedef std::list< int > | list_t |
Public メソッド | |
RepetitionCounter () | |
RepetitionCounter (const RepetitionCounter &c) | |
RepetitionCounter (const NumEffectState &initial) | |
~RepetitionCounter () | |
void | push (const NumEffectState &state, Move move) |
state の状態で move を(これから)指すことを記録 | |
void | push (const NumEffectState &state) |
指した後の局面を記録 | |
void | push (const HashKey &key, const NumEffectState &state) |
指した後の局面を記録 | |
void | pop () |
void | clear () |
const Sennichite | isSennichite (const NumEffectState &state, Move move) const |
const Sennichite | isAlmostSennichite (const HashKey &key) const |
このまま同形を繰り返したらどの結果になるかを返す | |
const std::pair< Sennichite, int > | distanceToSennichite (const HashKey &key) const |
unsigned int | countRepetition (const HashKey &) const |
const list_t | getRepetitions (const HashKey &) const |
void | printMatches (const HashKey &key) const |
int | getLastMove (const HashKey &key) const |
key の手を最後に登録した指手番号. | |
int | getFirstMove (const HashKey &key) const |
key の手を最初に登録した指手番号. | |
int | checkCount (Player attack) const |
const HashKeyStack & | history () const |
bool | isConsistent () const |
Static Public メソッド | |
static bool | maybeEqual (const RepetitionCounter &l, const RepetitionCounter &r) |
Private メソッド | |
int | order () const |
void | push (const HashKey &new_key, bool is_check) |
const Sennichite | isAlmostSennichiteUnsafe (int first_move) const |
Private 変数 | |
std::unique_ptr< Table > | table |
CArray< std::vector< int >, 2 > | continuous_check |
HashKeyStack | hash_history |
千日手の検出.
連続王手の千日手(同一局面の最初と4回目の間の一方の指し手が王手のみだった場合)は、連続王手をかけていたほうが負け。 http://www.computer-shogi.org/wcsc14/youryou.html
repetitionCounter.h の 20 行で定義されています。
typedef std::list<int> osl::RepetitionCounter::list_t |
repetitionCounter.h の 28 行で定義されています。
osl::RepetitionCounter::RepetitionCounter | ( | ) |
repetitionCounter.cc の 35 行で定義されています。
参照先 clear().
osl::RepetitionCounter::RepetitionCounter | ( | const RepetitionCounter & | c | ) |
repetitionCounter.cc の 41 行で定義されています。
参照先 isConsistent(), と table.
osl::RepetitionCounter::RepetitionCounter | ( | const NumEffectState & | initial | ) | [explicit] |
repetitionCounter.cc の 52 行で定義されています。
osl::RepetitionCounter::~RepetitionCounter | ( | ) |
repetitionCounter.cc の 61 行で定義されています。
int osl::RepetitionCounter::checkCount | ( | Player | attack | ) | const [inline] |
repetitionCounter.h の 91 行で定義されています。
void osl::RepetitionCounter::clear | ( | ) |
repetitionCounter.cc の 20 行で定義されています。
参照先 continuous_check, hash_history, initial_capacity, と table.
参照元 RepetitionCounter().
unsigned int osl::RepetitionCounter::countRepetition | ( | const HashKey & | key | ) | const |
repetitionCounter.cc の 191 行で定義されています。
参照先 table.
const std::pair< osl::Sennichite, int > osl::RepetitionCounter::distanceToSennichite | ( | const HashKey & | key | ) | const |
repetitionCounter.cc の 182 行で定義されています。
参照先 isAlmostSennichite(), osl::Sennichite::NORMAL(), と table.
int osl::RepetitionCounter::getFirstMove | ( | const HashKey & | key | ) | const |
key の手を最初に登録した指手番号.
repetitionCounter.cc の 153 行で定義されています。
参照先 table.
参照元 isAlmostSennichite().
int osl::RepetitionCounter::getLastMove | ( | const HashKey & | key | ) | const |
const list_t osl::RepetitionCounter::getRepetitions | ( | const HashKey & | key | ) | const |
repetitionCounter.cc の 200 行で定義されています。
参照先 table.
const HashKeyStack& osl::RepetitionCounter::history | ( | ) | const [inline] |
repetitionCounter.h の 95 行で定義されています。
参照先 hash_history.
参照元 isConsistent(), と osl::checkmate::DualDfpn::writeRootHistory().
const Sennichite osl::RepetitionCounter::isAlmostSennichite | ( | const HashKey & | key | ) | const [inline] |
このまま同形を繰り返したらどの結果になるかを返す
repetitionCounter.h の 69 行で定義されています。
参照先 getFirstMove(), isAlmostSennichiteUnsafe(), と osl::Sennichite::NORMAL().
参照元 distanceToSennichite(), と isSennichite().
const Sennichite osl::RepetitionCounter::isAlmostSennichiteUnsafe | ( | int | first_move | ) | const [inline, private] |
bool osl::RepetitionCounter::isConsistent | ( | ) | const |
repetitionCounter.cc の 222 行で定義されています。
参照先 osl::alt(), continuous_check, hash_history, history(), order(), と table.
参照元 RepetitionCounter().
const osl::Sennichite osl::RepetitionCounter::isSennichite | ( | const NumEffectState & | state, | |
Move | move | |||
) | const |
repetitionCounter.cc の 167 行で定義されています。
参照先 isAlmostSennichite(), osl::Sennichite::NORMAL(), と table.
bool osl::RepetitionCounter::maybeEqual | ( | const RepetitionCounter & | l, | |
const RepetitionCounter & | r | |||
) | [static] |
repetitionCounter.cc の 256 行で定義されています。
参照先 continuous_check, hash_history, と table.
int osl::RepetitionCounter::order | ( | ) | const [inline, private] |
repetitionCounter.h の 26 行で定義されています。
参照先 hash_history.
参照元 isAlmostSennichiteUnsafe(), isConsistent(), pop(), と push().
void osl::RepetitionCounter::pop | ( | ) |
repetitionCounter.cc の 120 行で定義されています。
参照先 osl::alt(), continuous_check, hash_history, order(), と table.
void osl::RepetitionCounter::printMatches | ( | const HashKey & | key | ) | const |
repetitionCounter.cc の 210 行で定義されています。
参照先 table.
void osl::RepetitionCounter::push | ( | const NumEffectState & | state | ) |
void osl::RepetitionCounter::push | ( | const NumEffectState & | state, | |
Move | move | |||
) |
state の状態で move を(これから)指すことを記録
repetitionCounter.cc の 105 行で定義されています。
参照先 osl::NumEffectState::isCheck(), osl::Move::isPass(), osl::Move::isValidOrPass(), osl::Move::player(), push(), と osl::SimpleState::turn().
void osl::RepetitionCounter::push | ( | const HashKey & | key, | |
const NumEffectState & | state | |||
) |
void osl::RepetitionCounter::push | ( | const HashKey & | new_key, | |
bool | is_check | |||
) | [private] |
repetitionCounter.cc の 66 行で定義されています。
参照先 osl::alt(), checkCount(), continuous_check, hash_history, order(), と table.
参照元 push(), と RepetitionCounter().
CArray<std::vector<int>, 2> osl::RepetitionCounter::continuous_check [private] |
repetitionCounter.h の 24 行で定義されています。
参照元 checkCount(), clear(), isAlmostSennichiteUnsafe(), isConsistent(), maybeEqual(), pop(), と push().
HashKeyStack osl::RepetitionCounter::hash_history [private] |
repetitionCounter.h の 25 行で定義されています。
参照元 clear(), history(), isConsistent(), maybeEqual(), order(), pop(), と push().
std::unique_ptr<Table> osl::RepetitionCounter::table [private] |