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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // An actuated (adaptive) traffic light logic
18 /****************************************************************************/
19 #ifndef MSActuatedTrafficLightLogic_h
20 #define MSActuatedTrafficLightLogic_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <utility>
29 #include <vector>
30 #include <bitset>
31 #include <map>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class NLDetectorBuilder;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
52 public:
54  typedef std::map<MSLane*, MSDetectorFileOutput*> InductLoopMap;
55 
56 public:
67  const std::string& id, const std::string& programID,
69  int step, SUMOTime delay,
70  const std::map<std::string, std::string>& parameter,
71  const std::string& basePath);
72 
73 
78  void init(NLDetectorBuilder& nb);
79 
80 
83 
84 
85 
88 
95 
96 
97 protected:
100 
105  SUMOTime duration(const double detectionGap) const;
106 
109 
112  double gapControl();
114 
115 
116 protected:
118  InductLoopMap myInductLoops;
119 
121  double myMaxGap;
122 
125 
128 
131 
133  std::string myFile;
134 
137 
139  std::string myVehicleTypes;
140 
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147 
Builds detectors for microsim.
long long int SUMOTime
Definition: SUMOTime.h:36
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.
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.