00001
00002
00003
00004
00005 #ifndef HYBRIDTRANSITROADNETWORK_H_
00006 #define HYBRIDTRANSITROADNETWORK_H_
00007
00008 #include "RoadNetwork.h"
00009 #include "./TransitNetworkDependent.h"
00010 #include "./TransitNetworkExpanded.h"
00011 #include "./Time.h"
00012 #include "./LiveConnection.h"
00013 #include "ExpandedDijkstra.h"
00014
00015
00016 using std::vector;
00017
00018
00019 class HybridTransitRoadNetwork {
00020 public:
00021 HybridTransitRoadNetwork(RoadNetwork* roadNetwork,
00022 TransitNetworkDependent* transitNetworkDependent,
00023 TransitNetworkExpanded* transitNetworkExpanded);
00024 virtual ~HybridTransitRoadNetwork();
00025 void getStopsStartingWith(const string& prefix,
00026 vector<string>* stopNames);
00027 void getStartConnections(int startId, NetworkType startNodeType,
00028 const Time& startTime,
00029 vector<LiveConnection>* startConnections);
00030 void addNaighbourConnections(int nodeId, NetworkType type,
00031 int endId,
00032 NetworkType endType,
00033 bool startStation,
00034 Time arrivalTime,
00035 vector<LiveConnection>* outConnections);
00036 int getStopIdByTheStopName(string stopName);
00037 bool isExpanded();
00038 int getNumNodes(NetworkType type);
00039 int getNumStops(NetworkType type);
00040 void addDummyNode(int startId, const Time& startTime);
00041 void removeDummyNode();
00042
00043
00044 int getLocationId(NetworkType type, int nodeId);
00045 NodeExpanded* getNode(NetworkType type, int nodeId);
00046
00047 int getTripId(NetworkType netType, int nodeId);
00048 void buildHybridNetwork(int naighboursNumber);
00049 void getConnections(int nodeId, NetworkType type,
00050 int endId, NetworkType endType, Time arrivalTime,
00051 int tripId, bool isMultiCriteria, bool isStartNode,
00052 vector<LiveConnection>* outConnections);
00053 bool equalWithStartStation(NetworkType nodeType, int startId,
00054 NetworkType otherNodeType,
00055 int otherNodeId);
00056 bool equalWithEndStation(NetworkType nodeType, int endId,
00057 NetworkType otherNodeType,
00058 int otherNodeId);
00059 double getLatitude(NetworkType type, int nodeId);
00060 double getLongitude(NetworkType type, int nodeId);
00061
00062 private:
00063 RoadNetwork* _roadNetwork;
00064 TransitNetworkExpanded* _transitNetworkExpanded;
00065 TransitNetworkDependent* _transitNetworkDependent;
00066 vector <vector <Edge> > _transitIdToRoadIds;
00067 vector <vector <Edge> > _roadIdToTransitIds;
00068 };
00069
00070 #endif
00071