34 std::string name,
SVCPermissions svcPermissions,
double parkingLength,
const RGBColor color,
double givenStartPos) :
38 myOrigEdgeId(origEdgeId),
39 myPTStopLength(length),
41 myParkingLength(parkingLength),
43 myPermissions(svcPermissions),
47 myIsLoose(origEdgeId ==
""),
49 myIsMultipleStopPositions(false),
51 myGivenStartPos(givenStartPos) {
140 platformCand.reshiftPosition(offsetX, offsetY);
157const std::vector<NBPTPlatform>&
204 if (edge !=
nullptr) {
207 for (
const auto& it : edge->
getLanes()) {
219 offset *= edgeLength / shape.
length2D();
255 myAccesses.push_back(std::make_tuple(laneID, offset, length));
263 double bestDist = std::numeric_limits<double>::max();
264 NBEdge* bestEdge =
nullptr;
265 for (
NBEdge* cand : replacement) {
268 if (dist < bestDist) {
274 if (bestEdge !=
nullptr) {
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_ATTR_PARKING_LENGTH
@ SUMO_ATTR_COLOR
A color information.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Storage for edges, including some functionality operating on multiple edges.
NBEdge * getByID(const std::string &edgeID) const
Returns the edge with id if it exists.
The representation of a single edge during network building.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
const PositionVector & getGeometry() const
Returns the geometry of the edge.
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
const std::string & getID() const
std::string getLaneID(int lane) const
get lane ID
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
double getFinalLength() const
get length that will be assigned to the lanes in the final network
The representation of a single pt stop.
bool myIsMultipleStopPositions
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.
std::map< std::string, std::string > myAdditionalEdgeCandidates
void registerAdditionalEdge(std::string wayId, std::string edgeId)
const SVCPermissions myPermissions
bool findLaneAndComputeBusStopExtent(const NBEdgeCont &ec)
void addPlatformCand(NBPTPlatform platform)
void clearAccess()
remove all access definitions
std::vector< NBPTPlatform > myPlatformCands
std::vector< std::string > myLines
list of public transport lines (for displaying)
bool setEdgeId(std::string edgeId, const NBEdgeCont &ec)
std::string getID() const
void mirrorX()
mirror coordinates along the x-axis
bool getIsMultipleStopPositions() const
void addAccess(std::string laneID, double offset, double length)
void write(OutputDevice &device)
const std::vector< NBPTPlatform > & getPlatformCands()
std::vector< std::tuple< std::string, double, double > > myAccesses
laneId, lanePos, accessLength
void addLine(const std::string &line)
register line that services this stop (for displaying)
void reshiftPosition(const double offsetX, const double offsetY)
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
void setIsMultipleStopPositions(bool multipleStopPositions, long long int areaID)
SVCPermissions getPermissions() const
const std::string & getEdgeId() const
const double myParkingLength
const Position & getPosition() const
const std::string getOrigEdgeId() const
const std::string getName() const
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
A point in 2D or 3D with translation and scaling methods.
void add(const Position &pos)
Adds the given position to this one.
void mul(double val)
Multiplies position with the given value.
double length2D() const
Returns the length.
double distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector)
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
bool isValid() const
check if RGBColor is valid
static std::string getEdgeIDFromLane(const std::string laneID)
return edge id when given the lane ID
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.