Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

PathSearchAI Class Reference

#include <PathSearchAI.H>

Collaboration diagram for PathSearchAI:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class provides the functionality necessary to find an optimal path from A to B. The types of data being passed around are basically set: streetSeg and userPrefs are structs that will be defined elsewhere in our project.


Public Member Functions

 PathSearchAI (DBInterface *db)
 Default Constructor.
 ~PathSearchAI ()
 Default Destructor.
path_tfindAtoBPath (seg_t *, seg_t *, userPrefs_t)
 Method will return a path from seg_t to seg_t given user preferences (and unique seg_t's).
path_tfindAtoAPath (seg_t *, double, userPrefs_t)
 Method will return a path from seg_t to itself in a loop route of the given distance.

Private Member Functions

double heuristic (seg_t *, seg_t *, seg_t *, userPrefs_t)
 This function will set and return the heuristic value for a street segment. It relies on user preferences that are passed in, and street data from the database. The values returned will determine which neighbor is the best.
double heuristicAtoA (seg_t *, seg_t *, double, double, userPrefs_t)
 Same as heuristic as heuristic(...), but modified to create a loop route.
void insertInOpenList (vector< AIseg_t > &list, seg_t *goal, AIseg_t curr, double heurVal, userPrefs_t prefs)
 Uses an iterator to insert an element into the open list.
bool inList (vector< AIseg_t > list, AIseg_t segment)
 Returns a boolean saying if the element was in the given list.
AIseg_t findParent (vector< AIseg_t > list, seg_t *child)
 Searches the given list for the parent of the given child.

Private Attributes

DBInterfacem_db
 Pointer to the database.


Constructor & Destructor Documentation

PathSearchAI::PathSearchAI DBInterface db  ) 
 

Default Constructor.

PathSearchAI::~PathSearchAI  ) 
 

Default Destructor.


Member Function Documentation

path_t * PathSearchAI::findAtoAPath seg_t ,
double  ,
userPrefs_t 
 

Method will return a path from seg_t to itself in a loop route of the given distance.

Here is the call graph for this function:

path_t * PathSearchAI::findAtoBPath seg_t ,
seg_t ,
userPrefs_t 
 

Method will return a path from seg_t to seg_t given user preferences (and unique seg_t's).

AIseg_t PathSearchAI::findParent vector< AIseg_t list,
seg_t child
[private]
 

Searches the given list for the parent of the given child.

double PathSearchAI::heuristic seg_t ,
seg_t ,
seg_t ,
userPrefs_t 
[private]
 

This function will set and return the heuristic value for a street segment. It relies on user preferences that are passed in, and street data from the database. The values returned will determine which neighbor is the best.

double PathSearchAI::heuristicAtoA seg_t ,
seg_t ,
double  ,
double  ,
userPrefs_t 
[private]
 

Same as heuristic as heuristic(...), but modified to create a loop route.

bool PathSearchAI::inList vector< AIseg_t list,
AIseg_t  segment
[private]
 

Returns a boolean saying if the element was in the given list.

void PathSearchAI::insertInOpenList vector< AIseg_t > &  list,
seg_t goal,
AIseg_t  curr,
double  heurVal,
userPrefs_t  prefs
[private]
 

Uses an iterator to insert an element into the open list.


Member Data Documentation

DBInterface* PathSearchAI::m_db [private]
 

Pointer to the database.


The documentation for this class was generated from the following files:
Generated on Mon May 16 11:08:54 2005 for BikeQuest by  doxygen 1.4.0