Container of moves to check duplicated games. More...
#include <checkDuplicate.h>
Public Types | |
enum | DUPLICATE_RESULT { NO_DUPLICATE = 0, HASH_DUPLICATE = 1, MOVES_DUPLICATE = 2 } |
Result type of checking duplicates. More... | |
Public Member Functions | |
CheckDuplicate () | |
Constructor. More... | |
DUPLICATE_RESULT | regist (const std::vector< Move > &moves) |
Insert a key if the key is new. More... | |
void | print (std::ostream &out) const |
Output the result. More... | |
size_t | getRegists () const |
Return a couter of registings (trials) More... | |
size_t | getDuplicatedHash () const |
Return a counter of duplicated ending states. More... | |
size_t | getDuplicatedMoves () const |
Return a counter of duplicated moves. More... | |
Static Public Member Functions | |
static std::pair< HashKey, PathEncoding > | getLastState (const std::vector< Move > &moves) |
Private Types | |
typedef std::unordered_map< HashKey, std::vector< PathEncoding >, std::hash< HashKey > > | keymap_t |
Private Member Functions | |
DUPLICATE_RESULT | regist (const HashKey &key, const PathEncoding &moves) |
Insert a key if the key is new. More... | |
Private Attributes | |
keymap_t | keys |
container of moves More... | |
size_t | regist_counter |
couter for registing (trials) More... | |
size_t | duplicated_hash_counter |
counter for hash matches with different moves More... | |
size_t | duplicated_moves_counter |
counter for exact matches of moves More... | |
Container of moves to check duplicated games.
Definition at line 19 of file checkDuplicate.h.
|
private |
Definition at line 21 of file checkDuplicate.h.
Result type of checking duplicates.
Enumerator | |
---|---|
NO_DUPLICATE | |
HASH_DUPLICATE | |
MOVES_DUPLICATE |
Definition at line 37 of file checkDuplicate.h.
|
inline |
|
inline |
Return a counter of duplicated ending states.
The moves may or may not match.
Definition at line 79 of file checkDuplicate.h.
References duplicated_hash_counter.
|
inline |
Return a counter of duplicated moves.
The moves are exactly same.
Definition at line 85 of file checkDuplicate.h.
References duplicated_moves_counter, and regist().
|
static |
Definition at line 7 of file checkDuplicate.cc.
References osl::BLACK, osl::NumEffectState::isConsistent(), osl::NumEffectState::makeMove(), osl::PathEncoding::pushMove(), and regist().
|
inline |
Return a couter of registings (trials)
Definition at line 72 of file checkDuplicate.h.
References regist_counter.
void osl::record::CheckDuplicate::print | ( | std::ostream & | out | ) | const |
Output the result.
Definition at line 60 of file checkDuplicate.cc.
Referenced by CheckDuplicate(), and regist().
osl::record::CheckDuplicate::DUPLICATE_RESULT osl::record::CheckDuplicate::regist | ( | const std::vector< Move > & | moves | ) |
Insert a key if the key is new.
The key is the last state of the moves.
moves |
Definition at line 21 of file checkDuplicate.cc.
Referenced by CheckDuplicate(), getDuplicatedMoves(), and getLastState().
|
private |
Insert a key if the key is new.
key | a hash key of the last state of the moves |
moves |
Definition at line 28 of file checkDuplicate.cc.
References print().
|
private |
counter for hash matches with different moves
Definition at line 27 of file checkDuplicate.h.
Referenced by getDuplicatedHash().
|
private |
counter for exact matches of moves
Definition at line 29 of file checkDuplicate.h.
Referenced by getDuplicatedMoves().
|
private |
container of moves
Definition at line 23 of file checkDuplicate.h.
|
private |
couter for registing (trials)
Definition at line 25 of file checkDuplicate.h.
Referenced by getRegists().