SUMO - Simulation of Urban MObility
MSDelayBasedTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // An actuated traffic light logic based on time delay of approaching vehicles
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2002-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSDelayBasedTrafficLightLogic_h
21 #define MSDelayBasedTrafficLightLogic_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <map>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class NLDetectorBuilder;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
55 public:
57 // typedef std::map<MSLane*, MSE2Collector*> LaneDetectorMap;
58  typedef std::map<MSLane*, MSDetectorFileOutput*> LaneDetectorMap;
59 
60 public:
71  const std::string& id, const std::string& programID,
73  int step, SUMOTime delay,
74  const std::map<std::string, std::string>& parameter,
75  const std::string& basePath);
76 
77 
82  void init(NLDetectorBuilder& nb);
83 
84 
87 
88 
89 
92 
99 
100 
101 protected:
104 
113 
122  SUMOTime proposeProlongation(const SUMOTime actDuration, const SUMOTime maxDuration, bool& othersEmpty);
123 
124 protected:
126  LaneDetectorMap myLaneDetectors;
127 
130 
133 
136  // (Idea: this might be adapted to the detector-length and the vehicle's maximal speed)
138 
140  std::string myFile;
141 
144 
146  std::string myVehicleTypes;
147 };
148 
149 
150 #endif
151 
152 /****************************************************************************/
153 
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:52
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.