NIVisumTL.h
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NIVisumTL_h
00020 #define NIVisumTL_h
00021
00022
00023
00024
00025
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031
00032 #include <vector>
00033 #include <map>
00034 #include <string>
00035 #include <netbuild/NBConnectionDefs.h>
00036 #include <netbuild/NBNodeCont.h>
00037 #include <utils/common/SUMOTime.h>
00038
00039 class NBTrafficLightLogicCont;
00040
00041
00042
00043
00044
00049 class NIVisumTL {
00050 public:
00052 class TimePeriod {
00053 public:
00054
00055 TimePeriod();
00056 TimePeriod(SUMOTime StartTime, SUMOTime EndTime);
00057
00058 ~TimePeriod();
00059 void SetStartTime(SUMOTime StartTime);
00060 void SetEndTime(SUMOTime EndTime);
00061 SUMOTime GetStartTime();
00062 SUMOTime GetEndTime();
00063 private:
00064 SUMOTime myStartTime;
00065 SUMOTime myEndTime;
00066 };
00067
00068
00069 class Phase : public TimePeriod {
00070 public:
00071 Phase();
00072 Phase(SUMOTime StartTime, SUMOTime EndTime);
00073 ~Phase();
00074 };
00075
00076
00077 typedef std::vector<NBNode*> NodeVector;
00078 typedef std::map<std::string, Phase*> PhaseMap;
00079
00080
00081
00082 class SignalGroup : public TimePeriod {
00083 public:
00084
00085 SignalGroup(const std::string &Name, SUMOTime StartTime, SUMOTime EndTime);
00086
00087 ~SignalGroup();
00088 private:
00089 NBConnectionVector myConnections;
00090 PhaseMap myPhases;
00091 std::string myName;
00092 public:
00093 NBConnectionVector* GetConnections();
00094 PhaseMap* GetPhases();
00095 std::string GetName();
00096 };
00097
00098
00099 typedef std::map<std::string, SignalGroup*> SignalGroupMap;
00100 public:
00101
00102 NIVisumTL();
00103 NIVisumTL(const std::string &Name, SUMOTime CycleTime, SUMOTime IntermediateTime,
00104 bool PhaseDefined);
00105
00106 ~NIVisumTL();
00107
00108 NodeVector* GetNodes();
00109 PhaseMap* GetPhases();
00110 SignalGroupMap* GetSignalGroups();
00111
00112 void SetPhaseDefined(bool PhaseDefined);
00113 void SetCycleTime(SUMOTime CylcleTime);
00114 void SetIntermediateTime(SUMOTime IntermediateTime);
00115
00116 bool GetPhaseDefined();
00117 SUMOTime GetCycleTime();
00118 SUMOTime GetIntermediateTime();
00119 SUMOTime GetName();
00120 SignalGroup* GetSignalGroup(const std::string Name);
00121
00122 void AddSignalGroup(const std::string Name, SUMOTime StartTime, SUMOTime EndTime);
00123 void AddPhase(const std::string Name, SUMOTime StartTime, SUMOTime EndTime);
00124
00125 void build(NBTrafficLightLogicCont &tlc);
00126 private:
00127
00128 std::string myName;
00129
00130
00131 SUMOTime myCycleTime;
00132
00133
00134 SUMOTime myIntermediateTime;
00135
00136
00137 bool myPhaseDefined;
00138
00139
00140 NodeVector myNodes;
00141
00142
00143 PhaseMap myPhases;
00144
00145
00146 SignalGroupMap mySignalGroups;
00147
00148 };
00149
00150
00151 #endif
00152
00153
00154