7 #ifndef SEARCH_HILLCLIMBINGSOLVER_HPP 8 #define SEARCH_HILLCLIMBINGSOLVER_HPP 10 #include <OrderedList.hpp> 86 cout <<
"WARNING: hill climbing procedure reached a local minimum\n";
HillClimbingSolver(Heuristic *h)
Initializes a regular hill-climbing 8-puzzle solver.
HillClimbingSolver(Heuristic *h, bool steepest)
Initializes a hill-climbing 8-puzzle solver.
Implementation of the Manhattan distance for the 8-puzzle.
virtual LinkedList< GameState * > solve(Game &g, GameState &gs)=0
Explores the game tree in search of the goal state.
static int compare(GameState *a, GameState *b)
Compares two states using the available heuristic.
int calc(GameState ¤tState)
Calculates the heuristic value for a state.
LinkedList< GameState * > solve(Game &game, GameState &g0)
Explores the game tree in search of the goal state.
Describes a single state in the 8-puzzle.
Abtract class for heuristic functions.