00001
00002
00003
00004
00005
00006 #ifndef ROUTEPLANNINGV2_EDGEDEPENDENT_H_
00007 #define ROUTEPLANNINGV2_EDGEDEPENDENT_H_
00008
00009 #include <vector>
00010 #include <unordered_map>
00011 #include <unordered_set>
00012 #include "./Time.h"
00013 using std::vector;
00014 using std::unordered_map;
00015
00016
00017 class Connection
00018 {
00019 public:
00020
00021 Time departureTime;
00022
00023 Time arrivalTime;
00024
00025 int lineId;
00026 Connection(Time startTime, Time endTime, int lineId);
00027 Connection(int lineId);
00028 Connection();
00029 };
00030
00031 class EdgeDependent
00032 {
00033 public:
00034 EdgeDependent(int otherNodeId);
00035
00036 void AddStopTime(Time startTime, Time endTime, int lineId);
00037 void BuildTripsMap();
00038 void AddStopTimeToTheTrip(int timeId, int lineId);
00039
00040
00041
00042
00043 void GetWight(const Connection& inTime, int transferTime,
00044 std::vector<Connection>* stopTimesOut,
00045 bool ifStartNode, bool isMultictriteria, bool* domination);
00046 void GetNextConectionOfAllTrips(const Connection& inTime,
00047 std::vector<Connection>* stopTimesOut);
00048 int otherNodeId;
00049
00050
00051 vector<Connection> _times;
00052 unordered_map <int, vector<int> > _tripIdsToConections;
00053 private:
00054 size_t findFirstDepartureTimeIndex(const Time& startTime);
00055 size_t findFirstDepartureTimeIndexForTrip(int lineId, const Time& startTime);
00056 };
00057
00058 #endif // ROUTEPLANNINGV2_EDGEDEPENDENT_H_