SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSActuatedTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // An actuated (adaptive) traffic light logic
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSActuatedTrafficLightLogic_h
22 #define MSActuatedTrafficLightLogic_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <utility>
35 #include <vector>
36 #include <bitset>
37 #include <map>
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class NLDetectorBuilder;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
58 public:
60  typedef std::map<MSLane*, MSInductLoop*> InductLoopMap;
61 
62 public:
73  const std::string& id, const std::string& programID,
75  unsigned int step, SUMOTime delay,
76  const std::map<std::string, std::string>& parameter);
77 
78 
83  void init(NLDetectorBuilder& nb);
84 
85 
88 
89 
90 
93 
99  SUMOTime trySwitch(bool isActive);
101 
102 
103 protected:
106 
110  SUMOTime duration() const;
111 
112 
115  void gapControl();
117 
118 
119 protected:
122 
125 
128 
131 
134 
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
141 
Builds detectors for microsim.
void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
A fixed traffic light logic.
std::map< MSLane *, MSInductLoop * > InductLoopMap
Definition of a map from lanes to induct loops lying on them.
An actuated (adaptive) traffic light logic.
A class that stores and controls tls and switching of their programs.
SUMOTime trySwitch(bool isActive)
Switches to the next phase.
SUMOReal myMaxGap
The maximum gap to check.
SUMOTime duration() const
Returns the duration of the given step.
SUMOReal myPassingTime
The passing time used.
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.
bool myContinue
information whether the current phase should be lenghtend
MSActuatedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const MSSimpleTrafficLightLogic::Phases &phases, unsigned int step, SUMOTime delay, const std::map< std::string, std::string > &parameter)
Constructor.
#define SUMOReal
Definition: config.h:221
void gapControl()
Decides, whether a phase should be continued by checking the gaps of vehicles having green...