aboutsummaryrefslogtreecommitdiff
path: root/src/main/solver/solver.h
diff options
context:
space:
mode:
authorCharlie Blake2018-06-20 11:19:21 +0100
committerCharlie Blake2018-06-20 11:19:21 +0100
commit20236b6e7f16fc736fcf96f8f655bbcd09b59133 (patch)
tree1a5d46cff2582f0409bbadc6c286772a9511c164 /src/main/solver/solver.h
parentMerge pull request #63 from thecharlesblake/improve-mem-performance (diff)
downloadmetasol-20236b6e7f16fc736fcf96f8f655bbcd09b59133.tar.gz
metasol-20236b6e7f16fc736fcf96f8f655bbcd09b59133.zip

Change sol output to csv and refactor results dir

Diffstat (limited to 'src/main/solver/solver.h')
-rw-r--r--src/main/solver/solver.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/solver/solver.h b/src/main/solver/solver.h
index 14dedc5..3aa0d95 100644
--- a/src/main/solver/solver.h
+++ b/src/main/solver/solver.h
@@ -24,17 +24,30 @@ public:
boost::optional<lru_cache::item_list::iterator> cache_state; // Optional, as dominance moves aren't cached
};
+ struct solution_info {
+ int states_searched;
+ int unique_states_searched;
+ int backtracks;
+ int 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;
+ int max_depth;
+ int depth;
+ };
+ friend std::ostream& operator<< (std::ostream&, const solution_info&);
+
explicit solver(const game_state&, uint64_t);
sol_state run(boost::optional<std::atomic<bool> &> = boost::none);
void print_solution() const;
- void print_solution_info() const;
int get_states_searched() const;
int get_unique_states_searched() const;
int get_cache_size() const;
int get_states_rem_from_cache() const;
const std::vector<node> get_frontier() const;
+ solution_info get_solution_info();
private:
bool revert_to_last_node_with_children(boost::optional<lru_cache::item_list::iterator> = boost::none);