SUMO - Simulation of Urban MObility
TraCI_Lane.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 /****************************************************************************/
20 // C++ TraCI client API implementation
21 /****************************************************************************/
22 #ifndef TraCI_Lane_h
23 #define TraCI_Lane_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 <vector>
36 #include <traci-server/TraCIDefs.h>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MSLane;
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 class TraCI_Lane {
52 public:
53 
54  // Getter
55  static std::vector<std::string> getIDList();
56  static int getIDCount();
57  static int getLinkNumber(std::string laneID);
58  static std::string getEdgeID(std::string laneID);
59  static double getLength(std::string laneID);
60  static double getMaxSpeed(std::string laneID);
61  static std::vector<std::string> getAllowed(std::string laneID);
62  static std::vector<std::string> getDisallowed(std::string laneID);
63  static std::vector<TraCIConnection> getLinks(std::string laneID);
64  static TraCIPositionVector getShape(std::string laneID);
65  static double getWidth(std::string laneID);
66  static double getCO2Emission(std::string laneID);
67  static double getCOEmission(std::string laneID);
68  static double getHCEmission(std::string laneID);
69  static double getPMxEmission(std::string laneID);
70  static double getNOxEmission(std::string laneID);
71  static double getFuelConsumption(std::string laneID);
72  static double getNoiseEmission(std::string laneID);
73  static double getElectricityConsumption(std::string laneID);
74  static double getLastStepMeanSpeed(std::string laneID);
75  static double getLastStepOccupancy(std::string laneID);
76  static double getLastStepLength(std::string laneID);
77  static double getWaitingTime(std::string laneID);
78  static double getTraveltime(std::string laneID);
79  static int getLastStepVehicleNumber(std::string laneID);
80  static int getLastStepHaltingNumber(std::string laneID);
81  static std::vector<std::string> getLastStepVehicleIDs(std::string laneID);
82  static std::vector<std::string> getFoes(const std::string& laneID, const std::string& toLaneID);
83  static std::vector<std::string> getInternalFoes(const std::string& laneID);
84 
85  // Setter
86  static void setAllowed(std::string laneID, std::vector<std::string> allowedClasses);
87  static void setDisallowed(std::string laneID, std::vector<std::string> disallowedClasses);
88  static void setMaxSpeed(std::string laneID, double speed);
89  static void setLength(std::string laneID, double length);
90 
91  // Generic parameter get/set
92  static std::string getParameter(const std::string& laneID, const std::string& param);
93  static void setParameter(const std::string& routeID, const std::string& key, const std::string& value); // not needed so far
94 
95  // Subscriptions (TODO?)
96  static void subscribe(const std::string& objID, SUMOTime beginTime, SUMOTime endTime, const std::vector<int>& vars);
97  static void subscribeContext(const std::string& objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector<int>& vars);
98 
99  static const MSLane* getLane(const std::string& id);
100 
101 private:
103  TraCI_Lane();
104 
106  TraCI_Lane(const TraCI_Lane& src);
107 
109  TraCI_Lane& operator=(const TraCI_Lane& src);
110 };
111 
112 
113 #endif
114 
115 /****************************************************************************/
116 
static double getCO2Emission(std::string laneID)
Definition: TraCI_Lane.cpp:145
static int getLastStepHaltingNumber(std::string laneID)
Definition: TraCI_Lane.cpp:243
static double getHCEmission(std::string laneID)
Definition: TraCI_Lane.cpp:157
static double getLength(std::string laneID)
Definition: TraCI_Lane.cpp:66
static std::vector< std::string > getLastStepVehicleIDs(std::string laneID)
Definition: TraCI_Lane.cpp:258
static double getWaitingTime(std::string laneID)
Definition: TraCI_Lane.cpp:220
static void setAllowed(std::string laneID, std::vector< std::string > allowedClasses)
Definition: TraCI_Lane.cpp:305
static double getElectricityConsumption(std::string laneID)
Definition: TraCI_Lane.cpp:186
static std::string getEdgeID(std::string laneID)
Definition: TraCI_Lane.cpp:60
static std::vector< std::string > getIDList()
Definition: TraCI_Lane.cpp:46
static std::vector< TraCIConnection > getLinks(std::string laneID)
Definition: TraCI_Lane.cpp:84
static double getNoiseEmission(std::string laneID)
Definition: TraCI_Lane.cpp:180
static std::vector< std::string > getInternalFoes(const std::string &laneID)
Definition: TraCI_Lane.cpp:286
TraCI_Lane()
invalidated standard constructor
static void subscribeContext(const std::string &objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector< int > &vars)
static void setDisallowed(std::string laneID, std::vector< std::string > disallowedClasses)
Definition: TraCI_Lane.cpp:313
static double getWidth(std::string laneID)
Definition: TraCI_Lane.cpp:139
static double getLastStepMeanSpeed(std::string laneID)
Definition: TraCI_Lane.cpp:192
static double getNOxEmission(std::string laneID)
Definition: TraCI_Lane.cpp:169
static double getLastStepLength(std::string laneID)
Definition: TraCI_Lane.cpp:204
static double getTraveltime(std::string laneID)
Definition: TraCI_Lane.cpp:226
static std::vector< std::string > getFoes(const std::string &laneID, const std::string &toLaneID)
Definition: TraCI_Lane.cpp:270
static int getIDCount()
Definition: TraCI_Lane.cpp:54
static std::string getParameter(const std::string &laneID, const std::string &param)
Definition: TraCI_Lane.cpp:335
TraCI_Lane & operator=(const TraCI_Lane &src)
invalidated assignment operator
static std::vector< std::string > getAllowed(std::string laneID)
Definition: TraCI_Lane.cpp:108
static TraCIPositionVector getShape(std::string laneID)
Definition: TraCI_Lane.cpp:124
static double getLastStepOccupancy(std::string laneID)
Definition: TraCI_Lane.cpp:198
C++ TraCI client API implementation.
Definition: TraCI_Lane.h:51
static double getFuelConsumption(std::string laneID)
Definition: TraCI_Lane.cpp:174
static int getLinkNumber(std::string laneID)
Definition: TraCI_Lane.cpp:78
static void setParameter(const std::string &routeID, const std::string &key, const std::string &value)
Definition: TraCI_Lane.cpp:341
static void setLength(std::string laneID, double length)
Definition: TraCI_Lane.cpp:328
static const MSLane * getLane(const std::string &id)
Definition: TraCI_Lane.cpp:348
long long int SUMOTime
Definition: TraCIDefs.h:51
static double getCOEmission(std::string laneID)
Definition: TraCI_Lane.cpp:151
static int getLastStepVehicleNumber(std::string laneID)
Definition: TraCI_Lane.cpp:238
Representation of a lane in the micro simulation.
Definition: MSLane.h:78
A list of positions.
static void subscribe(const std::string &objID, SUMOTime beginTime, SUMOTime endTime, const std::vector< int > &vars)
static double getPMxEmission(std::string laneID)
Definition: TraCI_Lane.cpp:163
static std::vector< std::string > getDisallowed(std::string laneID)
Definition: TraCI_Lane.cpp:118
static void setMaxSpeed(std::string laneID, double speed)
Definition: TraCI_Lane.cpp:321
static double getMaxSpeed(std::string laneID)
Definition: TraCI_Lane.cpp:72