7 #ifndef SEARCH_GREEDYSOLVER_HPP 8 #define SEARCH_GREEDYSOLVER_HPP 10 #include <OrderedList.hpp> Implementation of the Manhattan distance for the 8-puzzle.
static int compare(GameState *a, GameState *b)
Compares two states using the available heuristic.
LinkedList< GameState * > solve(Game &game, GameState &g0)
Explores the game tree in search of the goal state.
virtual LinkedList< GameState * > solve(Game &g, GameState &gs)=0
Explores the game tree in search of the goal state.
GreedySolver(Heuristic *h)
Initializes the solver.
int calc(GameState ¤tState)
Calculates the heuristic value for a state.
Describes a single state in the 8-puzzle.
Abtract class for heuristic functions.