SUMO - Simulation of Urban MObility
ROLane.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-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 /****************************************************************************/
18 // A single lane the router may use
19 /****************************************************************************/
20 #ifndef ROLane_h
21 #define ROLane_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <vector>
34 #include <utils/common/Named.h>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class ROEdge;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
56 class ROLane : public Named {
57 public:
65  ROLane(const std::string& id, ROEdge* edge, double length, double maxSpeed, SVCPermissions permissions) :
66  Named(id), myEdge(edge), myLength(length), myMaxSpeed(maxSpeed), myPermissions(permissions) {
67  }
68 
69 
71  ~ROLane() { }
72 
73 
77  double getLength() const {
78  return myLength;
79  }
80 
81 
85  double getSpeed() const {
86  return myMaxSpeed;
87  }
88 
89 
93  inline SVCPermissions getPermissions() const {
94  return myPermissions;
95  }
96 
100  ROEdge& getEdge() const {
101  return *myEdge;
102  }
103 
105  const std::vector<const ROLane*>& getOutgoingLanes() const {
106  return myOutgoingLanes;
107  }
108 
109  void addOutgoingLane(ROLane* lane) {
110  myOutgoingLanes.push_back(lane);
111  }
112 
115  return LINKSTATE_MAJOR;
116  }
117 
118  inline bool allowsVehicleClass(SUMOVehicleClass vclass) const {
119  return (myPermissions & vclass) == vclass;
120  }
121 
122 private:
125 
127  double myLength;
128 
130  double myMaxSpeed;
131 
134 
135  std::vector<const ROLane*> myOutgoingLanes;
136 
137 
138 private:
140  ROLane(const ROLane& src);
141 
143  ROLane& operator=(const ROLane& src);
144 
145 };
146 
147 
148 #endif
149 
150 /****************************************************************************/
151 
double myMaxSpeed
The maximum speed allowed on the lane.
Definition: ROLane.h:130
A single lane the router may use.
Definition: ROLane.h:56
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
double getLength() const
Returns the length of the lane.
Definition: ROLane.h:77
~ROLane()
Destructor.
Definition: ROLane.h:71
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
ROLane(const std::string &id, ROEdge *edge, double length, double maxSpeed, SVCPermissions permissions)
Constructor.
Definition: ROLane.h:65
const std::vector< const ROLane * > & getOutgoingLanes() const
get the list of outgoing lanes
Definition: ROLane.h:105
SVCPermissions myPermissions
The encoding of allowed vehicle classes.
Definition: ROLane.h:133
ROEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: ROLane.h:100
double myLength
The length of the lane.
Definition: ROLane.h:127
std::vector< const ROLane * > myOutgoingLanes
Definition: ROLane.h:135
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
SVCPermissions getPermissions() const
Returns the list of allowed vehicle classes.
Definition: ROLane.h:93
A basic edge for routing applications.
Definition: ROEdge.h:77
Base class for objects which have an id.
Definition: Named.h:54
void addOutgoingLane(ROLane *lane)
Definition: ROLane.h:109
double getSpeed() const
Returns the maximum speed allowed on this lane.
Definition: ROLane.h:85
bool allowsVehicleClass(SUMOVehicleClass vclass) const
Definition: ROLane.h:118
This is an uncontrolled, major link, may pass.
ROEdge * myEdge
The parent edge of this lane.
Definition: ROLane.h:124
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane (ignored for routing) ...
Definition: ROLane.h:114
ROLane & operator=(const ROLane &src)
Invalidated assignment operator.