3 #include <boost/format.hpp>
12 for (
Move move: moves) {
17 return std::make_pair(
HashKey(state), path);
23 const std::pair<HashKey, PathEncoding> pair = getLastState(moves);
24 return regist(pair.first, pair.second);
33 std::vector<PathEncoding>& rs = keys[key];
42 if (std::find(rs.begin(), rs.end(), moves)
46 ++duplicated_hash_counter;
48 return HASH_DUPLICATE;
53 ++duplicated_moves_counter;
54 return MOVES_DUPLICATE;
62 out << boost::format(
"Trials %d, Unique %d, Duplicates Hash %d, Duplicated moves %d\n")
65 % duplicated_hash_counter
66 % duplicated_moves_counter;
bool isConsistent(bool showError=true) const
DUPLICATE_RESULT
Result type of checking duplicates.
static std::pair< HashKey, PathEncoding > getLastState(const std::vector< Move > &moves)
DUPLICATE_RESULT regist(const std::vector< Move > &moves)
Insert a key if the key is new.
void print(std::ostream &out) const
Output the result.