Assignment Search Framework
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
MapManhattanDistance Class Reference
Inheritance diagram for MapManhattanDistance:

Public Member Functions

 MapManhattanDistance ()
 
virtual ~MapManhattanDistance ()
 
void setGoal (const MapLocation &state)
 
void setGoal (uint16_t x_loc, uint16_t y_loc)
 
- Public Member Functions inherited from Heuristic< MapLocation >
 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...
 

Detailed Description

A class that defines the Manhattan heuristic function for a map pathfinding domain.

Constructor & Destructor Documentation

MapManhattanDistance::MapManhattanDistance ( )

Constructor for a MapManhattanDistance heuristic function. By default, sets the goal at (0, 0)

MapManhattanDistance::~MapManhattanDistance ( )
virtual

Destructor for a ManhattanDistance heuristic function. Does nothing.

Member Function Documentation

double MapManhattanDistance::computeHValue ( const MapLocation state) const
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.

Parameters
stateThe state whose heuristic value is to be calculated.
Returns
The heuristic value of the given state.

Implements Heuristic< MapLocation >.

void MapManhattanDistance::setGoal ( const MapLocation state)

Sets the goal location to the given map location.

Parameters
stateThe new goal.
void MapManhattanDistance::setGoal ( uint16_t  x_loc,
uint16_t  y_loc 
)

Sets the goal to use the given coordinates.

Parameters
x_locThe x location of the goal.
y_locThe y location of the goal.

Member Data Documentation

MapLocation MapManhattanDistance::goal
protected

The goal location currently being used.


The documentation for this class was generated from the following files: