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 /****************************************************************************/
14 // An actuated traffic light logic based on time delay of approaching vehicles
15 /****************************************************************************/
16 #ifndef MSDelayBasedTrafficLightLogic_h
17 #define MSDelayBasedTrafficLightLogic_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <map>
27 
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class NLDetectorBuilder;
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
47 public:
49 // typedef std::map<MSLane*, MSE2Collector*> LaneDetectorMap;
50  typedef std::map<MSLane*, MSDetectorFileOutput*> LaneDetectorMap;
51 
52 public:
63  const std::string& id, const std::string& programID,
65  int step, SUMOTime delay,
66  const std::map<std::string, std::string>& parameter,
67  const std::string& basePath);
68 
69 
74  void init(NLDetectorBuilder& nb);
75 
76 
79 
80 
81 
84 
91 
92 
93 protected:
96 
105 
114  SUMOTime proposeProlongation(const SUMOTime actDuration, const SUMOTime maxDuration, bool& othersEmpty);
115 
116 protected:
119 
122 
125 
128  // (Idea: this might be adapted to the detector-length and the vehicle's maximal speed)
130 
132  std::string myFile;
133 
136 
138  std::string myVehicleTypes;
139 };
140 
141 
142 #endif
143 
144 /****************************************************************************/
145 
MSDelayBasedTrafficLightLogic::proposeProlongation
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 ...
Definition: MSDelayBasedTrafficLightLogic.cpp:106
MSDelayBasedTrafficLightLogic::LaneDetectorMap
std::map< MSLane *, MSDetectorFileOutput * > LaneDetectorMap
Definition of a map from lanes to corresponding areal detectors.
Definition: MSDelayBasedTrafficLightLogic.h:50
MSTrafficLightLogic::Phases
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Definition: MSTrafficLightLogic.h:61
MSDelayBasedTrafficLightLogic::trySwitch
SUMOTime trySwitch()
Switches to the next phase, if possible.
Definition: MSDelayBasedTrafficLightLogic.cpp:182
MSDelayBasedTrafficLightLogic::myShowDetectors
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
Definition: MSDelayBasedTrafficLightLogic.h:121
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSDelayBasedTrafficLightLogic::myTimeLossThreshold
double myTimeLossThreshold
Definition: MSDelayBasedTrafficLightLogic.h:129
MSSimpleTrafficLightLogic.h
MSDelayBasedTrafficLightLogic::~MSDelayBasedTrafficLightLogic
~MSDelayBasedTrafficLightLogic()
Destructor.
Definition: MSDelayBasedTrafficLightLogic.cpp:100
MSDelayBasedTrafficLightLogic::myFile
std::string myFile
The output file for generated detectors.
Definition: MSDelayBasedTrafficLightLogic.h:132
MSDelayBasedTrafficLightLogic::MSDelayBasedTrafficLightLogic
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.
Definition: MSDelayBasedTrafficLightLogic.cpp:45
MSSimpleTrafficLightLogic
A fixed traffic light logic.
Definition: MSSimpleTrafficLightLogic.h:54
MSDelayBasedTrafficLightLogic::myFreq
SUMOTime myFreq
The frequency for aggregating detector output.
Definition: MSDelayBasedTrafficLightLogic.h:135
MSDelayBasedTrafficLightLogic::myDetectionRange
double myDetectionRange
Range of the connected detector, which provides the information on approaching vehicles.
Definition: MSDelayBasedTrafficLightLogic.h:124
MSDelayBasedTrafficLightLogic::init
void init(NLDetectorBuilder &nb)
Initializes the tls with information about incoming lanes.
Definition: MSDelayBasedTrafficLightLogic.cpp:74
MSDelayBasedTrafficLightLogic
An actuated traffic light logic based on time delay of approaching vehicles.
Definition: MSDelayBasedTrafficLightLogic.h:46
MSDelayBasedTrafficLightLogic::myVehicleTypes
std::string myVehicleTypes
Whether detector output separates by vType.
Definition: MSDelayBasedTrafficLightLogic.h:138
MSDelayBasedTrafficLightLogic::myLaneDetectors
LaneDetectorMap myLaneDetectors
A map from lanes to the corresponding lane detectors.
Definition: MSDelayBasedTrafficLightLogic.h:118
config.h
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:59
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:55
MSDelayBasedTrafficLightLogic::checkForWaitingTime
SUMOTime checkForWaitingTime()
Checks for approaching vehicles on the lanes associated with green signals and returns the minimal ti...