7 #ifndef SEARCH_SOLVER_HPP 8 #define SEARCH_SOLVER_HPP 11 #include <LinkedList.hpp> 12 #include <OrderedList.hpp> 40 return visited.contains(&g);
62 for (
int i = 0;
i < 4;
i ++) {
103 while (
tmp != NULL) {
151 "\t\t\t\tSeconds: ").append(std::to_string(getSecondsToSolve())).append(
152 "\n\t\t Solution depth: ").append(
153 std::to_string(getSolutionDepth())).append(
"\n\t Max depth explored: ").
155 std::to_string(getMaxDepth())).append(
"\nNumber of visited nodes: ").append(
156 std::to_string(getVisitedNodes())).append(
"\n");
bool operator<(const GameState &other) const
Compares two GameState objects.
static int compare(GameState *a, GameState *b)
bool isVisited(GameState &g)
Checks whether a node has already been visited by the solver.
virtual LinkedList< GameState * > solve(Game &g, GameState &gs)=0
Explores the game tree in search of the goal state.
string to_string()
Generates a string containing useful information from the solver run.
Describes a single state in the 8-puzzle.