SUMO - Simulation of Urban MObility
TraCI_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 TraCI_TrafficLight_h
22 #define TraCI_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 <traci-server/TraCIDefs.h>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class MSRoute;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
51 public:
52 
53  static std::vector<std::string> getIDList();
54  static int getIDCount();
55  static std::string getRedYellowGreenState(const std::string& tlsID);
56  static std::vector<TraCILogic> getCompleteRedYellowGreenDefinition(const std::string& tlsID);
57  static std::vector<std::string> getControlledJunctions(const std::string& tlsID);
58  static std::vector<std::string> getControlledLanes(const std::string& tlsID);
59  static std::vector<std::vector<TraCILink> > getControlledLinks(const std::string& tlsID);
60  static std::string getProgram(const std::string& tlsID);
61  static int getPhase(const std::string& tlsID);
62  static SUMOTime getPhaseDuration(const std::string& tlsID);
63  static SUMOTime getNextSwitch(const std::string& tlsID);
64  static std::string getParameter(const std::string& tlsID, const std::string& paramName);
65 
66  static void setRedYellowGreenState(const std::string& tlsID, const std::string& state);
67  static void setPhase(const std::string& tlsID, const int index);
68  static void setProgram(const std::string& tlsID, const std::string& programID);
69  static void setPhaseDuration(const std::string& tlsID, const SUMOTime phaseDuration);
70  static void setCompleteRedYellowGreenDefinition(const std::string& tlsID, const TraCILogic& logic);
71  static void setParameter(const std::string& tlsID, const std::string& paramName, const std::string& value);
72 
73 private:
74  static MSTLLogicControl::TLSLogicVariants& getTLS(const std::string& id);
75 
78 
81 
84 };
85 
86 
87 #endif
88 
89 /****************************************************************************/
90 
Storage for all programs of a single tls.
static int getPhase(const std::string &tlsID)
static void setCompleteRedYellowGreenDefinition(const std::string &tlsID, const TraCILogic &logic)
static void setPhaseDuration(const std::string &tlsID, const SUMOTime phaseDuration)
static void setPhase(const std::string &tlsID, const int index)
TraCI_TrafficLight & operator=(const TraCI_TrafficLight &src)
invalidated assignment operator
static std::vector< std::string > getControlledJunctions(const std::string &tlsID)
static void setProgram(const std::string &tlsID, const std::string &programID)
TraCI_TrafficLight()
invalidated standard constructor
static MSTLLogicControl::TLSLogicVariants & getTLS(const std::string &id)
static SUMOTime getNextSwitch(const std::string &tlsID)
static std::vector< std::vector< TraCILink > > getControlledLinks(const std::string &tlsID)
static std::string getProgram(const std::string &tlsID)
C++ TraCI client API implementation.
static void setRedYellowGreenState(const std::string &tlsID, const std::string &state)
static std::string getRedYellowGreenState(const std::string &tlsID)
static std::vector< TraCILogic > getCompleteRedYellowGreenDefinition(const std::string &tlsID)
static std::string getParameter(const std::string &tlsID, const std::string &paramName)
static std::vector< std::string > getControlledLanes(const std::string &tlsID)
long long int SUMOTime
Definition: TraCIDefs.h:51
static std::vector< std::string > getIDList()
static SUMOTime getPhaseDuration(const std::string &tlsID)
static void setParameter(const std::string &tlsID, const std::string &paramName, const std::string &value)