Assignment Search Framework
|
Public Member Functions | |
MapOctileDistance () | |
virtual | ~MapOctileDistance () |
void | setGoal (const MapLocation &state) |
void | setGoal (uint16_t x_loc, uint16_t y_loc) |
bool | setDiagonalCost (double d_cost) |
![]() | |
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... | |
double | diag_cost |
The cost of diagonal moves. More... | |
A class that defines the octile heuristic function for a map pathfinding domain.
MapOctileDistance::MapOctileDistance | ( | ) |
Constructor for a octile heuristic function. Assumes a goal of (0,0) and squarer root 2 diagonal cost.
|
virtual |
Destructor for octile 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 >.
bool MapOctileDistance::setDiagonalCost | ( | double | d_cost | ) |
Sets the cost of a diagonal move.
Value must be larger than 0.0. False is returned if it is not.
d_cost | The new diagonal move cost. |
void MapOctileDistance::setGoal | ( | const MapLocation & | state | ) |
Sets the goal location to the given map location.
state | The new goal. |
void MapOctileDistance::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 cost of diagonal moves.
|
protected |
The goal location currently being used.