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

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)
 
- 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...
 
double diag_cost
 The cost of diagonal moves. More...
 

Detailed Description

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

Constructor & Destructor Documentation

MapOctileDistance::MapOctileDistance ( )

Constructor for a octile heuristic function. Assumes a goal of (0,0) and squarer root 2 diagonal cost.

MapOctileDistance::~MapOctileDistance ( )
virtual

Destructor for octile heuristic function. Does nothing.

Member Function Documentation

double MapOctileDistance::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 >.

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.

Parameters
d_costThe new diagonal move cost.
Returns
If the diagonal move cost was successfully set;
void MapOctileDistance::setGoal ( const MapLocation state)

Sets the goal location to the given map location.

Parameters
stateThe new goal.
void MapOctileDistance::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

double MapOctileDistance::diag_cost
protected

The cost of diagonal moves.

MapLocation MapOctileDistance::goal
protected

The goal location currently being used.


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