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-2020 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>
26 #include "NBPTPlatform.h"
27 
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class OutputDevice;
33 class NBEdgeCont;
34 class NBEdge;
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
44 class NBPTStop {
45 
46 public:
53  NBPTStop(std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, std::string name,
54  SVCPermissions svcPermissions, double parkingLength = 0);
55  std::string getID() const;
56 
57  const std::string getEdgeId() const;
58  const std::string getOrigEdgeId() const;
59  const std::string getName() const;
60  const Position& getPosition() const;
62  void write(OutputDevice& device);
63  void reshiftPosition(const double offsetX, const double offsetY);
64 
65  const std::vector<NBPTPlatform>& getPlatformCands();
66  bool getIsMultipleStopPositions() const;
67  void setIsMultipleStopPositions(bool multipleStopPositions);
68  double getLength() const;
69  bool setEdgeId(std::string edgeId, const NBEdgeCont& ec);
70  void registerAdditionalEdge(std::string wayId, std::string edgeId);
71  void addPlatformCand(NBPTPlatform platform);
73 
74  bool findLaneAndComputeBusStopExtent(const NBEdge* edge);
75 
76  void setMyPTStopId(std::string id);
77  void addAccess(std::string laneID, double offset, double length);
78 
80  void clearAccess();
81 
83  void addLine(const std::string& line);
84 
85  void setBidiStop(NBPTStop* bidiStop) {
86  myBidiStop = bidiStop;
87  }
88 
89  NBPTStop* getBidiStop() const {
90  return myBidiStop;
91  }
92 
93  bool isLoose() const {
94  return myIsLoose;
95  }
96 
97  double getEndPos() const {
98  return myEndPos;
99  }
100 
102  void mirrorX();
103 
104 private:
105  void computeExtent(double center, double d);
106 
107 private:
108  std::string myPTStopId;
110  std::string myEdgeId;
111  std::map<std::string, std::string> myAdditionalEdgeCandidates;
112 public:
113  const std::map<std::string, std::string>& getMyAdditionalEdgeCandidates() const;
114 private:
115  std::string myOrigEdgeId;
116 public:
117  void setMyOrigEdgeId(const std::string& myOrigEdgeId);
118 private:
120 public:
121  void setMyPTStopLength(double myPTStopLength);
122 private:
123  const std::string myName;
124  const double myParkingLength;
125  std::string myLaneId;
127 
128  double myStartPos;
129  double myEndPos;
130 
132  std::vector<std::tuple<std::string, double, double>> myAccesses;
133 
135  std::vector<std::string> myLines;
136 
138 
140  bool myIsLoose;
141 
142 private:
145 
146 
147  std::vector<NBPTPlatform> myPlatformCands;
149 };
150 
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:91
The representation of a single pt stop.
Definition: NBPTStop.h:44
bool myIsMultipleStopPositions
Definition: NBPTStop.h:148
std::map< std::string, std::string > myAdditionalEdgeCandidates
Definition: NBPTStop.h:111
double myStartPos
Definition: NBPTStop.h:128
void registerAdditionalEdge(std::string wayId, std::string edgeId)
Definition: NBPTStop.cpp:183
const SVCPermissions myPermissions
Definition: NBPTStop.h:126
NBPTStop & operator=(const NBPTStop &)
Invalidated assignment operator.
double myPTStopLength
Definition: NBPTStop.h:119
bool findLaneAndComputeBusStopExtent(const NBEdgeCont &ec)
Definition: NBPTStop.cpp:206
void addPlatformCand(NBPTPlatform platform)
Definition: NBPTStop.cpp:146
void clearAccess()
remove all access definitions
Definition: NBPTStop.cpp:242
std::string myLaneId
Definition: NBPTStop.h:125
NBPTStop * myBidiStop
Definition: NBPTStop.h:137
std::string myPTStopId
Definition: NBPTStop.h:108
std::vector< NBPTPlatform > myPlatformCands
Definition: NBPTStop.h:147
double getEndPos() const
Definition: NBPTStop.h:97
std::vector< std::string > myLines
list of public transport lines (for displaying)
Definition: NBPTStop.h:135
bool setEdgeId(std::string edgeId, const NBEdgeCont &ec)
Definition: NBPTStop.cpp:176
const std::string getEdgeId() const
Definition: NBPTStop.cpp:61
void computeExtent(double center, double d)
Definition: NBPTStop.cpp:83
std::string getID() const
Definition: NBPTStop.cpp:50
NBPTStop(std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, std::string name, SVCPermissions svcPermissions, double parkingLength=0)
Constructor.
Definition: NBPTStop.cpp:32
void mirrorX()
mirror coordinates along the x-axis
Definition: NBPTStop.cpp:78
bool getIsMultipleStopPositions() const
Definition: NBPTStop.cpp:158
void addAccess(std::string laneID, double offset, double length)
Definition: NBPTStop.cpp:247
void write(OutputDevice &device)
Definition: NBPTStop.cpp:99
const std::vector< NBPTPlatform > & getPlatformCands()
Definition: NBPTStop.cpp:152
const std::string myName
Definition: NBPTStop.h:123
std::vector< std::tuple< std::string, double, double > > myAccesses
laneId, lanePos, accessLength
Definition: NBPTStop.h:132
void setMyOrigEdgeId(const std::string &myOrigEdgeId)
Definition: NBPTStop.cpp:195
Position myPosition
Definition: NBPTStop.h:109
void addLine(const std::string &line)
register line that services this stop (for displaying)
Definition: NBPTStop.cpp:90
double getLength() const
Definition: NBPTStop.cpp:170
void reshiftPosition(const double offsetX, const double offsetY)
Definition: NBPTStop.cpp:131
double myEndPos
Definition: NBPTStop.h:129
void setBidiStop(NBPTStop *bidiStop)
Definition: NBPTStop.h:85
NBPTStop * getBidiStop() const
Definition: NBPTStop.h:89
void setMyPTStopLength(double myPTStopLength)
Definition: NBPTStop.cpp:201
SVCPermissions getPermissions() const
Definition: NBPTStop.cpp:140
const std::map< std::string, std::string > & getMyAdditionalEdgeCandidates() const
Definition: NBPTStop.cpp:189
bool myIsLoose
whether the stop was not part of the road network and must be mapped
Definition: NBPTStop.h:140
void setIsMultipleStopPositions(bool multipleStopPositions)
Definition: NBPTStop.cpp:164
const double myParkingLength
Definition: NBPTStop.h:124
void setMyPTStopId(std::string id)
Definition: NBPTStop.cpp:237
const Position & getPosition() const
Definition: NBPTStop.cpp:73
std::string myOrigEdgeId
Definition: NBPTStop.h:115
bool isLoose() const
Definition: NBPTStop.h:93
const std::string getOrigEdgeId() const
Definition: NBPTStop.cpp:55
const std::string getName() const
Definition: NBPTStop.cpp:67
std::string myEdgeId
Definition: NBPTStop.h:110
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36