From cb8dbf64e9b5b790aefe66592db29bc8342b55a1 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Fri, 2 Feb 2018 13:19:54 +0000 Subject: Rename SIMPLE_HASH flag to NO_CARD_SYMMETRY --- CMakeLists.txt | 8 ++++---- benchmark.py | 8 ++++---- src/main/game/global_cache.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ab8e4a..39097e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,10 +132,10 @@ endif() add_executable(solvitaire ${main} ${sources}) target_link_libraries(solvitaire LINK_PUBLIC ${Boost_LIBRARIES} -lprofiler) -# add a separete executable for the 'simple hash' version of the solver -add_executable(solvitaire-simple-hash ${main} ${sources}) -target_link_libraries(solvitaire-simple-hash LINK_PUBLIC ${Boost_LIBRARIES} -lprofiler) -set_target_properties(solvitaire-simple-hash PROPERTIES COMPILE_FLAGS -DSIMPLE_HASH) +# add a separete executable for the 'no card symmetry' version of the solver +add_executable(solvitaire-no-card-symmetry ${main} ${sources}) +target_link_libraries(solvitaire-no-card-symmetry LINK_PUBLIC ${Boost_LIBRARIES} -lprofiler) +set_target_properties(solvitaire-no-card-symmetry PROPERTIES COMPILE_FLAGS -DNO_CARD_SYMMETRY) # add a separete executable for the 'no reduced state' version of the solver add_executable(solvitaire-no-reduced-state ${main} ${sources}) diff --git a/benchmark.py b/benchmark.py index 943d3e7..3456b45 100644 --- a/benchmark.py +++ b/benchmark.py @@ -19,12 +19,12 @@ if (len(sys.argv) >= 2 flag = "" if (len(sys.argv) >= 2 - and (sys.argv[1] == "--simple-hash" or sys.argv[1] == "-sh")): - flag = "-simple-hash" - print("Running in simple-hash mode...") + and (sys.argv[1] == "--no-card-symmetry" or sys.argv[1] == "-ps")): + flag = "-no-card-symmetry" + print("Running in no-card-symmetry mode...") if (len(sys.argv) >= 2 - and (sys.argv[1] == "--no-reduced-state" or sys.argv[1] == "-nrc")): + and (sys.argv[1] == "--no-reduced-state" or sys.argv[1] == "-rc")): flag = "-no-reduced-state" print("Running in no-reduced-state mode...") diff --git a/src/main/game/global_cache.cpp b/src/main/game/global_cache.cpp index 37738f2..5d2fd79 100644 --- a/src/main/game/global_cache.cpp +++ b/src/main/game/global_cache.cpp @@ -84,7 +84,7 @@ void cached_game_state::add_card(card c, const game_state& gs) { #endif switch (gs.rules.build_pol) { -#ifdef SIMPLE_HASH +#ifdef NO_CARD_SYMMETRY default: target.emplace_back(c); break; @@ -152,7 +152,7 @@ std::size_t hasher::combine(std::size_t& seed, std::size_t value) const { size_t hasher::hash_value(card const& c) const { boost::hash boost_hasher; -#ifdef SIMPLE_HASH +#ifdef NO_CARD_SYMMETRY uint8_t suit_val = c.get_suit(); #else uint8_t suit_val; -- cgit v1.2.1