SUMO - Simulation of Urban MObility
MSDelayBasedTrafficLightLogic.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 /****************************************************************************/
17 // An actuated traffic light logic based on time delay of approaching vehicles
18 /****************************************************************************/
19 #ifndef MSDelayBasedTrafficLightLogic_h
20 #define MSDelayBasedTrafficLightLogic_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <map>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class NLDetectorBuilder;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
54 public:
56 // typedef std::map<MSLane*, MSE2Collector*> LaneDetectorMap;
57  typedef std::map<MSLane*, MSDetectorFileOutput*> LaneDetectorMap;
58 
59 public:
70  const std::string& id, const std::string& programID,
72  int step, SUMOTime delay,
73  const std::map<std::string, std::string>& parameter,
74  const std::string& basePath);
75 
76 
81  void init(NLDetectorBuilder& nb);
82 
83 
86 
87 
88 
91 
98 
99 
100 protected:
103 
112 
121  SUMOTime proposeProlongation(const SUMOTime actDuration, const SUMOTime maxDuration, bool& othersEmpty);
122 
123 protected:
125  LaneDetectorMap myLaneDetectors;
126 
129 
132 
135  // (Idea: this might be adapted to the detector-length and the vehicle's maximal speed)
137 
139  std::string myFile;
140 
143 
145  std::string myVehicleTypes;
146 };
147 
148 
149 #endif
150 
151 /****************************************************************************/
152 
Builds detectors for microsim.
An actuated traffic light logic based on time delay of approaching vehicles.
SUMOTime checkForWaitingTime()
Checks for approaching vehicles on the lanes associated with green signals and returns the minimal ti...
SUMOTime trySwitch()
Switches to the next phase, if possible.
A fixed traffic light logic.
std::map< MSLane *, MSDetectorFileOutput * > LaneDetectorMap
Definition of a map from lanes to corresponding areal detectors.
A class that stores and controls tls and switching of their programs.
MSDelayBasedTrafficLightLogic(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.
std::string myFile
The output file for generated detectors.
LaneDetectorMap myLaneDetectors
A map from lanes to the corresponding lane detectors.
SUMOTime proposeProlongation(const SUMOTime actDuration, const SUMOTime maxDuration, bool &othersEmpty)
The returned, proposed prolongation for the green phase is oriented on the largest estimated passing ...
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
std::string myVehicleTypes
Whether detector output separates by vType.
void init(NLDetectorBuilder &nb)
Initializes the tls with information about incoming lanes.
long long int SUMOTime
Definition: TraCIDefs.h:51
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
SUMOTime myFreq
The frequency for aggregating detector output.
double myDetectionRange
Range of the connected detector, which provides the information on approaching vehicles.