SUMO - Simulation of Urban MObility
MSActuatedTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // An actuated (adaptive) traffic light logic
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2002-2016 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSActuatedTrafficLightLogic_h
23 #define MSActuatedTrafficLightLogic_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <utility>
36 #include <vector>
37 #include <bitset>
38 #include <map>
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
48 class NLDetectorBuilder;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
59 public:
61  typedef std::map<MSLane*, MSDetectorFileOutput*> InductLoopMap;
62 
63 public:
74  const std::string& id, const std::string& programID,
76  int step, SUMOTime delay,
77  const std::map<std::string, std::string>& parameter,
78  const std::string& basePath);
79 
80 
85  void init(NLDetectorBuilder& nb);
86 
87 
90 
91 
92 
95 
102 
103 
104 protected:
107 
112  SUMOTime duration(const SUMOReal detectionGap) const;
113 
114 
119 
120 
121 protected:
123  InductLoopMap myInductLoops;
124 
127 
130 
133 
136 
138  std::string myFile;
139 
142 
144  std::string myVehicleTypes;
145 
146 };
147 
148 
149 #endif
150 
151 /****************************************************************************/
152 
Builds detectors for microsim.
long long int SUMOTime
Definition: SUMOTime.h:43
void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
std::string myFile
The output file for generated detectors.
A fixed traffic light logic.
An actuated (adaptive) traffic light logic.
A class that stores and controls tls and switching of their programs.
std::string myVehicleTypes
Whether detector output separates by vType.
SUMOReal myMaxGap
The maximum gap to check in seconds.
std::map< MSLane *, MSDetectorFileOutput * > InductLoopMap
Definition of a map from lanes to induct loops lying on them.
SUMOReal myPassingTime
The passing time used in seconds.
SUMOTime duration(const SUMOReal detectionGap) const
Returns the minimum duration of the current phase.
InductLoopMap myInductLoops
A map from lanes to induct loops lying on them.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
SUMOReal myDetectorGap
The detector distance in seconds.
#define SUMOReal
Definition: config.h:213
MSActuatedTrafficLightLogic(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.
SUMOTime myFreq
The frequency for aggregating detector output.
SUMOReal gapControl()
Return the minimum detection gap of all detectors if the current phase should be extended and SUMORea...
bool myShowDetectors
Whether the detectors shall be shown in the GUI.
SUMOTime trySwitch()
Switches to the next phase.