From dec5d20add75c12a95aa4e2910b1f59f8cdf9a7c Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Thu, 7 Jun 2018 15:47:10 +0100 Subject: Remove depth cutoff from solver class --- src/main/solver/solver.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/main/solver/solver.h') diff --git a/src/main/solver/solver.h b/src/main/solver/solver.h index 5eda894..665d72a 100644 --- a/src/main/solver/solver.h +++ b/src/main/solver/solver.h @@ -28,8 +28,6 @@ public: ~solver(); sol_state run(boost::optional &> = boost::none); - sol_state run_with_cutoff(boost::optional &>, - boost::optional = boost::none); void print_solution() const; int get_states_searched() const; -- cgit v1.2.1 From ca5e97bfeec3b03562b4c4a312b6a83c51b013fc Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Thu, 7 Jun 2018 16:31:14 +0100 Subject: Add more detailed logging info about search sols --- src/main/solver/solver.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/solver/solver.h') diff --git a/src/main/solver/solver.h b/src/main/solver/solver.h index 665d72a..77e8bde 100644 --- a/src/main/solver/solver.h +++ b/src/main/solver/solver.h @@ -14,7 +14,7 @@ class solver { public: - enum class sol_state {solved, unsolvable, cutoff}; + enum class sol_state {solved, unsolvable, timed_out}; global_cache cache; struct node { @@ -30,10 +30,9 @@ public: sol_state run(boost::optional &> = boost::none); void print_solution() const; + void print_solution_info() const; int get_states_searched() const; - int get_final_depth() const; const node& get_search_tree() const; - int get_backtrack_count(); private: bool revert_to_last_node_with_children(); @@ -43,9 +42,12 @@ private: const game_state init_state; game_state state; + int states_searched; + int unique_states_searched; int backtracks; - uint depth; + int dominance_moves; + int depth; node root; node* current_node; -- cgit v1.2.1 From 819a1064c5142a9b2f04ff8149d34fc915c18322 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Fri, 8 Jun 2018 10:31:22 +0100 Subject: Refactor legal moves gen and moves logic --- src/main/solver/solver.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/solver/solver.h') diff --git a/src/main/solver/solver.h b/src/main/solver/solver.h index 77e8bde..21b8d6e 100644 --- a/src/main/solver/solver.h +++ b/src/main/solver/solver.h @@ -18,9 +18,9 @@ public: global_cache cache; struct node { - node(node*, game_state::move); + node(node*, move); node* parent; - const game_state::move move; + const move mv; std::vector children; }; @@ -36,9 +36,9 @@ public: private: bool revert_to_last_node_with_children(); - void add_children(std::vector&); - void add_child(game_state::move); - std::vector get_next_moves(); + void add_children(std::vector&); + void add_child(move); + std::vector get_next_moves(); const game_state init_state; game_state state; -- cgit v1.2.1