MSUnboundActuatedTrafficLightLogic.h
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MSUnboundActuatedTrafficLightLogic_h
00020 #define MSUnboundActuatedTrafficLightLogic_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 <utility>
00033 #include <vector>
00034 #include <bitset>
00035 #include <map>
00036 #include <microsim/MSEventControl.h>
00037 #include <microsim/traffic_lights/MSTrafficLightLogic.h>
00038 #include "MSActuatedPhaseDefinition.h"
00039 #include "MSSimpleTrafficLightLogic.h"
00040 #include <microsim/output/MSInductLoop.h>
00041 #include <microsim/MSLaneState.h>
00042
00043
00044
00045
00046
00047 class NLDetectorBuilder;
00048
00049
00050
00051
00052
00061 class MSUnboundActuatedTrafficLightLogic :
00062 public MSSimpleTrafficLightLogic {
00063 public:
00065 typedef std::map<MSLane*, MSInductLoop*> InductLoopMap;
00066
00068 typedef std::map<MSLane*, MSLaneState*> LaneStateMap;
00069
00070 public:
00072 MSUnboundActuatedTrafficLightLogic(const std::string &id,
00073 const MSSimpleTrafficLightLogic::Phases &phases,
00074 size_t step, size_t delay,
00075 SUMOReal maxGap, SUMOReal passingTime, SUMOReal detectorGap);
00076
00078 void init(NLDetectorBuilder &nb,
00079 const std::vector<MSLane*> &lanes,
00080 std::map<std::string, std::vector<std::string> > &edgeContinuations,
00081 SUMOReal det_offset);
00082
00084 ~MSUnboundActuatedTrafficLightLogic();
00085
00088 SUMOTime trySwitch(bool isActive);
00089
00091 SUMOTime duration() const;
00092
00094 bool gapControl();
00095
00096
00097 bool isGreenPhase() const ;
00098
00099 protected:
00101 MSActuatedPhaseDefinition * currentPhaseDef() const;
00102
00103 protected:
00105 InductLoopMap myInductLoops;
00106
00108 LaneStateMap myLaneStates;
00109
00111 bool myContinue;
00112
00114 SUMOReal myMaxGap;
00115
00117 SUMOReal myPassingTime;
00118
00120 SUMOReal myDetectorGap;
00121
00122 };
00123
00124
00125 #endif
00126
00127
00128