00001
00002
00003
00004
00005
00006 #ifndef ROUTEPLANNINGV2_LABEL_H_
00007 #define ROUTEPLANNINGV2_LABEL_H_
00008 #include <vector>
00009 #include <functional>
00010 #include <assert.h>
00011 #include <gtest/gtest.h>
00012 #include "./EdgeDependent.h"
00013 #include "./LiveConnection.h"
00014
00015 using std::vector;
00016 using std::pair;
00017
00018 class Label
00019 {
00020 public:
00021 Label(Connection stopTime, const vector<int>& criterias,
00022 int NodeId, int expandedFromLabelId, NetworkType netType);
00023 string createCompressedJSON(int labelId, const Time& arrivalTime,
00024 int locationId) const;
00025 Connection connection;
00026 int NodeId;
00027 int expandedFromLabelId;
00028 int removedByLabelId;
00029 bool removed;
00030 NetworkType netType;
00031 vector<int> criterias;
00032 private:
00033
00034 Label();
00035 };
00036
00037
00038
00039 class LabelSet
00040 {
00041 public:
00042 LabelSet();
00043 LabelSet(vector <Label>* labels, int transferTime);
00044
00045
00046 void dominateBadLabels(int time, int transfers, int lineId,
00047 int transferTime, bool expanded, bool EndStation,
00048 int* posInTransferVector, int* posInTimeVector,
00049 bool multicriteria);
00050 FRIEND_TEST(LabelSetTest, labelMustBeAdded);
00051 bool labelMustBeAdded(int time, int transfers, int labelId, int trTime,
00052 bool expanded, bool EndStation, bool multicriteria);
00053 bool AddLabel(Connection stopTime, const vector<int>& criterias,
00054 int NodeId, int expandedFromLabelId, NetworkType type,
00055 bool expanded, bool EndStation, bool createLabel,
00056 bool multicriteria);
00057
00058 int nodeId;
00059
00060 vector <vector <int> > _expandedFrom;
00061 private:
00062 vector <Label>* _labels;
00063 };
00064
00065
00066
00067 #endif // ROUTEPLANNINGV2_LABEL_H_