Eclipse SUMO - Simulation of Urban MObility
NBPTStop.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-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// The representation of a single pt stop
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <string>
24#include <utils/geom/Position.h>
27#include "NBCont.h"
28#include "NBPTPlatform.h"
29
30
31// ===========================================================================
32// class declarations
33// ===========================================================================
34class OutputDevice;
35class NBEdgeCont;
36class NBEdge;
37
38
39// ===========================================================================
40// class definitions
41// ===========================================================================
46class NBPTStop : public Parameterised {
47
48public:
57 NBPTStop(std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, std::string name,
58 SVCPermissions svcPermissions, double parkingLength = 0, const RGBColor color = RGBColor(false), double givenStartPos = -1);
59
61 virtual ~NBPTStop() {};
62
63 std::string getID() const;
64
65 const std::string& getEdgeId() const;
66
67 const std::string& getLaneId() const {
68 return myLaneId;
69 }
70
71 const std::string getOrigEdgeId() const;
72
73 const std::string getName() const;
74
75 const Position& getPosition() const;
76
78
79 long long int getAreaID() const {
80 return myAreaID;
81 }
82
83 void write(OutputDevice& device);
84
85 void reshiftPosition(const double offsetX, const double offsetY);
86
87 const std::vector<NBPTPlatform>& getPlatformCands();
88
89 bool getIsMultipleStopPositions() const;
90
91 void setIsMultipleStopPositions(bool multipleStopPositions, long long int areaID);
92
93 double getLength() const;
94
95 bool setEdgeId(std::string edgeId, const NBEdgeCont& ec);
96
97 void registerAdditionalEdge(std::string wayId, std::string edgeId);
98
99 void addPlatformCand(NBPTPlatform platform);
100
102
103 bool findLaneAndComputeBusStopExtent(const NBEdge* edge);
104
105 void setPTStopId(std::string id) {
106 myPTStopId = id;
107 }
108
110 myIsPlatform = true;
111 }
112
113 bool isPlatform() const {
114 return myIsPlatform;
115 }
116 void addAccess(std::string laneID, double offset, double length);
117
119 void clearAccess();
120
122 void addLine(const std::string& line);
123
124 void setBidiStop(NBPTStop* bidiStop) {
125 myBidiStop = bidiStop;
126 }
127
129 return myBidiStop;
130 }
131
132 bool isLoose() const {
133 return myIsLoose;
134 }
135
136 double getEndPos() const {
137 return myEndPos;
138 }
139
140 const std::vector<std::string>& getLines() const {
141 return myLines;
142 }
143
145 void mirrorX();
146
148 bool replaceEdge(const std::string& edgeID, const EdgeVector& replacement);
149
150 const std::map<std::string, std::string>& getAdditionalEdgeCandidates() const {
152 }
153 void setOrigEdgeId(const std::string& origEdgeId) {
154 myOrigEdgeId = origEdgeId;
155 }
156 void setPTStopLength(double ptStopLength) {
157 myPTStopLength = ptStopLength;
158 }
159
160private:
161 std::string myPTStopId;
163 std::string myEdgeId;
164 std::map<std::string, std::string> myAdditionalEdgeCandidates;
165 std::string myOrigEdgeId;
167 const std::string myName;
168 const double myParkingLength;
170 std::string myLaneId;
172
174 double myEndPos;
175
177 std::vector<std::tuple<std::string, double, double>> myAccesses;
178
180 std::vector<std::string> myLines;
181
183
186
189
190 std::vector<NBPTPlatform> myPlatformCands;
192 long long int myAreaID;
194
195private:
198
199};
200
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:42
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
The representation of a single edge during network building.
Definition: NBEdge.h:92
The representation of a single pt stop.
Definition: NBPTStop.h:46
bool myIsMultipleStopPositions
Definition: NBPTStop.h:191
NBPTStop(std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, std::string name, SVCPermissions svcPermissions, double parkingLength=0, const RGBColor color=RGBColor(false), double givenStartPos=-1)
Constructor.
Definition: NBPTStop.cpp:32
std::map< std::string, std::string > myAdditionalEdgeCandidates
Definition: NBPTStop.h:164
double myStartPos
Definition: NBPTStop.h:173
void registerAdditionalEdge(std::string wayId, std::string edgeId)
Definition: NBPTStop.cpp:189
const SVCPermissions myPermissions
Definition: NBPTStop.h:171
double myPTStopLength
Definition: NBPTStop.h:166
const std::map< std::string, std::string > & getAdditionalEdgeCandidates() const
Definition: NBPTStop.h:150
bool findLaneAndComputeBusStopExtent(const NBEdgeCont &ec)
Definition: NBPTStop.cpp:195
void addPlatformCand(NBPTPlatform platform)
Definition: NBPTStop.cpp:151
void clearAccess()
remove all access definitions
Definition: NBPTStop.cpp:238
std::string myLaneId
Definition: NBPTStop.h:170
NBPTStop * myBidiStop
Definition: NBPTStop.h:182
void setPTStopLength(double ptStopLength)
Definition: NBPTStop.h:156
std::string myPTStopId
Definition: NBPTStop.h:161
const std::string & getLaneId() const
Definition: NBPTStop.h:67
double myGivenStartPos
Definition: NBPTStop.h:193
std::vector< NBPTPlatform > myPlatformCands
Definition: NBPTStop.h:190
const std::vector< std::string > & getLines() const
Definition: NBPTStop.h:140
double getEndPos() const
Definition: NBPTStop.h:136
std::vector< std::string > myLines
list of public transport lines (for displaying)
Definition: NBPTStop.h:180
bool setEdgeId(std::string edgeId, const NBEdgeCont &ec)
Definition: NBPTStop.cpp:182
bool replaceEdge(const std::string &edgeID, const EdgeVector &replacement)
replace the stop edge with the closest edge on the given edge list in all stops
Definition: NBPTStop.cpp:259
void setOrigEdgeId(const std::string &origEdgeId)
Definition: NBPTStop.h:153
std::string getID() const
Definition: NBPTStop.cpp:55
void mirrorX()
mirror coordinates along the x-axis
Definition: NBPTStop.cpp:85
bool getIsMultipleStopPositions() const
Definition: NBPTStop.cpp:163
void addAccess(std::string laneID, double offset, double length)
Definition: NBPTStop.cpp:244
void write(OutputDevice &device)
Definition: NBPTStop.cpp:100
virtual ~NBPTStop()
Destructor.
Definition: NBPTStop.h:61
const std::vector< NBPTPlatform > & getPlatformCands()
Definition: NBPTStop.cpp:157
const std::string myName
Definition: NBPTStop.h:167
void setPTStopId(std::string id)
Definition: NBPTStop.h:105
bool isPlatform() const
Definition: NBPTStop.h:113
long long int getAreaID() const
Definition: NBPTStop.h:79
NBPTStop & operator=(const NBPTStop &)
Invalidated assignment operator.
std::vector< std::tuple< std::string, double, double > > myAccesses
laneId, lanePos, accessLength
Definition: NBPTStop.h:177
void setIsPlatform()
Definition: NBPTStop.h:109
Position myPosition
Definition: NBPTStop.h:162
void addLine(const std::string &line)
register line that services this stop (for displaying)
Definition: NBPTStop.cpp:91
double getLength() const
Definition: NBPTStop.cpp:176
void reshiftPosition(const double offsetX, const double offsetY)
Definition: NBPTStop.cpp:136
double myEndPos
Definition: NBPTStop.h:174
void setBidiStop(NBPTStop *bidiStop)
Definition: NBPTStop.h:124
void setIsMultipleStopPositions(bool multipleStopPositions, long long int areaID)
Definition: NBPTStop.cpp:169
SVCPermissions getPermissions() const
Definition: NBPTStop.cpp:145
const std::string & getEdgeId() const
Definition: NBPTStop.cpp:67
bool myIsLoose
whether the stop was not part of the road network and must be mapped
Definition: NBPTStop.h:185
const double myParkingLength
Definition: NBPTStop.h:168
const Position & getPosition() const
Definition: NBPTStop.cpp:79
const RGBColor myColor
Definition: NBPTStop.h:169
NBPTStop * getBidiStop() const
Definition: NBPTStop.h:128
std::string myOrigEdgeId
Definition: NBPTStop.h:165
bool isLoose() const
Definition: NBPTStop.h:132
long long int myAreaID
Definition: NBPTStop.h:192
const std::string getOrigEdgeId() const
Definition: NBPTStop.cpp:61
const std::string getName() const
Definition: NBPTStop.cpp:73
std::string myEdgeId
Definition: NBPTStop.h:163
bool myIsPlatform
whether this stop was build from a platform position
Definition: NBPTStop.h:188
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37