Eclipse SUMO - Simulation of Urban MObility
NBPTStopCont.cpp
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// Container for pt stops during the netbuilding process
19/****************************************************************************/
20
21
23#include <utils/geom/Boundary.h>
25#include <microsim/MSLane.h>
26#include "NBPTStopCont.h"
27#include "NBEdgeCont.h"
28#include "NBEdge.h"
29#include "NBNode.h"
30#include <utils/geom/Position.h>
31
32// ===========================================================================
33// static members
34// ===========================================================================
35std::set<std::string> NBPTStopCont::myIgnoredStops;
36
37// ===========================================================================
38// method definitions
39// ===========================================================================
40
41
43 for (auto& myPTStop : myPTStops) {
44 delete myPTStop.second;
45 }
46 myPTStops.clear();
47}
48
49
50bool
51NBPTStopCont::insert(NBPTStop* ptStop, bool floating) {
52 std::string id = ptStop->getID();
53 auto i = myPTStops.find(id);
54 if (i != myPTStops.end()) {
55 return false;
56 }
57 myPTStops[id] = ptStop;
58 if (floating) {
59 myFloatingStops.push_back(ptStop);
60 }
61 return true;
62}
63
64
66NBPTStopCont::get(std::string id) const {
67 if (myPTStops.find(id) != myPTStops.end()) {
68 return myPTStops.find(id)->second;
69 }
70 return nullptr;
71}
72
73
74void
76 std::vector<NBPTStop*> reverseStops;
77 //first pass localize pt stop at correct side of the street; create stop for opposite side if needed
78 for (const auto& ptStopIt : myPTStops) {
79 NBPTStop* const stop = ptStopIt.second;
80 bool multipleStopPositions = stop->getIsMultipleStopPositions();
81 bool platformsDefined = !stop->getPlatformCands().empty();
82 if (!platformsDefined) {
83 //create pt stop for reverse edge if edge exists
84 NBPTStop* reverseStop = getReverseStop(stop, cont);
85 if (reverseStop != nullptr) {
86 reverseStops.push_back(reverseStop);
87 }
88 } else if (multipleStopPositions) {
89 //create pt stop for closest platform at corresponding edge
91
92 } else {
93 //create pt stop for each side of the street where a platform is defined (create additional pt stop as needed)
94 NBPTStop* additionalStop = assignAndCreatNewPTStopAsNeeded(stop, cont);
95 if (additionalStop != nullptr) {
96 reverseStops.push_back(additionalStop);
97 }
98 }
99 }
100 //insert new stops if any
101 for (NBPTStop* const reverseStop : reverseStops) {
102 insert(reverseStop);
103 }
104}
105
106
107void
109 //scnd pass set correct lane
110 for (auto i = myPTStops.begin(); i != myPTStops.end();) {
111 NBPTStop* stop = i->second;
112 if (!stop->findLaneAndComputeBusStopExtent(cont)) {
113 WRITE_WARNINGF(TL("Could not find corresponding edge or compatible lane for pt stop '%' (%). Thus, it will be removed!"),
114 i->first, i->second->getName());
115 //EdgeVector edgeVector = cont.getGeneratedFrom((*i).second->getOrigEdgeId());
116 //std::cout << edgeVector.size() << std::endl;
117 myPTStops.erase(i++);
118 } else {
119 i++;
120 }
121 }
122}
123
124
125int
127 //scnd pass set correct lane
128 int existingBidiStops = 0;
129 std::vector<NBPTStop*> toAdd;
130 for (auto i = myPTStops.begin(); i != myPTStops.end(); i++) {
131 NBPTStop* stop = i->second;
132 NBEdge* edge = ec.getByID(stop->getEdgeId());
133 if (edge != nullptr && edge->isBidiRail()) {
134 NBEdge* bidiEdge = edge->getTurnDestination(true);
135 assert(bidiEdge != 0);
136 const std::string id = getReverseID(stop->getID());
137 if (myPTStops.count(id) > 0) {
138 if (myPTStops[id]->getEdgeId() != bidiEdge->getID()) {
139 WRITE_WARNINGF(TL("Could not create reverse-direction stop for superposed edge '%' (origStop '%'). Stop id '%' already in use by stop on edge '%'."),
140 bidiEdge->getID(), i->first, id, myPTStops[id]->getEdgeId());
141 }
142 continue;
143 }
144 NBPTStop* bidiStop = new NBPTStop(id,
145 stop->getPosition(),
146 bidiEdge->getID(),
147 stop->getOrigEdgeId(),
148 stop->getLength(),
149 stop->getName(),
150 stop->getPermissions());
151 if (bidiStop->findLaneAndComputeBusStopExtent(ec)) {
152 toAdd.push_back(bidiStop);
153 stop->setBidiStop(bidiStop);
154 bidiStop->setBidiStop(stop);
155 } else {
156 // should not happen
157 assert(false);
158 }
159 } else if (edge != nullptr) {
160 NBEdge* bidiEdge = edge->getTurnDestination(true);
161 if (bidiEdge != nullptr) {
162 const std::string id = getReverseID(stop->getID());
163 if (myPTStops.count(id) > 0) {
164 existingBidiStops++;
165 }
166 }
167 }
168 }
169 for (NBPTStop* newStop : toAdd) {
170 myPTStops[newStop->getID()] = newStop;
171 }
172 if (toAdd.size() > 0) {
173 WRITE_MESSAGE("Added " + toString(toAdd.size()) + " stops for superposed rail edges.");
174 }
175 return (int)toAdd.size() + existingBidiStops;
176}
177
178
181 std::string edgeId = pStop->getEdgeId();
182 NBEdge* edge = ec.getByID(edgeId);
183 NBEdge* reverse = NBPTStopCont::getReverseEdge(edge);
184 if (reverse != nullptr) {
185 const std::string reverseID = getReverseID(pStop->getID());
186 if (myPTStops.count(reverseID) == 0) {
187 return new NBPTStop(reverseID, pStop->getPosition(), reverse->getID(), reverse->getID(),
188 pStop->getLength(), pStop->getName(), pStop->getPermissions());
189 } else {
190 return myPTStops[reverseID];
191 }
192 }
193 return nullptr;
194}
195
196
199 std::string edgeId = pStop->getEdgeId();
200 NBEdge* edge = cont.getByID(edgeId);
201 if (edge == nullptr) {
202 return nullptr;
203 }
204 bool rightOfEdge = false;
205 bool leftOfEdge = false;
206 const NBPTPlatform* left = nullptr;
207 for (const NBPTPlatform& platform : pStop->getPlatformCands()) {
208 double crossProd = computeCrossProductEdgePosition(edge, platform.getPos());
209 //TODO consider driving on the left!!! [GL May '17]
210 if (crossProd > 0) {
211 leftOfEdge = true;
212 left = &platform;
213 } else {
214 rightOfEdge = true;
215 pStop->setPTStopLength(platform.getLength());
216 }
217 }
218
219 if (leftOfEdge && rightOfEdge) {
220 NBPTStop* leftStop = getReverseStop(pStop, cont);
221 if (leftStop) {
222 leftStop->setPTStopLength(left->getLength());
223 }
224 return leftStop;
225 } else if (leftOfEdge) {
226 NBEdge* reverse = getReverseEdge(edge);
227 if (reverse != nullptr) {
228 pStop->setEdgeId(reverse->getID(), cont);
229 pStop->setPTStopLength(left->getLength());
230 }
231 }
232
233 return nullptr;
234}
235
236
237void
239 std::string edgeId = pStop->getEdgeId();
240 NBEdge* edge = cont.getByID(edgeId);
241 NBEdge* reverse = NBPTStopCont::getReverseEdge(edge);
242 const NBPTPlatform* closestPlatform = getClosestPlatformToPTStopPosition(pStop);
243 pStop->setPTStopLength(closestPlatform->getLength());
244 if (reverse != nullptr) {
245
246 //TODO make isLeft in PositionVector static [GL May '17]
247// if (PositionVector::isLeft(edge->getFromNode()->getPosition(),edge->getToNode()->getPosition(),closestPlatform)){
248//
249// }
250 double crossProd = computeCrossProductEdgePosition(edge, closestPlatform->getPos());
251
252 //TODO consider driving on the left!!! [GL May '17]
253 if (crossProd > 0) { //pt stop is on the left of the orig edge
254 pStop->setEdgeId(reverse->getID(), cont);
255 }
256 }
257}
258
259
260double
261NBPTStopCont::computeCrossProductEdgePosition(const NBEdge* edge, const Position& closestPlatform) const {
262 PositionVector geom = edge->getGeometry();
263 int idxTmp = geom.indexOfClosest(closestPlatform);
264 double offset = geom.nearest_offset_to_point2D(closestPlatform, true);
265 double offset2 = geom.offsetAtIndex2D(idxTmp);
266 int idx1, idx2;
267 if (offset2 < offset) {
268 idx1 = idxTmp;
269 idx2 = idx1 + 1;
270 } else {
271 idx2 = idxTmp;
272 idx1 = idxTmp - 1;
273 }
274 if (idx1 < 0 || idx1 >= (int) geom.size() || idx2 < 0 || idx2 >= (int) geom.size()) {
275 WRITE_WARNINGF(TL("Could not determine cross product for edge '%'."), edge->getID());
276 return 0;
277 }
278 Position p1 = geom[idx1];
279 Position p2 = geom[idx2];
280
281 double x0 = p1.x();
282 double y0 = p1.y();
283 double x1 = p2.x();
284 double y1 = p2.y();
285 double x2 = closestPlatform.x();
286 double y2 = closestPlatform.y();
287 double crossProd = (x1 - x0) * (y2 - y0) - (y1 - y0) * (x2 - x0);
288 return crossProd;
289}
290
291
292const NBPTPlatform*
294 Position stopPosition = pStop->getPosition();
295 const NBPTPlatform* closest = nullptr;
296 double minSqrDist = std::numeric_limits<double>::max();
297 for (const NBPTPlatform& platform : pStop->getPlatformCands()) {
298 double sqrDist = stopPosition.distanceSquaredTo2D(platform.getPos());
299 if (sqrDist < minSqrDist) {
300 minSqrDist = sqrDist;
301 closest = &platform;
302 }
303 }
304 return closest;
305}
306
307//static functions
308
309NBEdge*
311 if (edge != nullptr) {
312 for (auto it = edge->getToNode()->getOutgoingEdges().begin();
313 it != edge->getToNode()->getOutgoingEdges().end();
314 it++) {
315 if ((*it)->getToNode() == edge->getFromNode()) {
316 return (*it);
317 }
318 }
319 }
320 return nullptr;
321}
322
323
324int
326 int numDeleted = 0;
327 for (auto i = myPTStops.begin(); i != myPTStops.end();) {
328 if (cont.getByID(i->second->getEdgeId()) == nullptr) {
329 WRITE_WARNINGF(TL("Removing pt stop '%' on non existing edge '%'."), i->first, i->second->getEdgeId());
330 i = myPTStops.erase(i);
331 numDeleted++;
332 } else {
333 i++;
334 }
335 }
336 return numDeleted;
337}
338
339
340void
341NBPTStopCont::addEdges2Keep(const OptionsCont& /* oc */, std::set<std::string>& into) {
342 for (auto stop : myPTStops) {
343 into.insert(stop.second->getEdgeId());
344 }
345}
346
347
348void
349NBPTStopCont::replaceEdge(const std::string& edgeID, const EdgeVector& replacement) {
350 if (myPTStops.size() > 0 && myPTStopLookup.size() == 0) {
351 // init lookup once
352 for (auto& item : myPTStops) {
353 myPTStopLookup[item.second->getEdgeId()].push_back(item.second);
354 }
355 }
356 // make a copy because the vector gets modified
357 const std::vector<NBPTStop*> stops = myPTStopLookup[edgeID];
358 for (NBPTStop* stop : stops) {
359 if (!stop->replaceEdge(edgeID, replacement)) {
360 WRITE_WARNINGF(TL("Could not re-assign pt stop '%' after replacing edge '%'."), stop->getID(), edgeID);
361 } else {
362 myPTStopLookup[stop->getEdgeId()].push_back(stop);
363 }
364 }
365 myPTStopLookup.erase(edgeID);
366}
367
368
369void
370NBPTStopCont::postprocess(std::set<std::string>& usedStops) {
371 for (auto i = myPTStops.begin(); i != myPTStops.end();) {
372 if (usedStops.find(i->second->getID()) == usedStops.end()) {
373 myPTStops.erase(i++);
374 } else {
375 i++;
376 }
377 }
378}
379
380std::string
381NBPTStopCont::getReverseID(const std::string& id) {
382 return id.size() > 0 && id[0] == '-' ? id.substr(1) : "-" + id;
383}
384
385void
387 PTStopsCont stops = myPTStops;
388 for (auto& i : stops) {
389 NBPTStop* s = i.second;
390 const std::string& stopId = s->getID();
391 if (s->getEdgeId() == "") {
392 continue;
393 }
394 const char edgeSign = s->getEdgeId().at(0);
395 const char stopSign = stopId.at(0);
396 if (edgeSign != stopSign && (edgeSign == '-' || stopSign == '-')) {
397 const std::string reverseID = getReverseID(stopId);
398 NBPTStop* rs = get(reverseID);
399 s->setPTStopId(reverseID);
400 myPTStops.erase(stopId);
401 myPTStops[reverseID] = s;
402 if (rs != nullptr) {
403 rs->setPTStopId(stopId);
404 myPTStops[stopId] = rs;
405 }
406 }
407 }
408}
409
410void
412 NamedRTree r;
414 for (const auto& item : cont) {
415 NBEdge* edge = item.second;
416 if ((edge->getPermissions() & publicPermissions) == 0) {
417 continue;
418 }
419 const Boundary& bound = edge->getGeometry().getBoxBoundary();
420 float min[2] = { static_cast<float>(bound.xmin()), static_cast<float>(bound.ymin()) };
421 float max[2] = { static_cast<float>(bound.xmax()), static_cast<float>(bound.ymax()) };
422 r.Insert(min, max, edge);
423 }
424 for (NBPTStop* ptStop : myFloatingStops) {
425 std::set<const Named*> edges;
426 Named::StoringVisitor visitor(edges);
427 const Position& pos = ptStop->getPosition();
428 float min[2] = {static_cast<float>(pos.x() - maxRadius), static_cast<float>(pos.y() - maxRadius)};
429 float max[2] = {static_cast<float>(pos.x() + maxRadius), static_cast<float>(pos.y() + maxRadius)};
430 r.Search(min, max, visitor);
431 std::vector<NBEdge*> nearby;
432 for (const Named* namedEdge : edges) {
433 NBEdge* e = const_cast<NBEdge*>(dynamic_cast<const NBEdge*>(namedEdge));
434 if ((e->getPermissions() & ptStop->getPermissions()) != 0) {
435 nearby.push_back(e);
436 }
437 }
438 std::sort(nearby.begin(), nearby.end(), [pos](NBEdge * a, NBEdge * b) {
439 return a->getLaneShape(0).distance2D(pos, false) < b->getLaneShape(0).distance2D(pos, false);
440 });
441
442 for (NBEdge* e : nearby) {
443 ptStop->setEdgeId(e->getID(), cont);
444 if (ptStop->getLaneId() != "") {
445 break;
446 }
447 }
448 if (ptStop->getLaneId() == "") {
449 WRITE_WARNINGF(TL("Could not find corresponding edge or compatible lane for free-floating pt stop '%' (%). Thus, it will be removed!"),
450 ptStop->getID(), ptStop->getName());
451 myPTStops.erase(ptStop->getID());
452 }
453 }
454}
455
456void
457NBPTStopCont::findAccessEdgesForRailStops(NBEdgeCont& cont, double maxRadius, int maxCount, double accessFactor) {
458 NamedRTree r;
459 for (auto edge : cont) {
460 const Boundary& bound = edge.second->getGeometry().getBoxBoundary();
461 float min[2] = { static_cast<float>(bound.xmin()), static_cast<float>(bound.ymin()) };
462 float max[2] = { static_cast<float>(bound.xmax()), static_cast<float>(bound.ymax()) };
463 r.Insert(min, max, edge.second);
464 }
465 for (auto& ptStop : myPTStops) {
466 const std::string& stopEdgeID = ptStop.second->getEdgeId();
467 NBEdge* stopEdge = cont.getByID(stopEdgeID);
468 //std::cout << "findAccessEdgesForRailStops edge=" << stopEdgeID << " exists=" << (stopEdge != 0) << "\n";
469 if (stopEdge != nullptr && (stopEdge->getPermissions() & SVC_PEDESTRIAN) == 0) {
470 //if (stopEdge != 0 && isRailway(stopEdge->getPermissions())) {
471 std::set<const Named*> edges;
472 Named::StoringVisitor visitor(edges);
473 const Position& pos = ptStop.second->getPosition();
474 float min[2] = {static_cast<float>(pos.x() - maxRadius), static_cast<float>(pos.y() - maxRadius)};
475 float max[2] = {static_cast<float>(pos.x() + maxRadius), static_cast<float>(pos.y() + maxRadius)};
476 r.Search(min, max, visitor);
477 std::vector<NBEdge*> edgCants;
478 for (const Named* namedEdge : edges) {
479 NBEdge* e = const_cast<NBEdge*>(dynamic_cast<const NBEdge*>(namedEdge));
480 edgCants.push_back(e);
481 }
482 std::sort(edgCants.begin(), edgCants.end(), [pos](NBEdge * a, NBEdge * b) {
483 return a->getLaneShape(0).distance2D(pos, false) < b->getLaneShape(0).distance2D(pos, false);
484 });
485 int cnt = 0;
486 for (auto edge : edgCants) {
487 int laneIdx = 0;
488 for (auto lane : edge->getLanes()) {
489 if ((lane.permissions & SVC_PEDESTRIAN) != 0) {
490 double offset = lane.shape.nearest_offset_to_point2D(pos, false);
491 double finalLength = edge->getFinalLength();
492 double laneLength = lane.shape.length();
493 double accessLength = pos.distanceTo2D(lane.shape.positionAtOffset2D(offset)) * accessFactor;
494 ptStop.second->addAccess(edge->getLaneID(laneIdx), offset * finalLength / laneLength, accessLength);
495 cnt++;
496 break;
497 }
498 laneIdx++;
499 }
500 if (cnt == maxCount) {
501 break;
502 }
503 }
504 }
505 }
506}
507
508
510NBPTStopCont::findStop(const std::string& origEdgeID, Position pos, double threshold) const {
511 for (auto& item : myPTStops) {
512 if (item.second->getOrigEdgeId() == origEdgeID &&
513 item.second->getPosition().distanceTo2D(pos) < threshold) {
514 return item.second;
515 }
516 }
517 return nullptr;
518}
519
520
521/****************************************************************************/
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:266
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:267
#define TL(string)
Definition: MsgHandler.h:282
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:42
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_RAIL_URBAN
vehicle is a city rail
@ SVC_TRAM
vehicle is a light rail
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:130
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:118
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:136
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:124
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
NBEdge * getByID(const std::string &edgeID) const
Returns the edge with id if it exists.
The representation of a single edge during network building.
Definition: NBEdge.h:92
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:4137
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:552
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:787
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:762
const std::string & getID() const
Definition: NBEdge.h:1526
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:545
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:3767
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
Definition: NBNode.h:263
double getLength() const
const Position & getPos() const
bool insert(NBPTStop *ptStop, bool floating=false)
Inserts a node into the map.
static std::string getReverseID(const std::string &id)
int cleanupDeleted(NBEdgeCont &cont)
remove stops on non existing (removed) edges
static std::set< std::string > myIgnoredStops
Definition: NBPTStopCont.h:121
static NBEdge * getReverseEdge(NBEdge *edge)
double computeCrossProductEdgePosition(const NBEdge *edge, const Position &closestPlatform) const
void postprocess(std::set< std::string > &usedStops)
std::map< std::string, std::vector< NBPTStop * > > myPTStopLookup
The map of edge ids to stops.
Definition: NBPTStopCont.h:109
NBPTStop * findStop(const std::string &origEdgeID, Position pos, double threshold=1) const
void replaceEdge(const std::string &edgeID, const EdgeVector &replacement)
replace the edge with the closes edge on the given edge list in all stops
void addEdges2Keep(const OptionsCont &oc, std::set< std::string > &into)
add edges that must be kept
std::map< std::string, NBPTStop * > PTStopsCont
Definition of the map of names to pt stops.
Definition: NBPTStopCont.h:103
NBPTStop * get(std::string id) const
Retrieve a previously inserted pt stop.
PTStopsCont myPTStops
The map of names to pt stops.
Definition: NBPTStopCont.h:106
NBPTStop * getReverseStop(NBPTStop *pStop, const NBEdgeCont &ec)
const NBPTPlatform * getClosestPlatformToPTStopPosition(NBPTStop *pStop)
void localizePTStops(NBEdgeCont &cont)
void alignIdSigns()
void assignEdgeForFloatingStops(NBEdgeCont &cont, double maxRadius)
void findAccessEdgesForRailStops(NBEdgeCont &cont, double maxRadius, int maxCount, double accessFactor)
int generateBidiStops(NBEdgeCont &cont)
duplicate stops for superposed rail edges and return the number of generated stops
void assignLanes(NBEdgeCont &cont)
void assignPTStopToEdgeOfClosestPlatform(NBPTStop *pStop, NBEdgeCont &cont)
std::vector< NBPTStop * > myFloatingStops
Definition: NBPTStopCont.h:111
NBPTStop * assignAndCreatNewPTStopAsNeeded(NBPTStop *pStop, NBEdgeCont &cont)
The representation of a single pt stop.
Definition: NBPTStop.h:46
bool findLaneAndComputeBusStopExtent(const NBEdgeCont &ec)
Definition: NBPTStop.cpp:195
void setPTStopLength(double ptStopLength)
Definition: NBPTStop.h:156
bool setEdgeId(std::string edgeId, const NBEdgeCont &ec)
Definition: NBPTStop.cpp:182
std::string getID() const
Definition: NBPTStop.cpp:55
bool getIsMultipleStopPositions() const
Definition: NBPTStop.cpp:163
const std::vector< NBPTPlatform > & getPlatformCands()
Definition: NBPTStop.cpp:157
void setPTStopId(std::string id)
Definition: NBPTStop.h:105
double getLength() const
Definition: NBPTStop.cpp:176
void setBidiStop(NBPTStop *bidiStop)
Definition: NBPTStop.h:124
SVCPermissions getPermissions() const
Definition: NBPTStop.cpp:145
const std::string & getEdgeId() const
Definition: NBPTStop.cpp:67
const Position & getPosition() const
Definition: NBPTStop.cpp:79
const std::string getOrigEdgeId() const
Definition: NBPTStop.cpp:61
const std::string getName() const
Definition: NBPTStop.cpp:73
Allows to store the object; used as context while traveling the rtree in TraCI.
Definition: Named.h:90
Base class for objects which have an id.
Definition: Named.h:54
A RT-tree for efficient storing of SUMO's Named objects.
Definition: NamedRTree.h:61
void Insert(const float a_min[2], const float a_max[2], Named *const &a_data)
Insert entry.
Definition: NamedRTree.h:79
int Search(const float a_min[2], const float a_max[2], const Named::StoringVisitor &c) const
Find all within search rectangle.
Definition: NamedRTree.h:112
A storage for options typed value containers)
Definition: OptionsCont.h:89
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:257
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:252
double x() const
Returns the x-position.
Definition: Position.h:55
double y() const
Returns the y-position.
Definition: Position.h:60
A list of positions.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
double offsetAtIndex2D(int index) const
return the offset at the given index