00001
00002
00003
00004
00005 #ifndef HYBRIDMULTICRITERIADIJKSTRA_H_
00006 #define HYBRIDMULTICRITERIADIJKSTRA_H_
00007
00008 #include <vector>
00009 #include "./TransitNetworkDependent.h"
00010 #include "./TransitNetworkExpanded.h"
00011 #include "./TransitPath.h"
00012 #include "./Label.h"
00013 #include "./LiveConnection.h"
00014 #include "HybridTransitRoadNetwork.h"
00015
00016 using std::vector;
00017
00018
00019
00020 class MultiCriteriaHybridDijkstra {
00021 public:
00022 MultiCriteriaHybridDijkstra(HybridTransitRoadNetwork* hybridNetwork);
00023 virtual ~MultiCriteriaHybridDijkstra();
00024
00025
00026 double computeShortestPath(string startStop, Time time,
00027 string endStop, bool buildPath);
00028
00029
00030
00031
00032
00033
00034 double computeShortestPath(int startId, NetworkType startNodeType,
00035 const Time& startTime,
00036 int endId, NetworkType endNodeType,
00037 bool reconstructPath);
00038 string createDijkstraStatisticsJSON();
00039 string createDijkstraLocationsJSON(const unordered_set<int>&
00040 affectedLabelIds) const;
00041
00042 string createDijkstraStepJSON(int stepNumber, int expandedLabelId,
00043 unordered_set<int>* labelIdsAffectedInThisStep);
00044 string createDijkstraStepsJSON(int startStep,int endStep);
00045
00046 void createAddedAndRemovedMaps();
00047 void printStatistic(int explored, int expanded, int pushed, int poped);
00048 vector<TransitPath> optimalPaths;
00049 string statistic;
00050 private:
00051 void reconstructShortestPath(const Time& startTime,
00052 NetworkType startType, size_t startId,
00053 NetworkType endType, size_t endId);
00054
00055
00056 void reconstructShortestPath( const Time& startTime, int startID);
00057
00058 HybridTransitRoadNetwork* hybridNetwork;
00059 vector <Label> labels;
00060 vector <LabelSet> transitLabelSets;
00061 vector <LabelSet> roadLabelSets;
00062 vector<NetworkType> labelTypes;
00063 LabelSet endParitySet;
00064 unordered_map<int, vector<int> > _labelIdToRemovedLabelIds;
00065 unordered_map<int, vector<int> > _labelIdToAddedLabelIds;
00066 };
00067
00068 #endif // HYBRIDMULTICRITERIADIJKSTRA_H */
00069