SUMO - Simulation of Urban MObility
MSActuatedTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // An actuated (adaptive) traffic light logic
20 /****************************************************************************/
21 #ifndef MSActuatedTrafficLightLogic_h
22 #define MSActuatedTrafficLightLogic_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <utility>
35 #include <vector>
36 #include <bitset>
37 #include <map>
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class NLDetectorBuilder;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
58 public:
60  typedef std::map<MSLane*, MSDetectorFileOutput*> InductLoopMap;
61 
62 public:
73  const std::string& id, const std::string& programID,
75  int step, SUMOTime delay,
76  const std::map<std::string, std::string>& parameter,
77  const std::string& basePath);
78 
79 
84  void init(NLDetectorBuilder& nb);
85 
86 
89 
90 
91 
94 
101 
102 
103 protected:
106 
111  SUMOTime duration(const double detectionGap) const;
112 
115 
118  double gapControl();
120 
121 
122 protected:
124  InductLoopMap myInductLoops;
125 
127  double myMaxGap;
128 
131 
134 
137 
139  std::string myFile;
140 
143 
145  std::string myVehicleTypes;
146 
147 };
148 
149 
150 #endif
151 
152 /****************************************************************************/
153 
Builds detectors for microsim.
void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
std::string myFile
The output file for generated detectors.
SUMOTime duration(const double detectionGap) const
Returns the minimum duration of the current phase.
A fixed traffic light logic.
An actuated (adaptive) traffic light logic.
A class that stores and controls tls and switching of their programs.
std::string myVehicleTypes
Whether detector output separates by vType.
std::map< MSLane *, MSDetectorFileOutput * > InductLoopMap
Definition of a map from lanes to induct loops lying on them.
double myMaxGap
The maximum gap to check in seconds.
InductLoopMap myInductLoops
A map from lanes to induct loops lying on them.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
SUMOTime getMinimumMinDuration() const
get the minimum min duration for all stretchable phases
double gapControl()
Return the minimum detection gap of all detectors if the current phase should be extended and double:...
double myDetectorGap
The detector distance in seconds.
long long int SUMOTime
Definition: TraCIDefs.h:51
double myPassingTime
The passing time used in seconds.
MSActuatedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const MSSimpleTrafficLightLogic::Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > &parameter, const std::string &basePath)
Constructor.
SUMOTime myFreq
The frequency for aggregating detector output.
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
SUMOTime trySwitch()
Switches to the next phase.