Assignment Search Framework
|
Public Member Functions | |
MapManhattanDistance () | |
virtual | ~MapManhattanDistance () |
void | setGoal (const MapLocation &state) |
void | setGoal (uint16_t x_loc, uint16_t y_loc) |
![]() | |
Heuristic () | |
virtual | ~Heuristic () |
virtual void | prepareToCompute () |
double | getHValue (const MapLocation &state) |
double | getLastHValue () const |
bool | isHValueStored () const |
Protected Member Functions | |
virtual double | computeHValue (const MapLocation &state) const |
Protected Attributes | |
MapLocation | goal |
The goal location currently being used. More... | |
A class that defines the Manhattan heuristic function for a map pathfinding domain.
MapManhattanDistance::MapManhattanDistance | ( | ) |
Constructor for a MapManhattanDistance heuristic function. By default, sets the goal at (0, 0)
|
virtual |
Destructor for a ManhattanDistance heuristic function. Does nothing.
|
protectedvirtual |
Calculates the heuristic value of the given state. Does not store the heuristic value.
If the heuristic value is negative, the heuristic function is indicating unsolvability.
This is the main function to be overloaded.
state | The state whose heuristic value is to be calculated. |
Implements Heuristic< MapLocation >.
void MapManhattanDistance::setGoal | ( | const MapLocation & | state | ) |
Sets the goal location to the given map location.
state | The new goal. |
void MapManhattanDistance::setGoal | ( | uint16_t | x_loc, |
uint16_t | y_loc | ||
) |
Sets the goal to use the given coordinates.
x_loc | The x location of the goal. |
y_loc | The y location of the goal. |
|
protected |
The goal location currently being used.