From 7b4f42242d277adeaec7a40eaac7d178141d4621 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Tue, 29 Jan 2019 19:12:22 +0000 Subject: Reorganise submodules (and submodulise solvitaire) The submodules should now point to repos I've made in order to produce static libraries from them. Also, solvitaire now points to a similar personal repo. --- solvitaire | 1 + solvitaire/src/main/solver/solver.h | 78 ------------------------------------- 2 files changed, 1 insertion(+), 78 deletions(-) create mode 160000 solvitaire delete mode 100644 solvitaire/src/main/solver/solver.h (limited to 'solvitaire/src/main/solver/solver.h') diff --git a/solvitaire b/solvitaire new file mode 160000 index 0000000..b835e10 --- /dev/null +++ b/solvitaire @@ -0,0 +1 @@ +Subproject commit b835e10bfb21a73b4f89e09ddeb400f415384835 diff --git a/solvitaire/src/main/solver/solver.h b/solvitaire/src/main/solver/solver.h deleted file mode 100644 index 74c73a8..0000000 --- a/solvitaire/src/main/solver/solver.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// Created by thecharlesblake on 10/24/17. -// - -#ifndef SOLVITAIRE_SOLVER_H -#define SOLVITAIRE_SOLVER_H - -#include -#include -#include -#include - -#include "../game/global_cache.h" -#include "../game/sol_rules.h" -#include "../input-output/input/command_line_helper.h" - -class solver { -public: - lru_cache cache; - - struct node { - node(move); - const move mv; - std::vector child_moves; - boost::optional cache_state; // Optional, as dominance moves aren't cached - }; - - struct result { - enum class type { TIMEOUT, SOLVED, UNSOLVABLE, MEM_LIMIT, TERMINATED }; - - type sol_type; - uint64_t states_searched; - uint64_t unique_states_searched; - uint64_t backtracks; - uint64_t dominance_moves; - uint64_t states_removed_from_cache; - lru_cache::item_list::size_type cache_size; - lru_cache::item_list::size_type cache_bucket_count; - uint64_t max_depth; - uint64_t depth; - std::chrono::milliseconds time; - }; - - explicit solver(const game_state&, uint64_t); - - result run(boost::optional = boost::none); - - void print_solution() const; - static void print_header(long, command_line_helper::streamliner_opt); - static void print_result_csv(solver::result); - static void print_null_seed_info(); - const std::vector get_frontier() const; - - const game_state init_state; - -private: - typedef std::chrono::high_resolution_clock clock; - typedef std::chrono::milliseconds millisec; - - result::type dfs(boost::optional = boost::none); - - bool revert_to_last_node_with_children(boost::optional = boost::none); - void set_to_child(); - - game_state state; - std::vector frontier; - - result res; - - node root; - std::vector::iterator current_node; -}; - -std::ostream& operator<< (std::ostream&, const solver::result::type&); -std::ostream& operator<< (std::ostream&, const solver::result&); -void sigint_handler(int i); - -#endif //SOLVITAIRE_SOLVER_H -- cgit v1.2.1