Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NBPTStop.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 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 <memory>
24#include <string>
26#include <utils/geom/Position.h>
27#include "NBPTPlatform.h"
28
29
30// ===========================================================================
31// class declarations
32// ===========================================================================
33class OutputDevice;
34class NBEdgeCont;
35class NBEdge;
36
37
38// ===========================================================================
39// class definitions
40// ===========================================================================
45class NBPTStop : public Parameterised {
46
47public:
56 NBPTStop(SumoXMLTag tag, std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, std::string name,
57 SVCPermissions svcPermissions, double parkingLength = 0, const RGBColor color = RGBColor(false), double givenStartPos = -1);
58
60 virtual ~NBPTStop() {};
61
62 std::string getID() const;
63
65 return myTag;
66 }
67
68 const std::string& getEdgeId() const;
69
70 const std::string& getLaneId() const {
71 return myLaneId;
72 }
73
74 const std::string getOrigEdgeId() const;
75
76 const std::string getName() const;
77
78 const Position& getPosition() const;
79
81
82 long long int getAreaID() const {
83 return myAreaID;
84 }
85
86 void write(OutputDevice& device);
87
88 void reshiftPosition(const double offsetX, const double offsetY);
89
90 const std::vector<NBPTPlatform>& getPlatformCands();
91
92 bool getIsMultipleStopPositions() const;
93
94 void setIsMultipleStopPositions(bool multipleStopPositions, long long int areaID);
95
96 double getLength() const;
97
98 bool setEdgeId(std::string edgeId, const NBEdgeCont& ec);
99
100 void registerAdditionalEdge(std::string wayId, std::string edgeId);
101
102 void addPlatformCand(NBPTPlatform platform);
103
105
106 bool findLaneAndComputeBusStopExtent(const NBEdge* edge);
107
108 void setPTStopId(std::string id) {
109 myPTStopId = id;
110 }
111
112 bool wasLoaded() const {
113 return myGivenStartPos >= 0;
114 }
115
116 void resetLoaded() {
117 myGivenStartPos = -1;
118 }
119
121 myIsPlatform = true;
122 }
123
124 bool isPlatform() const {
125 return myIsPlatform;
126 }
127 void addAccess(std::string laneID, double offset, double length);
128
130 void clearAccess();
131
133 void addLine(const std::string& line);
134
135 void setBidiStop(std::shared_ptr<NBPTStop> bidiStop) {
136 myBidiStop = bidiStop;
137 }
138
139 std::shared_ptr<NBPTStop> getBidiStop() const {
140 return myBidiStop.lock();
141 }
142
143 bool isLoose() const {
144 return myIsLoose;
145 }
146
147 double getEndPos() const {
148 return myEndPos;
149 }
150
151 const std::vector<std::string>& getLines() const {
152 return myLines;
153 }
154
156 void mirrorX();
157
159 bool replaceEdge(const std::string& edgeID, const std::vector<NBEdge*>& replacement);
160
161 const std::map<std::string, std::string>& getAdditionalEdgeCandidates() const {
163 }
164 void setOrigEdgeId(const std::string& origEdgeId) {
165 myOrigEdgeId = origEdgeId;
166 }
167 void setPTStopLength(double ptStopLength) {
168 myPTStopLength = ptStopLength;
169 }
170
171private:
173 std::string myPTStopId;
175 std::string myEdgeId;
176 std::map<std::string, std::string> myAdditionalEdgeCandidates;
177 std::string myOrigEdgeId;
179 const std::string myName;
180 const double myParkingLength;
182 std::string myLaneId;
184
186 double myEndPos;
187
189 std::vector<std::tuple<std::string, double, double>> myAccesses;
190
192 std::vector<std::string> myLines;
193
194 std::weak_ptr<NBPTStop> myBidiStop;
195
198
201
202 std::vector<NBPTPlatform> myPlatformCands;
204 long long int myAreaID;
206
207private:
210
211};
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SumoXMLTag
Numbers representing SUMO-XML - element names.
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:45
bool myIsMultipleStopPositions
Definition NBPTStop.h:203
std::map< std::string, std::string > myAdditionalEdgeCandidates
Definition NBPTStop.h:176
double myStartPos
Definition NBPTStop.h:185
void registerAdditionalEdge(std::string wayId, std::string edgeId)
Definition NBPTStop.cpp:191
const SVCPermissions myPermissions
Definition NBPTStop.h:183
double myPTStopLength
Definition NBPTStop.h:178
const std::map< std::string, std::string > & getAdditionalEdgeCandidates() const
Definition NBPTStop.h:161
bool findLaneAndComputeBusStopExtent(const NBEdgeCont &ec)
Definition NBPTStop.cpp:197
void addPlatformCand(NBPTPlatform platform)
Definition NBPTStop.cpp:153
void clearAccess()
remove all access definitions
Definition NBPTStop.cpp:240
std::string myLaneId
Definition NBPTStop.h:182
void resetLoaded()
Definition NBPTStop.h:116
void setPTStopLength(double ptStopLength)
Definition NBPTStop.h:167
SumoXMLTag myTag
Definition NBPTStop.h:172
std::string myPTStopId
Definition NBPTStop.h:173
const std::string & getLaneId() const
Definition NBPTStop.h:70
double myGivenStartPos
Definition NBPTStop.h:205
std::vector< NBPTPlatform > myPlatformCands
Definition NBPTStop.h:202
const std::vector< std::string > & getLines() const
Definition NBPTStop.h:151
double getEndPos() const
Definition NBPTStop.h:147
std::vector< std::string > myLines
list of public transport lines (for displaying)
Definition NBPTStop.h:192
bool setEdgeId(std::string edgeId, const NBEdgeCont &ec)
Definition NBPTStop.cpp:184
bool wasLoaded() const
Definition NBPTStop.h:112
void setOrigEdgeId(const std::string &origEdgeId)
Definition NBPTStop.h:164
std::string getID() const
Definition NBPTStop.cpp:57
std::shared_ptr< NBPTStop > getBidiStop() const
Definition NBPTStop.h:139
void mirrorX()
mirror coordinates along the x-axis
Definition NBPTStop.cpp:87
std::weak_ptr< NBPTStop > myBidiStop
Definition NBPTStop.h:194
bool getIsMultipleStopPositions() const
Definition NBPTStop.cpp:165
void addAccess(std::string laneID, double offset, double length)
Definition NBPTStop.cpp:246
void write(OutputDevice &device)
Definition NBPTStop.cpp:102
virtual ~NBPTStop()
Destructor.
Definition NBPTStop.h:60
const std::vector< NBPTPlatform > & getPlatformCands()
Definition NBPTStop.cpp:159
const std::string myName
Definition NBPTStop.h:179
void setPTStopId(std::string id)
Definition NBPTStop.h:108
bool isPlatform() const
Definition NBPTStop.h:124
long long int getAreaID() const
Definition NBPTStop.h:82
NBPTStop & operator=(const NBPTStop &)
Invalidated assignment operator.
std::vector< std::tuple< std::string, double, double > > myAccesses
laneId, lanePos, accessLength
Definition NBPTStop.h:189
void setIsPlatform()
Definition NBPTStop.h:120
Position myPosition
Definition NBPTStop.h:174
void addLine(const std::string &line)
register line that services this stop (for displaying)
Definition NBPTStop.cpp:93
SumoXMLTag getElement() const
Definition NBPTStop.h:64
double getLength() const
Definition NBPTStop.cpp:178
void setBidiStop(std::shared_ptr< NBPTStop > bidiStop)
Definition NBPTStop.h:135
void reshiftPosition(const double offsetX, const double offsetY)
Definition NBPTStop.cpp:138
double myEndPos
Definition NBPTStop.h:186
bool replaceEdge(const std::string &edgeID, const std::vector< NBEdge * > &replacement)
replace the stop edge with the closest edge on the given edge list in all stops
Definition NBPTStop.cpp:261
void setIsMultipleStopPositions(bool multipleStopPositions, long long int areaID)
Definition NBPTStop.cpp:171
SVCPermissions getPermissions() const
Definition NBPTStop.cpp:147
const std::string & getEdgeId() const
Definition NBPTStop.cpp:69
bool myIsLoose
whether the stop was not part of the road network and must be mapped
Definition NBPTStop.h:197
const double myParkingLength
Definition NBPTStop.h:180
const Position & getPosition() const
Definition NBPTStop.cpp:81
const RGBColor myColor
Definition NBPTStop.h:181
std::string myOrigEdgeId
Definition NBPTStop.h:177
bool isLoose() const
Definition NBPTStop.h:143
long long int myAreaID
Definition NBPTStop.h:204
const std::string getOrigEdgeId() const
Definition NBPTStop.cpp:63
const std::string getName() const
Definition NBPTStop.cpp:75
std::string myEdgeId
Definition NBPTStop.h:175
bool myIsPlatform
whether this stop was build from a platform position
Definition NBPTStop.h:200
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37