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:
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 
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:107
MSDelayBasedTrafficLightLogic::LaneDetectorMap
std::map< MSLane *, MSDetectorFileOutput * > LaneDetectorMap
Definition of a map from lanes to corresponding areal detectors.
Definition: MSDelayBasedTrafficLightLogic.h:51
MSTrafficLightLogic::Phases
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Definition: MSTrafficLightLogic.h:62
MSDelayBasedTrafficLightLogic::trySwitch
SUMOTime trySwitch()
Switches to the next phase, if possible.
Definition: MSDelayBasedTrafficLightLogic.cpp:183
MSDelayBasedTrafficLightLogic::myShowDetectors
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
Definition: MSDelayBasedTrafficLightLogic.h:122
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
MSDelayBasedTrafficLightLogic::myTimeLossThreshold
double myTimeLossThreshold
Definition: MSDelayBasedTrafficLightLogic.h:130
MSSimpleTrafficLightLogic.h
MSDelayBasedTrafficLightLogic::~MSDelayBasedTrafficLightLogic
~MSDelayBasedTrafficLightLogic()
Destructor.
Definition: MSDelayBasedTrafficLightLogic.cpp:101
MSDelayBasedTrafficLightLogic::myFile
std::string myFile
The output file for generated detectors.
Definition: MSDelayBasedTrafficLightLogic.h:133
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:46
MSSimpleTrafficLightLogic
A fixed traffic light logic.
Definition: MSSimpleTrafficLightLogic.h:55
MSDelayBasedTrafficLightLogic::myFreq
SUMOTime myFreq
The frequency for aggregating detector output.
Definition: MSDelayBasedTrafficLightLogic.h:136
MSDelayBasedTrafficLightLogic::myDetectionRange
double myDetectionRange
Range of the connected detector, which provides the information on approaching vehicles.
Definition: MSDelayBasedTrafficLightLogic.h:125
MSDelayBasedTrafficLightLogic::init
void init(NLDetectorBuilder &nb)
Initializes the tls with information about incoming lanes.
Definition: MSDelayBasedTrafficLightLogic.cpp:75
MSDelayBasedTrafficLightLogic
An actuated traffic light logic based on time delay of approaching vehicles.
Definition: MSDelayBasedTrafficLightLogic.h:47
MSDelayBasedTrafficLightLogic::myVehicleTypes
std::string myVehicleTypes
Whether detector output separates by vType.
Definition: MSDelayBasedTrafficLightLogic.h:139
MSDelayBasedTrafficLightLogic::myLaneDetectors
LaneDetectorMap myLaneDetectors
A map from lanes to the corresponding lane detectors.
Definition: MSDelayBasedTrafficLightLogic.h:119
config.h
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:60
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:56
MSDelayBasedTrafficLightLogic::checkForWaitingTime
SUMOTime checkForWaitingTime()
Checks for approaching vehicles on the lanes associated with green signals and returns the minimal ti...