SUMO - Simulation of Urban MObility
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 Lane_h
23 #define 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 <libsumo/TraCIDefs.h>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MSLane;
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 namespace libsumo {
52 class Lane {
53 public:
54 
55  // Getter
56  static std::vector<std::string> getIDList();
57  static int getIDCount();
58  static int getLinkNumber(std::string laneID);
59  static std::string getEdgeID(std::string laneID);
60  static double getLength(std::string laneID);
61  static double getMaxSpeed(std::string laneID);
62  static std::vector<std::string> getAllowed(std::string laneID);
63  static std::vector<std::string> getDisallowed(std::string laneID);
64  static std::vector<TraCIConnection> getLinks(std::string laneID);
65  static TraCIPositionVector getShape(std::string laneID);
66  static double getWidth(std::string laneID);
67  static double getCO2Emission(std::string laneID);
68  static double getCOEmission(std::string laneID);
69  static double getHCEmission(std::string laneID);
70  static double getPMxEmission(std::string laneID);
71  static double getNOxEmission(std::string laneID);
72  static double getFuelConsumption(std::string laneID);
73  static double getNoiseEmission(std::string laneID);
74  static double getElectricityConsumption(std::string laneID);
75  static double getLastStepMeanSpeed(std::string laneID);
76  static double getLastStepOccupancy(std::string laneID);
77  static double getLastStepLength(std::string laneID);
78  static double getWaitingTime(std::string laneID);
79  static double getTraveltime(std::string laneID);
80  static int getLastStepVehicleNumber(std::string laneID);
81  static int getLastStepHaltingNumber(std::string laneID);
82  static std::vector<std::string> getLastStepVehicleIDs(std::string laneID);
83  static std::vector<std::string> getFoes(const std::string& laneID, const std::string& toLaneID);
84  static std::vector<std::string> getInternalFoes(const std::string& laneID);
85 
86  // Setter
87  static void setAllowed(std::string laneID, std::vector<std::string> allowedClasses);
88  static void setDisallowed(std::string laneID, std::vector<std::string> disallowedClasses);
89  static void setMaxSpeed(std::string laneID, double speed);
90  static void setLength(std::string laneID, double length);
91 
92  // Generic parameter get/set
93  static std::string getParameter(const std::string& laneID, const std::string& param);
94  static void setParameter(const std::string& routeID, const std::string& key, const std::string& value); // not needed so far
95 
96  // Subscriptions (TODO?)
97  static void subscribe(const std::string& objID, SUMOTime beginTime, SUMOTime endTime, const std::vector<int>& vars);
98  static void subscribeContext(const std::string& objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector<int>& vars);
99 
100  static const MSLane* getLane(const std::string& id);
101 
102 private:
104  Lane();
105 
107  Lane(const Lane& src);
108 
110  Lane& operator=(const Lane& src);
111 };
112 }
113 
114 
115 #endif
116 
117 /****************************************************************************/
static double getCO2Emission(std::string laneID)
Definition: Lane.cpp:146
static double getLength(std::string laneID)
Definition: Lane.cpp:67
static double getNOxEmission(std::string laneID)
Definition: Lane.cpp:170
static void setAllowed(std::string laneID, std::vector< std::string > allowedClasses)
Definition: Lane.cpp:306
static std::vector< std::string > getFoes(const std::string &laneID, const std::string &toLaneID)
Definition: Lane.cpp:271
static std::vector< TraCIConnection > getLinks(std::string laneID)
Definition: Lane.cpp:85
static std::string getEdgeID(std::string laneID)
Definition: Lane.cpp:61
static void setParameter(const std::string &routeID, const std::string &key, const std::string &value)
Definition: Lane.cpp:342
static std::vector< std::string > getAllowed(std::string laneID)
Definition: Lane.cpp:109
static std::vector< std::string > getInternalFoes(const std::string &laneID)
Definition: Lane.cpp:287
static double getElectricityConsumption(std::string laneID)
Definition: Lane.cpp:187
static double getFuelConsumption(std::string laneID)
Definition: Lane.cpp:175
static int getIDCount()
Definition: Lane.cpp:55
static int getLastStepHaltingNumber(std::string laneID)
Definition: Lane.cpp:244
static double getWidth(std::string laneID)
Definition: Lane.cpp:140
static int getLastStepVehicleNumber(std::string laneID)
Definition: Lane.cpp:239
static double getMaxSpeed(std::string laneID)
Definition: Lane.cpp:73
static double getPMxEmission(std::string laneID)
Definition: Lane.cpp:164
static void subscribeContext(const std::string &objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector< int > &vars)
static double getLastStepLength(std::string laneID)
Definition: Lane.cpp:205
static double getHCEmission(std::string laneID)
Definition: Lane.cpp:158
static double getLastStepMeanSpeed(std::string laneID)
Definition: Lane.cpp:193
static TraCIPositionVector getShape(std::string laneID)
Definition: Lane.cpp:125
static void setMaxSpeed(std::string laneID, double speed)
Definition: Lane.cpp:322
static void setDisallowed(std::string laneID, std::vector< std::string > disallowedClasses)
Definition: Lane.cpp:314
Lane()
invalidated standard constructor
static const MSLane * getLane(const std::string &id)
Definition: Lane.cpp:349
Definition: Edge.cpp:31
static std::string getParameter(const std::string &laneID, const std::string &param)
Definition: Lane.cpp:336
Lane & operator=(const Lane &src)
invalidated assignment operator
static std::vector< std::string > getLastStepVehicleIDs(std::string laneID)
Definition: Lane.cpp:259
static double getWaitingTime(std::string laneID)
Definition: Lane.cpp:221
static double getTraveltime(std::string laneID)
Definition: Lane.cpp:227
static void setLength(std::string laneID, double length)
Definition: Lane.cpp:329
long long int SUMOTime
Definition: TraCIDefs.h:51
static void subscribe(const std::string &objID, SUMOTime beginTime, SUMOTime endTime, const std::vector< int > &vars)
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
A list of positions.
static double getNoiseEmission(std::string laneID)
Definition: Lane.cpp:181
static double getLastStepOccupancy(std::string laneID)
Definition: Lane.cpp:199
static std::vector< std::string > getDisallowed(std::string laneID)
Definition: Lane.cpp:119
static int getLinkNumber(std::string laneID)
Definition: Lane.cpp:79
static double getCOEmission(std::string laneID)
Definition: Lane.cpp:152
static std::vector< std::string > getIDList()
Definition: Lane.cpp:47