Eclipse SUMO - Simulation of Urban MObility
NBEdge.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/****************************************************************************/
20// The representation of a single edge during network building
21/****************************************************************************/
22#pragma once
23#include <config.h>
24
25#include <map>
26#include <vector>
27#include <string>
28#include <set>
29#include <cassert>
30#include <utils/common/Named.h>
38#include "NBCont.h"
39#include "NBHelpers.h"
40#include "NBSign.h"
41
42
43// ===========================================================================
44// class declarations
45// ===========================================================================
46class NBNode;
47class NBConnection;
48class NBNodeCont;
49class NBEdgeCont;
50class OutputDevice;
51class GNELane;
52class NBVehicle;
53
54
55// ===========================================================================
56// class definitions
57// ===========================================================================
63public:
64 virtual ~NBRouterEdge() {}
65 virtual const std::string& getID() const = 0;
66 virtual double getSpeed() const = 0;
67 virtual double getLength() const = 0;
68 virtual const NBRouterEdge* getBidiEdge() const = 0;
69 virtual int getNumericalID() const = 0;
71 virtual bool isInternal() const {
72 return false;
73 }
74 inline bool prohibits(const NBVehicle* const /*veh*/) const {
75 return false;
76 }
77 inline bool restricts(const NBVehicle* const /*veh*/) const {
78 return false;
79 }
80
81
82 static inline double getTravelTimeStatic(const NBRouterEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
83 return edge->getLength() / edge->getSpeed();
84 }
85};
86
87
92class NBEdge : public Named, public Parameterised, public NBRouterEdge {
93 friend class NBEdgeCont;
94
96 friend class GNELane;
97 friend class GNEEdge;
98 friend class GNEJunction;
99
100public:
101
109 enum class EdgeBuildingStep {
111 INIT_REJECT_CONNECTIONS,
113 INIT,
115 EDGE2EDGES,
117 LANES2EDGES,
119 LANES2LANES_RECHECK,
121 LANES2LANES_DONE,
123 LANES2LANES_USER
124 };
125
126
130 enum class Lane2LaneInfoType {
132 COMPUTED,
134 USER,
136 VALIDATED
137 };
138
139
143 struct Lane final : public Parameterised {
145 Lane(NBEdge* e, const std::string& _origID);
146
149
151 double speed;
152
154 double friction;
155
158
161
164
167
169 double endOffset;
170
174
176 double width;
177
179 std::string oppositeID;
180
183
185 // @note (see NIImporter_DlrNavteq::ConnectedLanesHandler)
187
190
192 std::string type;
193
195 int turnSigns = 0;
196 };
197
201 struct Connection final : public Parameterised, public NBRouterEdge {
207 Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
208
210 Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
211 KeepClear keepClear_ = KEEPCLEAR_UNSPECIFIED,
212 double contPos_ = UNSPECIFIED_CONTPOS,
213 double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
214 double speed_ = UNSPECIFIED_SPEED,
215 double friction_ = UNSPECIFIED_FRICTION,
216 double length_ = myDefaultConnectionLength,
217 bool haveVia_ = false,
218 bool uncontrolled_ = false,
219 const PositionVector& customShape_ = PositionVector::EMPTY,
221 bool indirectLeft = false,
222 const std::string& edgeType = "",
223 SVCPermissions changeLeft_ = SVC_UNSPECIFIED,
224 SVCPermissions changeRight_ = SVC_UNSPECIFIED);
225
228
231
234
236 std::string tlID;
237
240
243
246
249
251 double contPos;
252
255
257 double speed;
258
259 // @brief custom friction for connection
260 double friction;
261
264
267
270
273
276
279
281 std::string edgeType;
282
284 std::string id;
285
288
290 double vmax;
291
294
296 std::string viaID;
297
300
302 double viaLength;
303
305 std::vector<int> foeInternalLinks;
306
308 std::vector<std::string> foeIncomingLanes;
309
312
315
317 std::string getInternalLaneID() const;
318
320 std::string getDescription(const NBEdge* parent) const;
321
323 double length;
324
328 const std::string& getID() const {
329 return id;
330 }
331 double getSpeed() const {
332 return vmax;
333 }
334 double getLength() const {
335 return shape.length() + viaShape.length();
336 }
337 int getNumericalID() const {
338 throw ProcessError("NBEdge::Connection does not implement getNumericalID()");
339 }
340 const Connection* getBidiEdge() const {
341 return nullptr;
342 }
343 bool isInternal() const {
344 return true;
345 }
347 UNUSED_PARAMETER(vClass);
348 return myViaSuccessors;
349 }
351 };
352
355
357 static const double UNSPECIFIED_WIDTH;
358
360 static const double UNSPECIFIED_OFFSET;
361
363 static const double UNSPECIFIED_SPEED;
364
366 static const double UNSPECIFIED_FRICTION;
367
369 static const double UNSPECIFIED_CONTPOS;
370
373
375 static const double UNSPECIFIED_LOADED_LENGTH;
376
378 static const double UNSPECIFIED_SIGNAL_OFFSET;
379
381 static const double ANGLE_LOOKAHEAD;
382
385
388
393 ROUNDABOUT = 1000
394 };
395
396 static void setDefaultConnectionLength(double length) {
398 }
399
400public:
420 NBEdge(const std::string& id,
421 NBNode* from, NBNode* to, std::string type,
422 double speed, double friction, int nolanes, int priority,
423 double width, double endOffset,
424 LaneSpreadFunction spread,
425 const std::string& streetName = "");
426
449 NBEdge(const std::string& id,
450 NBNode* from, NBNode* to, std::string type,
451 double speed, double friction, int nolanes, int priority,
452 double width, double endOffset,
453 PositionVector geom,
454 LaneSpreadFunction spread,
455 const std::string& streetName = "",
456 const std::string& origID = "",
457 bool tryIgnoreNodePositions = false);
458
470 NBEdge(const std::string& id,
471 NBNode* from, NBNode* to,
472 const NBEdge* tpl,
473 const PositionVector& geom = PositionVector(),
474 int numLanes = -1);
475
477 ~NBEdge();
478
479
495 void reinit(NBNode* from, NBNode* to, const std::string& type,
496 double speed, double friction, int nolanes, int priority,
497 PositionVector geom, double width, double endOffset,
498 const std::string& streetName,
499 LaneSpreadFunction spread,
500 bool tryIgnoreNodePositions = false);
501
506 void reinitNodes(NBNode* from, NBNode* to);
507
510
514 void reshiftPosition(double xoff, double yoff);
515
517 void mirrorX();
519
521
522
526 int getNumLanes() const {
527 return (int)myLanes.size();
528 }
529
533 int getPriority() const {
534 return myPriority;
535 }
536
538 void setPriority(int priority) {
539 myPriority = priority;
540 }
541
545 inline NBNode* getFromNode() const {
546 return myFrom;
547 }
548
552 inline NBNode* getToNode() const {
553 return myTo;
554 }
555
561 inline double getStartAngle() const {
562 return myStartAngle;
563 }
564
570 inline double getEndAngle() const {
571 return myEndAngle;
572 }
573
578 double getShapeStartAngle() const;
579
580
586 double getShapeEndAngle() const;
587
592 inline double getTotalAngle() const {
593 return myTotalAngle;
594 }
595
599 double getLength() const {
600 return myLength;
601 }
602
603
608 double getLoadedLength() const {
610 }
611
613 double getFinalLength() const;
614
618 bool hasLoadedLength() const {
619 return myLoadedLength > 0;
620 }
621
625 double getSpeed() const {
626 return mySpeed;
627 }
628
632 double getFriction() const {
633 return myFriction;
634 }
635
642 return myStep;
643 }
644
648 double getLaneWidth() const {
649 return myLaneWidth;
650 }
651
655 double getLaneWidth(int lane) const;
656
666 const NBNode& node,
667 const NBEdge::Connection& connection,
668 const NBEdge::Lane& successor,
669 bool isVia) const;
670
672 double getTotalWidth() const;
673
675 const std::string& getStreetName() const {
676 return myStreetName;
677 }
678
680 void setStreetName(const std::string& name) {
681 myStreetName = name;
682 }
683
685 double getDistance() const {
686 return myDistance;
687 }
688
690 double getDistancAt(double pos) const;
691
695 double getEndOffset() const {
696 return myEndOffset;
697 }
698
702 double getEndOffset(int lane) const;
703
707 const StopOffset& getEdgeStopOffset() const;
708
712 const StopOffset& getLaneStopOffset(int lane) const;
713
715 double getSignalOffset() const;
716
719 return mySignalPosition;
720 }
721
723 const NBNode* getSignalNode() const {
724 return mySignalNode;
725 }
726
728 void setSignalPosition(const Position& pos, const NBNode* signalNode) {
729 mySignalPosition = pos;
730 mySignalNode = signalNode;
731 }
732
736 const std::vector<NBEdge::Lane>& getLanes() const {
737 return myLanes;
738 }
740
745 int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
746
751 int getFirstNonPedestrianNonBicycleLaneIndex(int direction, bool exclusive = false) const;
752
754 int getSpecialLane(SVCPermissions permissions) const;
755
759 int getFirstAllowedLaneIndex(int direction) const;
760
762 NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
763
765 std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
766
768 int getNumLanesThatAllow(SVCPermissions permissions) const;
769
771 bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const;
772
774 bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const;
775
777 double getCrossingAngle(NBNode* node);
778
780 std::string getSidewalkID();
781
783
784
788 return myGeom;
789 }
790
792 const PositionVector getInnerGeometry() const;
793
795 bool hasDefaultGeometry() const;
796
802 bool hasDefaultGeometryEndpoints() const;
803
809 bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
810
811 Position getEndpointAtNode(const NBNode* node) const;
812
823 void setGeometry(const PositionVector& g, bool inner = false);
824
834 void addGeometryPoint(int index, const Position& p);
835
837 void extendGeometryAtNode(const NBNode* node, double maxExtent);
838
840 void shortenGeometryAtNode(const NBNode* node, double reduction);
841
843 void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
844
846 Position geometryPositionAtOffset(double offset) const;
847
857 void computeEdgeShape(double smoothElevationThreshold = -1);
858
862 const PositionVector& getLaneShape(int i) const;
863
869
875
879 void reduceGeometry(const double minDist);
880
886 void checkGeometry(const double maxAngle, const double minRadius, bool fix, bool silent);
888
891
905 bool addEdge2EdgeConnection(NBEdge* dest, bool overrideRemoval = false);
906
927 bool addLane2LaneConnection(int fromLane, NBEdge* dest,
928 int toLane, Lane2LaneInfoType type,
929 bool mayUseSameDestination = false,
930 bool mayDefinitelyPass = false,
932 double contPos = UNSPECIFIED_CONTPOS,
933 double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
934 double speed = UNSPECIFIED_SPEED,
935 double friction = UNSPECIFIED_FRICTION,
936 double length = myDefaultConnectionLength,
937 const PositionVector& customShape = PositionVector::EMPTY,
938 const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
939 SVCPermissions permissions = SVC_UNSPECIFIED,
940 const bool indirectLeft = false,
941 const std::string& edgeType = "",
942 SVCPermissions changeLeft = SVC_UNSPECIFIED,
943 SVCPermissions changeRight = SVC_UNSPECIFIED,
944 bool postProcess = false);
945
963 bool addLane2LaneConnections(int fromLane,
964 NBEdge* dest, int toLane, int no,
965 Lane2LaneInfoType type, bool invalidatePrevious = false,
966 bool mayDefinitelyPass = false);
967
978 bool setConnection(int lane, NBEdge* destEdge,
979 int destLane,
981 bool mayUseSameDestination = false,
982 bool mayDefinitelyPass = false,
984 double contPos = UNSPECIFIED_CONTPOS,
985 double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
986 double speed = UNSPECIFIED_SPEED,
987 double friction = UNSPECIFIED_FRICTION,
988 double length = myDefaultConnectionLength,
989 const PositionVector& customShape = PositionVector::EMPTY,
990 const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
991 SVCPermissions permissions = SVC_UNSPECIFIED,
992 bool indirectLeft = false,
993 const std::string& edgeType = "",
994 SVCPermissions changeLeft = SVC_UNSPECIFIED,
995 SVCPermissions changeRight = SVC_UNSPECIFIED,
996 bool postProcess = false);
997
1008 std::vector<Connection> getConnectionsFromLane(int lane, NBEdge* to = nullptr, int toLane = -1) const;
1009
1014 const Connection& getConnection(int fromLane, const NBEdge* to, int toLane) const;
1015
1020 Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
1021
1030 bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
1031
1038 bool isConnectedTo(const NBEdge* e, const bool ignoreTurnaround = false) const;
1039
1043 const std::vector<Connection>& getConnections() const {
1044 return myConnections;
1045 }
1046
1050 std::vector<Connection>& getConnections() {
1051 return myConnections;
1052 }
1053
1058
1063
1068
1072 std::vector<int> getConnectionLanes(NBEdge* currentOutgoing, bool withBikes = true) const;
1073
1076
1079
1085 void remapConnections(const EdgeVector& incoming);
1086
1094 void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false, const bool keepPossibleTurns = false);
1095
1097 bool removeFromConnections(const NBEdge::Connection& connectionToRemove);
1098
1100 void invalidateConnections(bool reallowSetting = false);
1101
1103 void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
1104
1106 void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
1107
1109 void copyConnectionsFrom(NBEdge* src);
1110
1112 void shiftToLanesToEdge(NBEdge* to, int laneOff);
1114
1120 bool isTurningDirectionAt(const NBEdge* const edge) const;
1121
1126 void setTurningDestination(NBEdge* e, bool onlyPossible = false);
1127
1133 }
1134
1140 }
1141
1143 void setInsideTLS(bool inside) {
1144 myAmInTLS = inside;
1145 }
1146
1150 bool isInsideTLS() const {
1151 return myAmInTLS;
1152 }
1154
1160 void setJunctionPriority(const NBNode* const node, int prio);
1161
1171 int getJunctionPriority(const NBNode* const node) const;
1172
1174 void setLoadedLength(double val);
1175
1177 void setAverageLengthWithOpposite(double val);
1178
1181
1183 const std::string& getTypeID() const {
1184 return myType;
1185 }
1186
1188 bool needsLaneSpecificOutput() const;
1189
1191 bool hasPermissions() const;
1192
1194 bool hasLaneSpecificPermissions() const;
1195
1197 bool hasLaneSpecificSpeed() const;
1198
1200 bool hasLaneSpecificFriction() const;
1201
1203 bool hasLaneSpecificWidth() const;
1204
1206 bool hasLaneSpecificType() const;
1207
1209 bool hasLaneSpecificEndOffset() const;
1210
1212 bool hasLaneSpecificStopOffsets() const;
1213
1215 bool hasAccelLane() const;
1216
1218 bool hasCustomLaneShape() const;
1219
1221 bool hasLaneParams() const;
1222
1224 bool prohibitsChanging() const;
1225
1227 bool computeEdge2Edges(bool noLeftMovers);
1228
1230 bool computeLanes2Edges();
1231
1233 bool recheckLanes();
1234
1243 void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions);
1244
1248 NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1249
1251 double getMaxLaneOffset();
1252
1254 bool lanesWereAssigned() const;
1255
1257 bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1258
1260 bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1261
1264
1266 PositionVector getCWBoundaryLine(const NBNode& n) const;
1267
1270
1272 bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1273
1275 void append(NBEdge* continuation);
1276
1278 bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1279
1281 void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1282
1283 /* @brief return the turn destination if it exists
1284 * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1285 * exists
1286 */
1287 NBEdge* getTurnDestination(bool possibleDestination = false) const;
1288
1290 std::string getLaneID(int lane) const;
1291
1293 double getLaneSpeed(int lane) const;
1294
1296 double getLaneFriction(int lane) const;
1297
1299 bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1300
1308 double getAngleAtNode(const NBNode* const node) const;
1309
1315 double getAngleAtNodeNormalized(const NBNode* const node) const;
1316
1325 double getAngleAtNodeToCenter(const NBNode* const node) const;
1326
1328 void incLaneNo(int by);
1329
1331 void decLaneNo(int by);
1332
1334 void deleteLane(int index, bool recompute, bool shiftIndices);
1335
1337 void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices);
1338
1341
1343 void addSidewalk(double width);
1344
1346 void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1347
1349 void addBikeLane(double width);
1350
1352 void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1353
1355 void addRestrictedLane(double width, SUMOVehicleClass vclass);
1356
1358 void setPermissions(SVCPermissions permissions, int lane = -1);
1359
1361 void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1362
1364 void setPermittedChanging(int lane, SVCPermissions changeLeft, SVCPermissions changeRight);
1365
1367 void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1368
1370 void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1371
1373 void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1374
1376 void setLaneWidth(int lane, double width);
1377
1379 void setLaneType(int lane, const std::string& type);
1380
1382 void setEndOffset(int lane, double offset);
1383
1385 void setSpeed(int lane, double speed);
1386
1388 void setFriction(int lane, double friction);
1389
1392 bool setEdgeStopOffset(int lane, const StopOffset& offset, bool overwrite = false);
1393
1395 void setAcceleration(int lane, bool accelRamp);
1396
1400 }
1401
1402 bool isOffRamp() const {
1403 return myIsOffRamp;
1404 }
1405
1407 void setLaneShape(int lane, const PositionVector& shape);
1408
1410 SVCPermissions getPermissions(int lane = -1) const;
1411
1413 void setOrigID(const std::string origID, const bool append, const int laneIdx = -1);
1414
1416 void setDistance(double distance) {
1417 myDistance = distance;
1418 }
1419
1421 void setBidi(bool isBidi) {
1422 myIsBidi = isBidi;
1423 }
1424
1425 // @brief returns a reference to the internal structure for the convenience of NETEDIT
1426 Lane& getLaneStruct(int lane) {
1427 assert(lane >= 0);
1428 assert(lane < (int)myLanes.size());
1429 return myLanes[lane];
1430 }
1431
1432 // @brief returns a reference to the internal structure for the convenience of NETEDIT
1433 const Lane& getLaneStruct(int lane) const {
1434 assert(lane >= 0);
1435 assert(lane < (int)myLanes.size());
1436 return myLanes[lane];
1437 }
1438
1441 myStep = step;
1442 }
1443
1444 /* @brief fill connection attributes shape, viaShape, ...
1445 *
1446 * @param[in,out] edgeIndex The number of connections already handled
1447 * @param[in,out] splitIndex The number of via edges already built
1448 * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1449 */
1450 double buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1451
1453 inline const std::vector<NBSign>& getSigns() const {
1454 return mySigns;
1455 }
1456
1458 inline void addSign(NBSign sign) {
1459 mySigns.push_back(sign);
1460 }
1461
1464
1466 void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1467 const PositionVector& getNodeBorder(const NBNode* node) const;
1468 void resetNodeBorder(const NBNode* node);
1469
1471 bool isBidiRail(bool ignoreSpread = false) const;
1472
1474 bool isBidiEdge(bool checkPotential = false) const;
1475
1477 bool isRailDeadEnd() const;
1478
1480 void debugPrintConnections(bool outgoing = true, bool incoming = false) const;
1481
1483 static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width1, double width2, const std::string& error = "", bool secondIntersection = false);
1484
1488 static PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape);
1489
1491
1492
1493 static inline double getTravelTimeStatic(const NBEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
1494 return edge->getLength() / edge->getSpeed();
1495 }
1496
1497 static int getLaneIndexFromLaneID(const std::string laneID);
1498
1500 void setNumericalID(int index) {
1501 myIndex = index;
1502 }
1503
1508 int getNumericalID() const {
1509 return myIndex;
1510 }
1511
1512 const NBEdge* getBidiEdge() const {
1513 return isBidiRail() || isBidiEdge() ? myPossibleTurnDestination : nullptr;
1514 }
1515
1519
1520
1524
1526 const std::string& getID() const {
1527 return Named::getID();
1528 }
1529
1531 bool joinLanes(SVCPermissions perms);
1532
1534 void resetLaneShapes();
1535
1538
1541 NBEdge* getStraightContinuation(SVCPermissions permissions) const;
1542
1545 NBEdge* getStraightPredecessor(SVCPermissions permissions) const;
1546
1548 NBEdge* guessOpposite(bool reguess = false);
1549
1550
1551 const std::string& getTurnSignTarget() const {
1552 return myTurnSignTarget;
1553 }
1554
1555 void setTurnSignTarget(const std::string& target) {
1556 myTurnSignTarget = target;
1557 }
1558
1560 static EdgeVector filterByPermissions(const EdgeVector& edges, SVCPermissions permissions);
1561
1562private:
1567 private:
1569 std::map<NBEdge*, std::vector<int> > myConnections;
1570
1573
1574 public:
1577 : myTransitions(transitions) { }
1578
1581
1583 void execute(const int lane, const int virtEdge);
1584
1586 const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1587 return myConnections;
1588 }
1589
1590 private:
1593
1596 };
1597
1598
1607 public:
1609 enum class Direction {
1610 RIGHTMOST,
1611 LEFTMOST,
1612 FORWARD
1613 };
1614
1615 public:
1617 MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, const std::vector<int>& availableLanes);
1618
1621
1623 int getStraightest() const {
1624 return myStraightest;
1625 }
1626
1628 bool empty() const;
1629
1631 bool includes(Direction d) const;
1632
1633 private:
1636
1638 std::vector<Direction> myDirs;
1639
1642
1645 };
1646
1648 PositionVector computeLaneShape(int lane, double offset) const;
1649
1651 void computeLaneShapes();
1652
1653private:
1670 void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1671
1673 void divideOnEdges(const EdgeVector* outgoing);
1674
1676 void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1677
1679 void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>& priorities);
1680
1682 const std::vector<int> prepareEdgePriorities(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1683
1686
1689 void moveConnectionToLeft(int lane);
1690
1694 void moveConnectionToRight(int lane);
1695
1697 bool canMoveConnection(const Connection& con, int newFromLane) const;
1699
1701 void computeAngle();
1702
1704 bool bothLeftTurns(LinkDirection dir, const NBEdge* otherFrom, LinkDirection dir2) const;
1705 bool haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon,
1706 int numPoints, double width1, double width2, int shapeFlag = 0) const;
1707
1709 bool hasRestrictedLane(SUMOVehicleClass vclass) const;
1710
1712 void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1713
1715 void assignInternalLaneLength(std::vector<Connection>::iterator i, int numLanes, double lengthSum, bool averageLength);
1716
1718 std::vector<LinkDirection> decodeTurnSigns(int turnSigns);
1719
1721 bool applyTurnSigns();
1722
1723private:
1728
1730 std::string myType;
1731
1734
1736 std::string myTurnSignTarget;
1737
1739 double myLength;
1740
1747
1750
1752 double mySpeed;
1753
1756
1759
1763 std::vector<Connection> myConnections;
1764
1766 std::vector<Connection> myConnectionsToDelete;
1767
1770
1773
1776
1779
1782
1785
1788
1794
1797
1801 std::vector<Lane> myLanes;
1802
1805
1808
1811
1813 std::string myStreetName;
1814
1816 std::vector<NBSign> mySigns;
1817
1821
1827
1830
1833
1836
1837 // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1839
1840 // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1842
1843 // @brief default length for overriding connection lengths
1845
1846public:
1847
1850 public:
1852 connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1853 myHasFromLane(hasFromLane),
1854 myEdge2Find(edge2find) { }
1855
1857 bool operator()(const Connection& c) const {
1858 return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1859 }
1860
1861 private:
1863 const bool myHasFromLane;
1864
1866 const NBEdge* const myEdge2Find;
1867 };
1868
1871 public:
1873 connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1874 myEdge2Find(edge2find),
1875 myLane2Find(lane2find),
1876 myFromLane2Find(fromLane2find) { }
1877
1879 bool operator()(const Connection& c) const {
1880 return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1881 }
1882
1883 private:
1886
1889
1892 };
1893
1896 public:
1898 connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1899 myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1900
1902 bool operator()(const Connection& c) const {
1903 return ((c.fromLane == myFromLane || myFromLane == -1)
1905 && (c.toLane == myLane2Find || myLane2Find == -1));
1906 }
1907
1908 private:
1911
1914
1917
1920 };
1921
1924 public:
1926 connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1927 myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1928
1930 bool operator()(const Connection& c) const {
1931 return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1932 && c.fromLane >= 0 // already assigned
1933 && c.toEdge == myEdge2Find);
1934 }
1935
1936 private:
1939
1942
1945 };
1946
1949 public:
1951 connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1952
1954 bool operator()(const Connection& c) const {
1955 return c.fromLane == myLane2Find;
1956 }
1957
1958 private:
1961
1962 private:
1965 };
1966
1968 static bool connections_sorter(const Connection& c1, const Connection& c2);
1969
1975 public:
1978
1979 public:
1981 int operator()(const Connection& c1, const Connection& c2) const;
1982
1983 private:
1986 };
1987
1988private:
1990 NBEdge(const NBEdge& s) = delete;
1991
1993 NBEdge& operator=(const NBEdge& s) = delete;
1994
1996 NBEdge();
1997};
std::vector< std::pair< const NBRouterEdge *, const NBRouterEdge * > > ConstRouterEdgePairVector
Definition: NBCont.h:46
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:42
KeepClear
keepClear status of connections
Definition: NBCont.h:58
@ KEEPCLEAR_UNSPECIFIED
Definition: NBCont.h:61
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:30
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1606
bool empty() const
returns the information whether no following street has a higher priority
Definition: NBEdge.cpp:264
MainDirections(const MainDirections &)=delete
Invalidated copy constructor.
bool includes(Direction d) const
returns the information whether the street in the given direction has a higher priority
Definition: NBEdge.cpp:270
int getStraightest() const
returns the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1623
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to, const std::vector< int > &availableLanes)
constructor
Definition: NBEdge.cpp:207
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1638
~MainDirections()
destructor
Definition: NBEdge.cpp:260
MainDirections & operator=(const MainDirections &)=delete
Invalidated assignment operator.
int myStraightest
the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1635
Direction
enum of possible directions
Definition: NBEdge.h:1609
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1566
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1586
ToEdgeConnectionsAdder(const ToEdgeConnectionsAdder &)=delete
Invalidated copy constructor.
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)=delete
Invalidated assignment operator.
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1580
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1576
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1572
void execute(const int lane, const int virtEdge)
executes a bresenham - step
Definition: NBEdge.cpp:176
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
Definition: NBEdge.h:1569
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1941
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1930
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1926
bool myCheckRight
check if is right
Definition: NBEdge.h:1944
int myFromLane
index of from lane
Definition: NBEdge.h:1938
int myLane2Find
lane to find
Definition: NBEdge.h:1916
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1902
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1898
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1913
int myFromLane
index of from lane
Definition: NBEdge.h:1910
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1919
int myLane2Find
index of lane to find
Definition: NBEdge.h:1960
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1954
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)=delete
invalidated assignment operator
connections_fromlane_finder(int lane2find)
@briefconstructor
Definition: NBEdge.h:1951
Class to sort edges by their angle.
Definition: NBEdge.h:1974
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1985
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
Definition: NBEdge.cpp:279
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1977
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1852
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1863
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1857
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1866
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1879
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1873
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1891
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1885
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
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:680
void reinit(NBNode *from, NBNode *to, const std::string &type, double speed, double friction, int nolanes, int priority, PositionVector geom, double width, double endOffset, const std::string &streetName, LaneSpreadFunction spread, bool tryIgnoreNodePositions=false)
Resets initial values.
Definition: NBEdge.cpp:420
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:980
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:595
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:4114
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:2135
bool addEdge2EdgeConnection(NBEdge *dest, bool overrideRemoval=false)
Adds a connection to another edge.
Definition: NBEdge.cpp:1058
NBEdge * guessOpposite(bool reguess=false)
set oppositeID and return opposite edge if found
Definition: NBEdge.cpp:4643
void setPermittedChanging(int lane, SVCPermissions changeLeft, SVCPermissions changeRight)
set allowed classes for changing to the left and right from the given lane
Definition: NBEdge.cpp:4128
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:599
double myLaneWidth
This width of this edge's lanes.
Definition: NBEdge.h:1796
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:4137
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1766
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1298
double getDistancAt(double pos) const
get distance at the given offset
Definition: NBEdge.cpp:4671
double myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1787
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:1043
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1778
const Position & getSignalPosition() const
Returns the position of a traffic signal on this edge.
Definition: NBEdge.h:718
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:4100
bool isInsideTLS() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:1150
StopOffset myEdgeStopOffset
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
Definition: NBEdge.h:1793
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:390
@ ROUNDABOUT
Definition: NBEdge.h:393
@ PRIORITY_ROAD
Definition: NBEdge.h:392
@ MINOR_ROAD
Definition: NBEdge.h:391
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition: NBEdge.h:608
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:4289
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1433
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:4342
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition: NBEdge.cpp:3599
double getLaneFriction(int lane) const
get lane friction of specified lane
Definition: NBEdge.cpp:2141
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:497
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4052
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition: NBEdge.cpp:471
double mySpeed
The maximal speed.
Definition: NBEdge.h:1752
bool hasLaneSpecificFriction() const
whether lanes differ in friction
Definition: NBEdge.cpp:2387
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:648
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:3563
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:552
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1763
Connection & getConnectionRef(int fromLane, const NBEdge *to, int toLane)
Returns reference to the specified connection This method goes through "myConnections" and returns th...
Definition: NBEdge.cpp:1267
NBEdge()
constructor for dummy edge
Definition: NBEdge.cpp:397
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:2991
ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:1841
PositionVector getCCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going counter-clock-wise around the given node
Definition: NBEdge.cpp:3581
double buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1642
static const double UNSPECIFIED_FRICTION
unspecified lane friction
Definition: NBEdge.h:366
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:3834
static EdgeVector filterByPermissions(const EdgeVector &edges, SVCPermissions permissions)
return only those edges that permit at least one of the give permissions
Definition: NBEdge.cpp:4601
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1426
const Connection & getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection (unmodifiable) This method goes through "myConnections" and returns ...
Definition: NBEdge.cpp:1255
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1453
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
Definition: NBEdge.cpp:3790
void markOffRamp(bool isOffRamp)
marks this edge has being an offRamp or leading to one (used for connection computation)
Definition: NBEdge.h:1398
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:2377
void setAverageLengthWithOpposite(double val)
patch average lane length in regard to the opposite edge
Definition: NBEdge.cpp:4157
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3897
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:2336
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:384
void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished and a turning direction exists (myT...
Definition: NBEdge.cpp:3350
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:4172
std::string myType
The type of the edge.
Definition: NBEdge.h:1730
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:787
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:2352
double myTotalAngle
Definition: NBEdge.h:1745
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:1050
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.cpp:974
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:627
std::string myTurnSignTarget
node for which turnSign information applies
Definition: NBEdge.h:1736
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:762
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
Definition: NBEdge.h:387
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:4516
std::vector< LinkDirection > decodeTurnSigns(int turnSigns)
decode bitset
Definition: NBEdge.cpp:2590
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:4163
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:2502
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:641
void setInsideTLS(bool inside)
Marks this edge being within an intersection.
Definition: NBEdge.h:1143
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1784
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1614
void updateChangeRestrictions(SVCPermissions ignoring)
modify all existing restrictions on lane changing
Definition: NBEdge.cpp:2153
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:4348
Position getEndpointAtNode(const NBNode *node) const
Definition: NBEdge.cpp:645
NBEdge * getStraightContinuation(SVCPermissions permissions) const
return the straightest follower edge for the given permissions or nullptr (never returns turn-arounds...
Definition: NBEdge.cpp:4612
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:3910
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:618
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:4336
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, const bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection between the specified this edge's lane and an approached one.
Definition: NBEdge.cpp:1092
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
divide selected lanes on edges
Definition: NBEdge.cpp:3070
int getNumericalID() const
Returns the index (numeric id) of the edge.
Definition: NBEdge.h:1508
void setTurnSignTarget(const std::string &target)
Definition: NBEdge.h:1555
void setDistance(double distance)
set kilometrage at start of edge (negative value implies couting down along the edge)
Definition: NBEdge.h:1416
static double getTravelTimeStatic(const NBEdge *const edge, const NBVehicle *const, double)
Definition: NBEdge.h:1493
bool setEdgeStopOffset(int lane, const StopOffset &offset, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4022
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:736
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
Definition: NBEdge.cpp:2430
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:708
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:4197
EdgeVector mySuccessors
Definition: NBEdge.h:1838
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:4423
void checkGeometry(const double maxAngle, const double minRadius, bool fix, bool silent)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:1012
static double myDefaultConnectionLength
Definition: NBEdge.h:1844
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:3782
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1727
void setLaneType(int lane, const std::string &type)
set lane specific type (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3938
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:2555
EdgeBuildingStep
Current state of the edge within the building process.
Definition: NBEdge.h:109
@ LANES2LANES_USER
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
NBEdge * getStraightPredecessor(SVCPermissions permissions) const
return the straightest predecessor edge for the given permissions or nullptr (never returns turn-arou...
Definition: NBEdge.cpp:4627
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1386
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:625
~NBEdge()
Destructor.
Definition: NBEdge.cpp:570
NBNode * myTo
Definition: NBEdge.h:1733
double myEndAngle
Definition: NBEdge.h:1744
const std::string & getID() const
Definition: NBEdge.h:1526
int getFirstAllowedLaneIndex(int direction) const
return the first lane that permits at least 1 vClass or the last lane if search direction of there is...
Definition: NBEdge.cpp:4240
bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition: NBEdge.cpp:4283
double getDistance() const
get distance
Definition: NBEdge.h:685
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:375
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3923
void resetLaneShapes()
reset lane shapes to what they would be before cutting with the junction shapes
Definition: NBEdge.cpp:2147
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:3492
bool bothLeftTurns(LinkDirection dir, const NBEdge *otherFrom, LinkDirection dir2) const
determine conflict between opposite left turns
Definition: NBEdge.cpp:2038
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:4084
const StopOffset & getEdgeStopOffset() const
Returns the stopOffset to the end of the edge.
Definition: NBEdge.cpp:3990
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:3443
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:968
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:3555
NBEdge & operator=(const NBEdge &s)=delete
invalidated assignment operator
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:3430
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > &priorities)
add some straight connections
Definition: NBEdge.cpp:3175
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:2363
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:2485
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:2238
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1241
bool isBidiEdge(bool checkPotential=false) const
whether this edge is part of a bidirectional edge pair
Definition: NBEdge.cpp:773
void setBidi(bool isBidi)
mark this edge as a bidi edge
Definition: NBEdge.h:1421
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:378
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:4330
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:3756
const NBNode * getSignalNode() const
Returns the node that (possibly) represents a traffic signal controlling at the end of this edge.
Definition: NBEdge.h:723
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1801
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:526
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:2443
bool myIsBidi
whether this edge is part of a non-rail bidi edge pair
Definition: NBEdge.h:1832
static double firstIntersection(const PositionVector &v1, const PositionVector &v2, double width1, double width2, const std::string &error="", bool secondIntersection=false)
compute the first intersection point between the given lane geometries considering their rspective wi...
Definition: NBEdge.cpp:1974
PositionVector myToBorder
Definition: NBEdge.h:1825
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:671
void setFriction(int lane, double friction)
set lane specific friction (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4068
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:369
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:381
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:990
static NBEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
Definition: NBEdge.h:354
bool joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
Definition: NBEdge.cpp:4581
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:751
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:3877
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:3481
void addRestrictedLane(double width, SUMOVehicleClass vclass)
add a lane of the given width, restricted to the given class and shift existing connections
Definition: NBEdge.cpp:4364
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false, const bool keepPossibleTurns=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:1402
double myLength
The length of the edge.
Definition: NBEdge.h:1739
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
@brif get first non-pedestrian lane
Definition: NBEdge.cpp:4305
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1483
const std::vector< int > prepareEdgePriorities(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
recomputes the edge priorities and manipulates them for a distribution of lanes on edges which is mor...
Definition: NBEdge.cpp:3257
int myIndex
the index of the edge in the list of all edges. Set by NBEdgeCont and requires re-set whenever the li...
Definition: NBEdge.h:1835
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:3975
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:800
Position geometryPositionAtOffset(double offset) const
return position taking into account loaded length
Definition: NBEdge.cpp:4459
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:372
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1605
double getInternalLaneWidth(const NBNode &node, const NBEdge::Connection &connection, const NBEdge::Lane &successor, bool isVia) const
Returns the width of the internal lane associated with the connection.
Definition: NBEdge.cpp:3959
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3884
bool isConnectedTo(const NBEdge *e, const bool ignoreTurnaround=false) const
Returns the information whethe a connection to the given edge has been added (or computed)
Definition: NBEdge.cpp:1285
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1458
void assignInternalLaneLength(std::vector< Connection >::iterator i, int numLanes, double lengthSum, bool averageLength)
assign length to all lanes of an internal edge
Definition: NBEdge.cpp:1945
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:3475
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Definition: NBEdge.cpp:3845
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1816
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1772
const PositionVector & getNodeBorder(const NBNode *node) const
Definition: NBEdge.cpp:740
int getNumLanesThatAllow(SVCPermissions permissions) const
get lane indices that allow the given permissions
Definition: NBEdge.cpp:4266
const NBNode * mySignalNode
Definition: NBEdge.h:1820
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:2397
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
Definition: NBEdge.h:1500
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1629
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:4254
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:575
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:3457
std::string getLaneID(int lane) const
get lane ID
Definition: NBEdge.cpp:3776
bool myIsOffRamp
whether this edge is an Off-Ramp or leads to one
Definition: NBEdge.h:1829
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:363
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition: NBEdge.h:130
double getFriction() const
Returns the friction on this edge.
Definition: NBEdge.h:632
static PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape)
Definition: NBEdge.cpp:902
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
Definition: NBEdge.cpp:4314
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing, bool withBikes=true) const
Returns the list of lanes that may be used to reach the given edge.
Definition: NBEdge.cpp:1360
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:2174
double getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
Definition: NBEdge.h:561
double getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
Definition: NBEdge.cpp:2111
int getSpecialLane(SVCPermissions permissions) const
return index of the first lane that allows the given permissions
Definition: NBEdge.cpp:4230
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1145
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:2419
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:2057
double myDistance
The mileage/kilometrage at the start of this edge in a linear coordination system.
Definition: NBEdge.h:1758
bool isOffRamp() const
Definition: NBEdge.h:1402
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:1183
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1810
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1335
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:4534
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:675
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:4092
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1804
static void setDefaultConnectionLength(double length)
Definition: NBEdge.h:396
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1374
bool applyTurnSigns()
apply loaded turn sign information
Definition: NBEdge.cpp:2602
bool haveIntersection(const NBNode &n, const PositionVector &shape, const NBEdge *otherFrom, const NBEdge::Connection &otherCon, int numPoints, double width1, double width2, int shapeFlag=0) const
Definition: NBEdge.cpp:2047
NBEdge(const NBEdge &s)=delete
invalidated copy constructor
const NBEdge * getBidiEdge() const
Definition: NBEdge.h:1512
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:545
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1743
double getAngleAtNodeNormalized(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node and disregards edge direction.
Definition: NBEdge.cpp:2094
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:3767
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:4434
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
Definition: NBEdge.cpp:2083
bool hasLaneSpecificType() const
whether lanes differ in type
Definition: NBEdge.cpp:2408
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1824
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.cpp:4184
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:621
void setPriority(int priority)
Sets the priority of the edge.
Definition: NBEdge.h:538
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:592
bool myAmInTLS
Information whether this is lies within a joined tls.
Definition: NBEdge.h:1807
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:2126
bool hasDefaultGeometryEndpointAtNode(const NBNode *node) const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:634
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1769
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:533
void computeEdgeShape(double smoothElevationThreshold=-1)
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:861
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:357
bool hasRestrictedLane(SUMOVehicleClass vclass) const
returns whether any lane already allows the given vclass exclusively
Definition: NBEdge.cpp:4353
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1598
double getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
Definition: NBEdge.h:570
const StopOffset & getLaneStopOffset(int lane) const
Returns the stop offset to the specified lane's end.
Definition: NBEdge.cpp:3996
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
Definition: NBEdge.cpp:4557
Position mySignalPosition
the position of a traffic light signal on this edge
Definition: NBEdge.h:1819
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1495
bool hasConnectionTo(NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1279
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:3469
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:4400
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
Definition: NBEdge.h:1440
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:695
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
Definition: NBEdge.cpp:785
double myFriction
The current friction.
Definition: NBEdge.h:1755
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4006
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:360
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1380
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again
Definition: NBEdge.cpp:2759
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1775
bool addLane2LaneConnections(int fromLane, NBEdge *dest, int toLane, int no, Lane2LaneInfoType type, bool invalidatePrevious=false, bool mayDefinitelyPass=false)
Builds no connections starting at the given lanes.
Definition: NBEdge.cpp:1128
void setOrigID(const std::string origID, const bool append, const int laneIdx=-1)
set origID for all lanes or for a specific lane
Definition: NBEdge.cpp:4491
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:2226
bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition: NBEdge.cpp:4277
static int getLaneIndexFromLaneID(const std::string laneID)
Definition: NBEdge.cpp:4576
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:1138
void setAsMacroscopicConnector()
Definition: NBEdge.h:1131
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition: NBEdge.cpp:2454
bool hasLaneParams() const
whether one of the lanes has parameters set
Definition: NBEdge.cpp:2465
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:962
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:2344
bool prohibitsChanging() const
whether one of the lanes prohibits lane changing
Definition: NBEdge.cpp:2475
void setLoadedLength(double val)
set loaded length
Definition: NBEdge.cpp:4152
const std::string & getTurnSignTarget() const
Definition: NBEdge.h:1551
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1781
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:615
void setSignalPosition(const Position &pos, const NBNode *signalNode)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:728
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:3865
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1733
void append(NBEdge *continuation)
append another edge
Definition: NBEdge.cpp:3703
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:2067
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:4469
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:694
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition: NBEdge.cpp:650
int myPriority
The priority of the edge.
Definition: NBEdge.h:1749
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1813
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1347
int getFirstNonPedestrianNonBicycleLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN, SVC_BICYCLE and 0
Definition: NBEdge.cpp:4213
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:58
Represents a single node (junction) during network building.
Definition: NBNode.h:66
Superclass for NBEdge and NBEdge::Connection to initialize Router.
Definition: NBEdge.h:62
virtual double getLength() const =0
virtual ~NBRouterEdge()
Definition: NBEdge.h:64
static double getTravelTimeStatic(const NBRouterEdge *const edge, const NBVehicle *const, double)
Definition: NBEdge.h:82
bool restricts(const NBVehicle *const) const
Definition: NBEdge.h:77
virtual int getNumericalID() const =0
virtual bool isInternal() const
Definition: NBEdge.h:71
bool prohibits(const NBVehicle *const) const
Definition: NBEdge.h:74
virtual const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const =0
virtual const std::string & getID() const =0
virtual const NBRouterEdge * getBidiEdge() const =0
virtual double getSpeed() const =0
A class representing a single street sign.
Definition: NBSign.h:41
A vehicle as used by router.
Definition: NBVehicle.h:42
Base class for objects which have an id.
Definition: Named.h:54
const std::string & getID() const
Returns the id.
Definition: Named.h:74
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
A list of positions.
double length() const
Returns the length.
static const PositionVector EMPTY
empty Vector
stop offset
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:201
bool indirectLeft
Whether this connection is an indirect left turn.
Definition: NBEdge.h:278
const std::string & getID() const
Definition: NBEdge.h:328
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:227
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:296
int toLane
The lane the connections yields in.
Definition: NBEdge.h:233
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:305
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
Definition: NBEdge.h:269
const Connection * getBidiEdge() const
Definition: NBEdge.h:340
int getNumericalID() const
Definition: NBEdge.h:337
double speed
custom speed for connection
Definition: NBEdge.h:257
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:230
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Definition: NBEdge.h:346
KeepClear keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:248
double getLength() const
Definition: NBEdge.h:334
bool isInternal() const
Definition: NBEdge.h:343
double getSpeed() const
Definition: NBEdge.h:331
Connection(int fromLane_, NBEdge *toEdge_, int toLane_)
Constructor.
Definition: NBEdge.cpp:100
double customLength
custom length for connection
Definition: NBEdge.h:263
std::string edgeType
optional type of Connection
Definition: NBEdge.h:281
double vmax
maximum velocity
Definition: NBEdge.h:290
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:314
PositionVector customShape
custom shape for connection
Definition: NBEdge.h:266
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:245
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this connections internal lane(s)
Definition: NBEdge.h:272
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this connections internal lane(s)
Definition: NBEdge.h:275
PositionVector viaShape
shape of via
Definition: NBEdge.h:299
std::string getDescription(const NBEdge *parent) const
get string describing this connection
Definition: NBEdge.cpp:95
double contPos
custom position for internal junction on this connection
Definition: NBEdge.h:251
std::string getInternalLaneID() const
get ID of internal lane
Definition: NBEdge.cpp:89
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition: NBEdge.h:311
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:236
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:254
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
Definition: NBEdge.h:242
double length
computed length (average of all internal lane shape lengths that share an internal edge)
Definition: NBEdge.h:323
PositionVector shape
shape of Connection
Definition: NBEdge.h:287
std::string id
id of Connection
Definition: NBEdge.h:284
std::vector< std::string > foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:308
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:293
int tlLinkIndex
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:239
double friction
Definition: NBEdge.h:260
double viaLength
the length of the via shape (maybe customized)
Definition: NBEdge.h:302
static ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:327
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:143
double width
This lane's width.
Definition: NBEdge.h:176
StopOffset laneStopOffset
stopOffsets.second - The stop offset for vehicles stopping at the lane's end. Applies if vClass is in...
Definition: NBEdge.h:173
int turnSigns
turning signs printed on the road, bitset of LinkDirection (imported from OSM)
Definition: NBEdge.h:195
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:189
double endOffset
This lane's offset to the intersection begin.
Definition: NBEdge.h:169
std::string type
the type of this lane
Definition: NBEdge.h:192
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:160
double speed
The speed allowed on this lane.
Definition: NBEdge.h:151
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:179
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this lane.
Definition: NBEdge.h:166
double friction
The friction on this lane.
Definition: NBEdge.h:154
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this lane.
Definition: NBEdge.h:163
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:157
bool connectionsDone
Whether connection information for this lane is already completed.
Definition: NBEdge.h:186
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:154
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:182
PositionVector shape
The lane's shape.
Definition: NBEdge.h:148