Eclipse 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-2019 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 /****************************************************************************/
15 // An actuated traffic light logic based on time delay of approaching vehicles
16 /****************************************************************************/
17 #ifndef MSDelayBasedTrafficLightLogic_h
18 #define MSDelayBasedTrafficLightLogic_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <map>
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class NLDetectorBuilder;
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
48 public:
50 // typedef std::map<MSLane*, MSE2Collector*> LaneDetectorMap;
51  typedef std::map<MSLane*, MSDetectorFileOutput*> LaneDetectorMap;
52 
53 public:
64  const std::string& id, const std::string& programID,
66  int step, SUMOTime delay,
67  const std::map<std::string, std::string>& parameter,
68  const std::string& basePath);
69 
70 
75  void init(NLDetectorBuilder& nb);
76 
77 
80 
81 
82 
85 
92 
93 
94 protected:
97 
106 
115  SUMOTime proposeProlongation(const SUMOTime actDuration, const SUMOTime maxDuration, bool& othersEmpty);
116 
117 protected:
119  LaneDetectorMap myLaneDetectors;
120 
123 
126 
129  // (Idea: this might be adapted to the detector-length and the vehicle's maximal speed)
131 
133  std::string myFile;
134 
137 
139  std::string myVehicleTypes;
140 };
141 
142 
143 #endif
144 
145 /****************************************************************************/
146 
Builds detectors for microsim.
long long int SUMOTime
Definition: SUMOTime.h:35
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.
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.