SUMO - Simulation of Urban MObility
TrafficLight.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // C++ TraCI client API implementation
20 /****************************************************************************/
21 #ifndef TrafficLight_h
22 #define TrafficLight_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 <vector>
35 #include <libsumo/TraCIDefs.h>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class MSRoute;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
50 namespace libsumo {
51 class TrafficLight {
52 public:
53 
54  static std::vector<std::string> getIDList();
55  static int getIDCount();
56  static std::string getRedYellowGreenState(const std::string& tlsID);
57  static std::vector<TraCILogic> getCompleteRedYellowGreenDefinition(const std::string& tlsID);
58  static std::vector<std::string> getControlledJunctions(const std::string& tlsID);
59  static std::vector<std::string> getControlledLanes(const std::string& tlsID);
60  static std::vector<std::vector<TraCILink> > getControlledLinks(const std::string& tlsID);
61  static std::string getProgram(const std::string& tlsID);
62  static int getPhase(const std::string& tlsID);
63  static SUMOTime getPhaseDuration(const std::string& tlsID);
64  static SUMOTime getNextSwitch(const std::string& tlsID);
65  static std::string getParameter(const std::string& tlsID, const std::string& paramName);
66 
67  static void setRedYellowGreenState(const std::string& tlsID, const std::string& state);
68  static void setPhase(const std::string& tlsID, const int index);
69  static void setProgram(const std::string& tlsID, const std::string& programID);
70  static void setPhaseDuration(const std::string& tlsID, const SUMOTime phaseDuration);
71  static void setCompleteRedYellowGreenDefinition(const std::string& tlsID, const TraCILogic& logic);
72  static void setParameter(const std::string& tlsID, const std::string& paramName, const std::string& value);
73 
74 private:
75  static MSTLLogicControl::TLSLogicVariants& getTLS(const std::string& id);
76 
78  TrafficLight();
79 
81  TrafficLight(const TrafficLight& src);
82 
84  TrafficLight& operator=(const TrafficLight& src);
85 };
86 }
87 
88 
89 #endif
90 
91 /****************************************************************************/
Storage for all programs of a single tls.
static std::string getRedYellowGreenState(const std::string &tlsID)
TrafficLight & operator=(const TrafficLight &src)
invalidated assignment operator
static std::vector< std::string > getControlledJunctions(const std::string &tlsID)
static void setParameter(const std::string &tlsID, const std::string &paramName, const std::string &value)
static std::vector< std::string > getIDList()
static std::vector< std::string > getControlledLanes(const std::string &tlsID)
static void setRedYellowGreenState(const std::string &tlsID, const std::string &state)
static MSTLLogicControl::TLSLogicVariants & getTLS(const std::string &id)
static void setPhaseDuration(const std::string &tlsID, const SUMOTime phaseDuration)
static int getIDCount()
static std::vector< TraCILogic > getCompleteRedYellowGreenDefinition(const std::string &tlsID)
Definition: Edge.cpp:31
static SUMOTime getNextSwitch(const std::string &tlsID)
TrafficLight()
invalidated standard constructor
static void setPhase(const std::string &tlsID, const int index)
static SUMOTime getPhaseDuration(const std::string &tlsID)
static void setCompleteRedYellowGreenDefinition(const std::string &tlsID, const TraCILogic &logic)
static void setProgram(const std::string &tlsID, const std::string &programID)
long long int SUMOTime
Definition: TraCIDefs.h:51
static std::string getProgram(const std::string &tlsID)
static int getPhase(const std::string &tlsID)
static std::string getParameter(const std::string &tlsID, const std::string &paramName)
static std::vector< std::vector< TraCILink > > getControlledLinks(const std::string &tlsID)