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

BQStructs.H

Go to the documentation of this file.
00001 
00010 /**************************************
00011  *File: BQStructs.H
00012  *Authors: dspinosa, relminya
00013  *Date:   3.15.2005
00014  *
00015  *Description: Basic structs that 
00016  * BikeQuest DB, AI, UI will use as 
00017  * data ferries.See structsexplained.JPG
00018  * for a picture of how this all works.
00019  **************************************/
00020 
00021 #ifndef BQStructs_h
00022 #define BQStructs_h
00023 
00024 #include <iostream>
00025 #include <string>
00026 #include <map>
00027 #include <limits.h>
00028 #include <vector>
00029 
00030 //include incase multimap approach to 
00031 //qualitative ratings is used.
00032 using namespace std;
00033 
00035 enum QualitativeRatings {POSHAZ, NEGHAZ, POSAMEN, NEGAMEN, POSSCEN, NEGSCEN, POSOTHER, NEGOTHER};
00036 
00038 typedef pair<int, string> entry;
00039 
00040 
00041 /**************************************
00042  * Struct: userPreferences
00043  * Author: dspinosa
00044  * Date: 3.24.05
00045  * typedef: userPrefs_t
00046  *
00047  * Description:  holds all user preferences that can be entered
00048  * at the GUI and used by searchParser and pathSearchAI
00049  *
00050  *  ** Will be set to DONT_CARE if the user doesnt care **
00051  *************************************/
00053 typedef struct userPreferences{
00054   double shoulderPref;
00055   double trafficPref;
00056   double conditionPref;
00057   double steepnessPref; 
00058 } userPrefs_t;
00059 
00060 #define DONT_CARE LONG_MAX
00061 
00063 typedef std::pair<double, double> segpt;
00064 
00066 typedef struct segComponents{
00067   std::vector<segpt*>* points;
00068   std::string roadname;
00069   int roadtype;
00070 } segComps_t;
00071 
00072 /**************************************
00073  *Struct: intersection
00074  *Author: relminya
00075  *Date:   3.15.2005
00076  *Typedef: isect_t
00077  *
00078  *Description: All points where >=2 roads meet
00079  * are defined to be intersections. Pointer
00080  * to nextIntersection is part of singly linked list
00081  * implementation that is used in describing a whole
00082  * path.
00083  *
00084  **************************************/
00086 typedef struct intersection isect_t;
00087 
00089 struct intersection{
00090   double x, y;
00091   isect_t* nextIntersection;
00092 };
00093 
00094 /**************************************
00095  *Struct: streetSeg
00096  *Author: relminya
00097  *Date:   3.15.2005
00098  *Typedef: seg_t
00099  *
00100  *Description: Basic building block of BQ. 
00101  * These are the road section descriptors
00102  * that are easily culled from GIS data.
00103  * Any modifications to this after 3.15.2005
00104  * will be *adds* ... data such as traffic
00105  * and elevation are possibilities for addition.
00106  * Struct will be finalized when tables are 
00107  * created in postgreSQL, as the mapdata table
00108  * and rankings tables will follow this struct
00109  * closely for columns.
00110  **************************************/
00111 
00113 typedef struct streetSeg{
00114   int routeid;
00115   string streetName;
00116   int streetType; //possibly could be enum as this is 9 types as defined by cnty-class
00117                      //in e00 file see http://www.edc.uri.edu/rigis-spf/Metadata/Transportation/s44trd98.html
00118   string town;
00119   string state;
00120   string startzipCode; //because of leading 0s we should make this a string
00121   string endzipCode;
00122   isect_t* start;
00123   isect_t* end;
00124   double streetAddressStart;
00125   double streetAddressEnd;
00126   bool bikeable;
00127   double length;
00128   //Quantitative Rankings
00129   double shoulderRating;//feedback averages
00130   double trafficRating;
00131   double conditionRating;
00132   double steepnessRating;
00133   int shoulderTotal;//quantity of feedback
00134   int trafficTotal;
00135   int conditionTotal;
00136   int steepnessTotal;
00137   //Qualitative Rankings
00138   multimap<int, string>* qualitativeRankings;
00139 }seg_t;
00140 
00141 /**************************************
00142  *Struct:  pathDesc
00143  *Author:  relminya
00144  *Date:    3.15.2005
00145  *Typedef: path_t
00146  *
00147  *Description: Singly Linked List implementation
00148  * that describes a path, will mainly be used
00149  * by AI. Nodes are streetsegs, links are isects.
00150  ****************************************/
00151 
00153 typedef struct pathDesc{
00154   seg_t* begin;
00155   seg_t* end;
00156   isect_t* nextIntersection;
00157 }path_t;
00158 
00159 
00160 #endif

Generated on Mon May 16 11:08:35 2005 for BikeQuest by  doxygen 1.4.0