SUMO - Simulation of Urban MObility
ROLane.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A single lane the router may use
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef ROLane_h
22 #define ROLane_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 <utils/common/Named.h>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class ROEdge;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
57 class ROLane : public Named {
58 public:
66  ROLane(const std::string& id, ROEdge* edge, SUMOReal length, SUMOReal maxSpeed, SVCPermissions permissions) :
67  Named(id), myEdge(edge), myLength(length), myMaxSpeed(maxSpeed), myPermissions(permissions) {
68  }
69 
70 
72  ~ROLane() { }
73 
74 
78  SUMOReal getLength() const {
79  return myLength;
80  }
81 
82 
86  SUMOReal getSpeed() const {
87  return myMaxSpeed;
88  }
89 
90 
94  inline SVCPermissions getPermissions() const {
95  return myPermissions;
96  }
97 
101  ROEdge& getEdge() const {
102  return *myEdge;
103  }
104 
106  const std::vector<const ROLane*>& getOutgoingLanes() const {
107  return myOutgoingLanes;
108  }
109 
110  void addOutgoingLane(ROLane* lane) {
111  myOutgoingLanes.push_back(lane);
112  }
113 
116  return LINKSTATE_MAJOR;
117  }
118 
119  inline bool allowsVehicleClass(SUMOVehicleClass vclass) const {
120  return (myPermissions & vclass) == vclass;
121  }
122 
123 private:
126 
129 
132 
135 
136  std::vector<const ROLane*> myOutgoingLanes;
137 
138 
139 private:
141  ROLane(const ROLane& src);
142 
144  ROLane& operator=(const ROLane& src);
145 
146 };
147 
148 
149 #endif
150 
151 /****************************************************************************/
152 
SUMOReal myMaxSpeed
The maximum speed allowed on the lane.
Definition: ROLane.h:131
A single lane the router may use.
Definition: ROLane.h:57
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
~ROLane()
Destructor.
Definition: ROLane.h:72
int SVCPermissions
ROLane(const std::string &id, ROEdge *edge, SUMOReal length, SUMOReal maxSpeed, SVCPermissions permissions)
Constructor.
Definition: ROLane.h:66
const std::vector< const ROLane * > & getOutgoingLanes() const
get the list of outgoing lanes
Definition: ROLane.h:106
SVCPermissions myPermissions
The encoding of allowed vehicle classes.
Definition: ROLane.h:134
ROEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: ROLane.h:101
std::vector< const ROLane * > myOutgoingLanes
Definition: ROLane.h:136
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:94
A basic edge for routing applications.
Definition: ROEdge.h:77
Base class for objects which have an id.
Definition: Named.h:46
void addOutgoingLane(ROLane *lane)
Definition: ROLane.h:110
SUMOReal getLength() const
Returns the length of the lane.
Definition: ROLane.h:78
SUMOReal myLength
The length of the lane.
Definition: ROLane.h:128
bool allowsVehicleClass(SUMOVehicleClass vclass) const
Definition: ROLane.h:119
SUMOReal getSpeed() const
Returns the maximum speed allowed on this lane.
Definition: ROLane.h:86
This is an uncontrolled, major link, may pass.
#define SUMOReal
Definition: config.h:213
ROEdge * myEdge
The parent edge of this lane.
Definition: ROLane.h:125
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane (ignored for routing) ...
Definition: ROLane.h:115
ROLane & operator=(const ROLane &src)
Invalidated assignment operator.