-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuzzle_solver.h
More file actions
37 lines (30 loc) · 821 Bytes
/
puzzle_solver.h
File metadata and controls
37 lines (30 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef PUZZLESOLVER_H
#define PUZZLESOLVER_H
#include <deque>
#include <set>
#include "board.h"
#include "puzzle_move.h"
#include "puzzle_heur.h"
class PuzzleSolver
{
public:
typedef std::set<PuzzleMove*, PuzzleMoveBoardComp> PuzzleMoveSet;
// Constructor (makes a copy of the Board and stores it in b_)
// Also takes a PuzzleHeuristic which will score boards
PuzzleSolver(const Board &b, PuzzleHeuristic* ph);
// Destructor
~PuzzleSolver();
// Run the A* search and builds the solution and tracks
// the number of expansions
void run();
// Return the solution deque
std::deque<int> getSolution();
// Return how many expansions were performed in the search
int getNumExpansions();
private:
Board _b;
std::deque<int> _solution;
int _expansions;
PuzzleHeuristic *_ph;
};
#endif