]> git.scottworley.com Git - slidingtile/blobdiff - sliding_tile_lib.h
Bound the frontier. I.e., do beam search.
[slidingtile] / sliding_tile_lib.h
index de2ca1f7fb077295cccb7ae41ee6a5527f4ba2ef..f0753fcbbfb643446c6e77c1cf26e9a2374ddeb8 100644 (file)
@@ -30,6 +30,7 @@ std::ostream& operator<<(std::ostream& os, const Board& board);
 
 struct Step {
   Step(Board board, std::shared_ptr<Step> prev);
+  ~Step();
 
   Board board;
   std::shared_ptr<Step> prev;
@@ -39,10 +40,11 @@ struct Step {
   int cost(const InvertedBoard& invgoal) const;
 
   static signed char adjacent[BOARD_SIZE][5];
+  static int count;
 };
 std::ostream& operator<<(std::ostream& os, const Step& step);
 
-std::shared_ptr<Step> find_path(const std::string& start, const std::string& goal);
-std::shared_ptr<Step> find_path(const Board& start, const Board& goal);
+std::shared_ptr<Step> find_path(const std::string& start, const std::string& goal, unsigned max_frontier);
+std::shared_ptr<Step> find_path(const Board& start, const Board& goal, unsigned max_frontier);
 
 #endif /* _SLIDING_TILE_LIB_H */