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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A single lane the router may use
17 /****************************************************************************/
18 #ifndef ROLane_h
19 #define ROLane_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <vector>
28 #include <utils/common/Named.h>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class ROEdge;
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
50 class ROLane : public Named {
51 public:
59  ROLane(const std::string& id, ROEdge* edge, double length, double maxSpeed, SVCPermissions permissions) :
60  Named(id), myEdge(edge), myLength(length), myMaxSpeed(maxSpeed), myPermissions(permissions) {
61  }
62 
63 
65  ~ROLane() { }
66 
67 
71  double getLength() const {
72  return myLength;
73  }
74 
75 
79  double getSpeed() const {
80  return myMaxSpeed;
81  }
82 
83 
87  inline SVCPermissions getPermissions() const {
88  return myPermissions;
89  }
90 
94  ROEdge& getEdge() const {
95  return *myEdge;
96  }
97 
99  const std::vector<std::pair<const ROLane*, const ROEdge*> >& getOutgoingViaLanes() const {
100  return myOutgoingLanes;
101  }
102 
103  void addOutgoingLane(ROLane* lane, ROEdge* via = nullptr) {
104  myOutgoingLanes.push_back(std::make_pair(lane, via));
105  }
106 
109  return LINKSTATE_MAJOR;
110  }
111 
112  inline bool allowsVehicleClass(SUMOVehicleClass vclass) const {
113  return (myPermissions & vclass) == vclass;
114  }
115 
116 private:
119 
121  double myLength;
122 
124  double myMaxSpeed;
125 
128 
129  std::vector<std::pair<const ROLane*, const ROEdge*> > myOutgoingLanes;
130 
131 
132 private:
134  ROLane(const ROLane& src);
135 
137  ROLane& operator=(const ROLane& src);
138 
139 };
140 
141 
142 #endif
143 
144 /****************************************************************************/
145 
double myMaxSpeed
The maximum speed allowed on the lane.
Definition: ROLane.h:124
A single lane the router may use.
Definition: ROLane.h:50
std::vector< std::pair< const ROLane *, const ROEdge * > > myOutgoingLanes
Definition: ROLane.h:129
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:71
~ROLane()
Destructor.
Definition: ROLane.h:65
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:59
SVCPermissions myPermissions
The encoding of allowed vehicle classes.
Definition: ROLane.h:127
ROEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: ROLane.h:94
double myLength
The length of the lane.
Definition: ROLane.h:121
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:87
const std::vector< std::pair< const ROLane *, const ROEdge * > > & getOutgoingViaLanes() const
get the map of outgoing lanes to via edges
Definition: ROLane.h:99
A basic edge for routing applications.
Definition: ROEdge.h:72
Base class for objects which have an id.
Definition: Named.h:58
double getSpeed() const
Returns the maximum speed allowed on this lane.
Definition: ROLane.h:79
bool allowsVehicleClass(SUMOVehicleClass vclass) const
Definition: ROLane.h:112
void addOutgoingLane(ROLane *lane, ROEdge *via=nullptr)
Definition: ROLane.h:103
This is an uncontrolled, major link, may pass.
ROEdge * myEdge
The parent edge of this lane.
Definition: ROLane.h:118
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane (ignored for routing) ...
Definition: ROLane.h:108
ROLane & operator=(const ROLane &src)
Invalidated assignment operator.