Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
NBEdge.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 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;
70 virtual const ConstRouterEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING, bool ignoreTransientPermissions = false) 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
125
126
130 enum class Lane2LaneInfoType {
132 COMPUTED,
134 USER,
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_, const bool mayDefinitelyPass_ = false);
208
211
214
217
219 std::string tlID;
220
222 int tlLinkIndex = -1;
223
225 int tlLinkIndex2 = -1;
226
229
232
235
238
241
242 // @brief custom friction for connection
244
247
250
253
256
259
261 bool indirectLeft = false;
262
264 std::string edgeType;
265
267 std::string id;
268
271
274
276 bool haveVia = false;
277
279 std::string viaID;
280
283
285 double viaLength = 0.;
286
288 std::vector<int> foeInternalLinks;
289
291 std::vector<std::string> foeIncomingLanes;
292
296
298 bool uncontrolled = false;
299
301 std::string getInternalLaneID() const;
302
304 std::string getInternalViaLaneID() const;
305
307 std::string getDescription(const NBEdge* parent) const;
308
311
315 const std::string& getID() const {
316 return id;
317 }
318 double getSpeed() const {
319 return vmax;
320 }
321 // @brief needed for NBRouterEdge
322 double getLength() const {
323 return shape.length() + viaShape.length();
324 }
325 int getNumericalID() const {
326 throw ProcessError("NBEdge::Connection does not implement getNumericalID()");
327 }
328 const Connection* getBidiEdge() const {
329 return nullptr;
330 }
331 bool isInternal() const {
332 return true;
333 }
334 const ConstRouterEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING, bool ignoreTransientPermissions = false) const {
335 UNUSED_PARAMETER(vClass);
336 UNUSED_PARAMETER(ignoreTransientPermissions);
337 return myViaSuccessors;
338 }
340 };
341
344
346 static const double UNSPECIFIED_WIDTH;
347
349 static const double UNSPECIFIED_OFFSET;
350
352 static const double UNSPECIFIED_SPEED;
353
355 static const double UNSPECIFIED_FRICTION;
356
358 static const double UNSPECIFIED_CONTPOS;
359
362
364 static const double UNSPECIFIED_LOADED_LENGTH;
365
367 static const double UNSPECIFIED_SIGNAL_OFFSET;
368
370 static const double ANGLE_LOOKAHEAD;
371
374
377
379 static const int TURN_SIGN_SHIFT_BUS = 8;
380 static const int TURN_SIGN_SHIFT_TAXI = 16;
381 static const int TURN_SIGN_SHIFT_BICYCLE = 24;
382
389
390 static void setDefaultConnectionLength(double length) {
392 }
393
394public:
414 NBEdge(const std::string& id,
415 NBNode* from, NBNode* to, std::string type,
416 double speed, double friction, int nolanes, int priority,
417 double width, double endOffset,
418 LaneSpreadFunction spread,
419 const std::string& streetName = "");
420
443 NBEdge(const std::string& id,
444 NBNode* from, NBNode* to, std::string type,
445 double speed, double friction, int nolanes, int priority,
446 double width, double endOffset,
447 PositionVector geom,
448 LaneSpreadFunction spread,
449 const std::string& streetName = "",
450 const std::string& origID = "",
451 bool tryIgnoreNodePositions = false);
452
464 NBEdge(const std::string& id,
465 NBNode* from, NBNode* to,
466 const NBEdge* tpl,
467 const PositionVector& geom = PositionVector(),
468 int numLanes = -1);
469
471 ~NBEdge();
472
473
489 void reinit(NBNode* from, NBNode* to, const std::string& type,
490 double speed, double friction, int nolanes, int priority,
491 PositionVector geom, double width, double endOffset,
492 const std::string& streetName,
493 LaneSpreadFunction spread,
494 bool tryIgnoreNodePositions = false);
495
500 void reinitNodes(NBNode* from, NBNode* to);
501
504
508 void reshiftPosition(double xoff, double yoff);
509
511 void mirrorX();
513
515
516
520 int getNumLanes() const {
521 return (int)myLanes.size();
522 }
523
527 int getPriority() const {
528 return myPriority;
529 }
530
532 void setPriority(int priority) {
533 myPriority = priority;
534 }
535
539 inline NBNode* getFromNode() const {
540 return myFrom;
541 }
542
546 inline NBNode* getToNode() const {
547 return myTo;
548 }
549
555 inline double getStartAngle() const {
556 return myStartAngle;
557 }
558
564 inline double getEndAngle() const {
565 return myEndAngle;
566 }
567
572 double getShapeStartAngle() const;
573
574
580 double getShapeEndAngle() const;
581
586 inline double getTotalAngle() const {
587 return myTotalAngle;
588 }
589
593 double getLength() const {
594 return myLength;
595 }
596
597
602 double getLoadedLength() const {
604 }
605
607 double getFinalLength() const;
608
612 bool hasLoadedLength() const {
613 return myLoadedLength > 0;
614 }
615
619 double getSpeed() const {
620 return mySpeed;
621 }
622
626 double getFriction() const {
627 return myFriction;
628 }
629
636 return myStep;
637 }
638
642 double getLaneWidth() const {
643 return myLaneWidth;
644 }
645
649 double getLaneWidth(int lane) const;
650
660 const NBNode& node,
661 const NBEdge::Connection& connection,
662 const NBEdge::Lane& successor,
663 bool isVia) const;
664
666 double getTotalWidth() const;
667
669 const std::string& getStreetName() const {
670 return myStreetName;
671 }
672
674 void setStreetName(const std::string& name) {
675 myStreetName = name;
676 }
677
679 double getDistance() const {
680 return myDistance;
681 }
682
684 double getDistancAt(double pos) const;
685
689 double getEndOffset() const {
690 return myEndOffset;
691 }
692
696 double getEndOffset(int lane) const;
697
701 const StopOffset& getEdgeStopOffset() const;
702
706 const StopOffset& getLaneStopOffset(int lane) const;
707
709 double getSignalOffset() const;
710
713 return mySignalPosition;
714 }
715
717 const NBNode* getSignalNode() const {
718 return mySignalNode;
719 }
720
722 void setSignalPosition(const Position& pos, const NBNode* signalNode) {
723 mySignalPosition = pos;
724 mySignalNode = signalNode;
725 }
726
730 const std::vector<NBEdge::Lane>& getLanes() const {
731 return myLanes;
732 }
734
739 int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
740
745 int getFirstNonPedestrianNonBicycleLaneIndex(int direction, bool exclusive = false) const;
746
748 int getSpecialLane(SVCPermissions permissions) const;
749
753 int getFirstAllowedLaneIndex(int direction) const;
754
756 NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
757
759 std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
760
761 /* @brief get lane indices that allow the given permissions
762 * @param[in] allPermissions: whether all the given permissions must be allowed (or just some of them)
763 */
764 int getNumLanesThatAllow(SVCPermissions permissions, bool allPermissions = true) const;
765
767 bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const;
768
770 bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const;
771
773 double getCrossingAngle(NBNode* node);
774
776 std::string getSidewalkID();
777
779
780
784 return myGeom;
785 }
786
788 const PositionVector getInnerGeometry() const;
789
791 bool hasDefaultGeometry() const;
792
798 bool hasDefaultGeometryEndpoints() const;
799
805 bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
806
807 Position getEndpointAtNode(const NBNode* node) const;
808
809 void resetEndpointAtNode(const NBNode* node);
810
821 void setGeometry(const PositionVector& g, bool inner = false);
822
832 void addGeometryPoint(int index, const Position& p);
833
835 void extendGeometryAtNode(const NBNode* node, double maxExtent);
836
838 void shortenGeometryAtNode(const NBNode* node, double reduction);
839
841 void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
842
844 Position geometryPositionAtOffset(double offset) const;
845
855 void computeEdgeShape(double smoothElevationThreshold = -1);
856
860 const PositionVector& getLaneShape(int i) const;
861
867
873
877 void reduceGeometry(const double minDist);
878
884 void checkGeometry(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool silent);
886
889
903 bool addEdge2EdgeConnection(NBEdge* dest, bool overrideRemoval = false, SVCPermissions permission = SVC_UNSPECIFIED);
904
925 bool addLane2LaneConnection(int fromLane, NBEdge* dest,
926 int toLane, Lane2LaneInfoType type,
927 bool mayUseSameDestination = false,
928 bool mayDefinitelyPass = false,
930 double contPos = UNSPECIFIED_CONTPOS,
931 double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
932 double speed = UNSPECIFIED_SPEED,
933 double friction = UNSPECIFIED_FRICTION,
934 double length = myDefaultConnectionLength,
935 const PositionVector& customShape = PositionVector::EMPTY,
936 const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
937 SVCPermissions permissions = SVC_UNSPECIFIED,
938 const bool indirectLeft = false,
939 const std::string& edgeType = "",
940 SVCPermissions changeLeft = SVC_UNSPECIFIED,
941 SVCPermissions changeRight = SVC_UNSPECIFIED,
942 bool postProcess = false);
943
961 bool addLane2LaneConnections(int fromLane,
962 NBEdge* dest, int toLane, int no,
963 Lane2LaneInfoType type, bool invalidatePrevious = false,
964 bool mayDefinitelyPass = false);
965
976 bool setConnection(int lane, NBEdge* destEdge,
977 int destLane,
979 bool mayUseSameDestination = false,
980 bool mayDefinitelyPass = false,
982 double contPos = UNSPECIFIED_CONTPOS,
983 double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
984 double speed = UNSPECIFIED_SPEED,
985 double friction = UNSPECIFIED_FRICTION,
986 double length = myDefaultConnectionLength,
987 const PositionVector& customShape = PositionVector::EMPTY,
988 const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
989 SVCPermissions permissions = SVC_UNSPECIFIED,
990 bool indirectLeft = false,
991 const std::string& edgeType = "",
992 SVCPermissions changeLeft = SVC_UNSPECIFIED,
993 SVCPermissions changeRight = SVC_UNSPECIFIED,
994 bool postProcess = false);
995
1006 std::vector<Connection> getConnectionsFromLane(int lane, const NBEdge* to = nullptr, int toLane = -1) const;
1007
1012 const Connection& getConnection(int fromLane, const NBEdge* to, int toLane) const;
1013
1018 Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
1019
1028 bool hasConnectionTo(const NBEdge* destEdge, int destLane, int fromLane = -1) const;
1029
1036 bool isConnectedTo(const NBEdge* e, const bool ignoreTurnaround = false) const;
1037
1041 const std::vector<Connection>& getConnections() const {
1042 return myConnections;
1043 }
1044
1048 std::vector<Connection>& getConnections() {
1049 return myConnections;
1050 }
1051
1056
1061
1066
1070 std::vector<int> getConnectionLanes(NBEdge* currentOutgoing, bool withBikes = true) const;
1071
1074
1077
1083 void remapConnections(const EdgeVector& incoming);
1084
1092 void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false, const bool keepPossibleTurns = false);
1093
1095 bool removeFromConnections(const NBEdge::Connection& connectionToRemove);
1096
1098 void invalidateConnections(bool reallowSetting = false);
1099
1101 void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
1102
1104 void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
1105
1107 void copyConnectionsFrom(NBEdge* src);
1108
1110 void shiftToLanesToEdge(NBEdge* to, int laneOff);
1112
1118 bool isTurningDirectionAt(const NBEdge* const edge) const;
1119
1124 void setTurningDestination(NBEdge* e, bool onlyPossible = false);
1125
1132
1138 }
1139
1141 void setInsideTLS(bool inside) {
1142 myAmInTLS = inside;
1143 }
1144
1148 bool isInsideTLS() const {
1149 return myAmInTLS;
1150 }
1152
1158 void setJunctionPriority(const NBNode* const node, int prio);
1159
1169 int getJunctionPriority(const NBNode* const node) const;
1170
1172 void setLoadedLength(double val);
1173
1175 void setAverageLengthWithOpposite(double val);
1176
1179
1181 const std::string& getTypeID() const {
1182 return myType;
1183 }
1184
1186 bool needsLaneSpecificOutput() const;
1187
1189 bool hasPermissions() const;
1190
1192 bool hasLaneSpecificPermissions() const;
1193
1195 bool hasLaneSpecificSpeed() const;
1196
1198 bool hasLaneSpecificFriction() const;
1199
1201 bool hasLaneSpecificWidth() const;
1202
1204 bool hasLaneSpecificType() const;
1205
1207 bool hasLaneSpecificEndOffset() const;
1208
1210 bool hasLaneSpecificStopOffsets() const;
1211
1213 bool hasAccelLane() const;
1214
1216 bool hasCustomLaneShape() const;
1217
1219 bool hasLaneParams() const;
1220
1222 bool prohibitsChanging() const;
1223
1225 bool computeEdge2Edges(bool noLeftMovers);
1226
1228 bool computeLanes2Edges();
1229
1231 bool recheckLanes();
1232
1234 void recheckOpposite(const NBEdgeCont& ec, bool fixOppositeLengths);
1235
1244 void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions);
1245
1249 NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1250
1252 double getMaxLaneOffset();
1253
1255 bool lanesWereAssigned() const;
1256
1258 bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1259
1261 bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1262
1265
1267 PositionVector getCWBoundaryLine(const NBNode& n) const;
1268
1271
1273 bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1274
1276 void append(NBEdge* continuation);
1277
1279 bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1280
1282 void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1283
1284 /* @brief return the turn destination if it exists
1285 * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1286 * exists
1287 */
1288 NBEdge* getTurnDestination(bool possibleDestination = false) const;
1289
1291 std::string getLaneID(int lane) const;
1292
1294 double getLaneSpeed(int lane) const;
1295
1297 double getLaneFriction(int lane) const;
1298
1300 bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1301
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, SVCPermissions vclasses);
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
1426 bool isBidi() {
1427 return myIsBidi;
1428 }
1429
1430 // @brief returns a reference to the internal structure for the convenience of netedit
1431 Lane& getLaneStruct(int lane) {
1432 assert(lane >= 0);
1433 assert(lane < (int)myLanes.size());
1434 return myLanes[lane];
1435 }
1436
1437 // @brief returns a reference to the internal structure for the convenience of netedit
1438 const Lane& getLaneStruct(int lane) const {
1439 assert(lane >= 0);
1440 assert(lane < (int)myLanes.size());
1441 return myLanes[lane];
1442 }
1443
1448
1449 /* @brief fill connection attributes shape, viaShape, ...
1450 *
1451 * @param[in,out] edgeIndex The number of connections already handled
1452 * @param[in,out] splitIndex The number of via edges already built
1453 * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1454 */
1455 double buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1456
1458 inline const std::vector<NBSign>& getSigns() const {
1459 return mySigns;
1460 }
1461
1463 inline void addSign(NBSign sign) {
1464 mySigns.push_back(sign);
1465 }
1466
1469
1471 void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1472 const PositionVector& getNodeBorder(const NBNode* node) const;
1473 void resetNodeBorder(const NBNode* node);
1474
1476 bool isBidiRail(bool ignoreSpread = false) const;
1477
1479 bool isBidiEdge(bool checkPotential = false) const;
1480
1482 bool isRailDeadEnd() const;
1483
1485 void debugPrintConnections(bool outgoing = true, bool incoming = false) const;
1486
1488 static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width1, double width2, const std::string& error = "", bool secondIntersection = false);
1489
1493 static PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape);
1494
1496
1497
1498 static inline double getTravelTimeStatic(const NBEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
1499 return edge->getLength() / edge->getSpeed();
1500 }
1501
1502 static int getLaneIndexFromLaneID(const std::string laneID);
1503
1505 void setNumericalID(int index) {
1506 myIndex = index;
1507 }
1508
1513 int getNumericalID() const {
1514 return myIndex;
1515 }
1516
1517 const NBEdge* getBidiEdge() const {
1518 return isBidiRail() || isBidiEdge() ? myPossibleTurnDestination : nullptr;
1519 }
1520
1524
1525
1528 const ConstRouterEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING, bool ignoreTransientPermissions = false) const;
1529
1531 const std::string& getID() const {
1532 return Named::getID();
1533 }
1534
1536 bool joinLanes(SVCPermissions perms);
1537
1539 void resetLaneShapes();
1540
1543
1546 NBEdge* getStraightContinuation(SVCPermissions permissions) const;
1547
1550 NBEdge* getStraightPredecessor(SVCPermissions permissions) const;
1551
1553 NBEdge* guessOpposite(bool reguess = false);
1554
1555
1556 const std::string& getTurnSignTarget() const {
1557 return myTurnSignTarget;
1558 }
1559
1560 void setTurnSignTarget(const std::string& target) {
1561 myTurnSignTarget = target;
1562 }
1563
1565 static EdgeVector filterByPermissions(const EdgeVector& edges, SVCPermissions permissions);
1566
1567private:
1572 private:
1574 std::map<NBEdge*, std::vector<int> > myConnections;
1575
1578
1579 public:
1582 : myTransitions(transitions) { }
1583
1586
1588 void execute(const int lane, const int virtEdge);
1589
1591 const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1592 return myConnections;
1593 }
1594
1595 private:
1598
1601 };
1602
1603
1612 public:
1614 enum class Direction {
1615 RIGHTMOST,
1616 LEFTMOST,
1617 FORWARD
1618 };
1619
1620 public:
1622 MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, const std::vector<int>& availableLanes);
1623
1626
1628 int getStraightest() const {
1629 return myStraightest;
1630 }
1631
1633 bool empty() const;
1634
1636 bool includes(Direction d) const;
1637
1638 private:
1641
1643 std::vector<Direction> myDirs;
1644
1647
1650 };
1651
1653 PositionVector computeLaneShape(int lane, double offset) const;
1654
1656 void computeLaneShapes();
1657
1658private:
1675 void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1676
1678 void divideOnEdges(const EdgeVector* outgoing);
1679
1681 void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1682
1684 void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>& priorities);
1685
1687 const std::vector<int> prepareEdgePriorities(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1688
1691
1694 void moveConnectionToLeft(int lane);
1695
1699 void moveConnectionToRight(int lane);
1700
1702 bool canMoveConnection(const Connection& con, int newFromLane) const;
1704
1706 void computeAngle();
1707
1709 bool bothLeftTurns(LinkDirection dir, const NBEdge* otherFrom, LinkDirection dir2) const;
1710 bool haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon,
1711 int numPoints, double width1, double width2, int shapeFlag = 0) const;
1712
1714 bool hasRestrictedLane(SUMOVehicleClass vclass) const;
1715
1717 void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1718
1720 double assignInternalLaneLength(std::vector<Connection>::iterator i, int numLanes, double lengthSum, bool averageLength);
1721
1723 static std::vector<LinkDirection> decodeTurnSigns(int turnSigns, int shift = 0);
1724 static void updateTurnPermissions(SVCPermissions& perm, LinkDirection dir, SVCPermissions spec, std::vector<LinkDirection> dirs);
1725
1727 bool applyTurnSigns();
1728
1729 /* @brief remove connections with incompatible permissions (should only be
1730 * called for guessed connections) */
1732
1733private:
1738
1740 std::string myType;
1741
1744
1746 std::string myTurnSignTarget;
1747
1749 double myLength;
1750
1757
1760
1762 double mySpeed;
1763
1766
1769
1773 std::vector<Connection> myConnections;
1774
1776 std::vector<Connection> myConnectionsToDelete;
1777
1780
1783
1786
1789
1792
1795
1798
1804
1807
1811 std::vector<Lane> myLanes;
1812
1815
1818
1821
1823 std::string myStreetName;
1824
1826 std::vector<NBSign> mySigns;
1827
1831
1837
1840
1843
1846
1847 // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1849
1850 // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1852
1853 // @brief default length for overriding connection lengths
1855
1856public:
1857
1860 public:
1862 connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1863 myHasFromLane(hasFromLane),
1864 myEdge2Find(edge2find) { }
1865
1867 bool operator()(const Connection& c) const {
1868 return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1869 }
1870
1871 private:
1873 const bool myHasFromLane;
1874
1876 const NBEdge* const myEdge2Find;
1877 };
1878
1881 public:
1883 connections_toedgelane_finder(const NBEdge* const edge2find, int lane2find, int fromLane2find) :
1884 myEdge2Find(edge2find),
1885 myLane2Find(lane2find),
1886 myFromLane2Find(fromLane2find) { }
1887
1889 bool operator()(const Connection& c) const {
1890 return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1891 }
1892
1893 private:
1895 const NBEdge* const myEdge2Find;
1896
1899
1902 };
1903
1906 public:
1908 connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1909 myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1910
1912 bool operator()(const Connection& c) const {
1913 return ((c.fromLane == myFromLane || myFromLane == -1)
1915 && (c.toLane == myLane2Find || myLane2Find == -1));
1916 }
1917
1918 private:
1921
1924
1927
1930 };
1931
1934 public:
1936 connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1937 myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1938
1940 bool operator()(const Connection& c) const {
1941 return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1942 && c.fromLane >= 0 // already assigned
1943 && c.toEdge == myEdge2Find);
1944 }
1945
1946 private:
1949
1952
1955 };
1956
1959 public:
1961 connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1962
1964 bool operator()(const Connection& c) const {
1965 return c.fromLane == myLane2Find;
1966 }
1967
1968 private:
1971
1972 private:
1975 };
1976
1978 static bool connections_sorter(const Connection& c1, const Connection& c2);
1979
1985 public:
1988
1989 public:
1991 int operator()(const Connection& c1, const Connection& c2) const;
1992
1993 private:
1996 };
1997
1998private:
2000 NBEdge(const NBEdge& s) = delete;
2001
2003 NBEdge& operator=(const NBEdge& s) = delete;
2004
2006 NBEdge();
2007};
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
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
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)....
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:1611
bool empty() const
returns the information whether no following street has a higher priority
Definition NBEdge.cpp:230
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:236
int getStraightest() const
returns the index of the straightmost among the given outgoing edges
Definition NBEdge.h:1628
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition NBEdge.h:1643
~MainDirections()
destructor
Definition NBEdge.cpp:226
MainDirections & operator=(const MainDirections &)=delete
Invalidated assignment operator.
int myStraightest
the index of the straightmost among the given outgoing edges
Definition NBEdge.h:1640
Direction
enum of possible directions
Definition NBEdge.h:1614
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition NBEdge.h:1571
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition NBEdge.h:1591
ToEdgeConnectionsAdder(const ToEdgeConnectionsAdder &)=delete
Invalidated copy constructor.
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)=delete
Invalidated assignment operator.
~ToEdgeConnectionsAdder()
destructor
Definition NBEdge.h:1585
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition NBEdge.h:1581
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition NBEdge.h:1577
void execute(const int lane, const int virtEdge)
executes a bresenham - step
Definition NBEdge.cpp:142
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
Definition NBEdge.h:1574
NBEdge *const myEdge2Find
edge to find
Definition NBEdge.h:1951
bool operator()(const Connection &c) const
operator ()
Definition NBEdge.h:1940
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition NBEdge.h:1936
bool myCheckRight
check if is right
Definition NBEdge.h:1954
int myFromLane
index of from lane
Definition NBEdge.h:1948
int myLane2Find
lane to find
Definition NBEdge.h:1926
bool operator()(const Connection &c) const
operator ()
Definition NBEdge.h:1912
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition NBEdge.h:1908
NBEdge *const myEdge2Find
edge to find
Definition NBEdge.h:1923
int myFromLane
index of from lane
Definition NBEdge.h:1920
bool myInvertEdge2find
invert edge to find
Definition NBEdge.h:1929
int myLane2Find
index of lane to find
Definition NBEdge.h:1970
bool operator()(const Connection &c) const
operator ()
Definition NBEdge.h:1964
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)=delete
invalidated assignment operator
connections_fromlane_finder(int lane2find)
@briefconstructor
Definition NBEdge.h:1961
Class to sort edges by their angle.
Definition NBEdge.h:1984
NBEdge * myEdge
the edge to compute the relative angle of
Definition NBEdge.h:1995
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
Definition NBEdge.cpp:245
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition NBEdge.h:1987
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition NBEdge.h:1862
const bool myHasFromLane
check if has from lane
Definition NBEdge.h:1873
bool operator()(const Connection &c) const
operator ()
Definition NBEdge.h:1867
const NBEdge *const myEdge2Find
edge to find
Definition NBEdge.h:1876
bool operator()(const Connection &c) const
operator ()
Definition NBEdge.h:1889
int myFromLane2Find
from lane to find
Definition NBEdge.h:1901
const NBEdge *const myEdge2Find
edge to find
Definition NBEdge.h:1895
connections_toedgelane_finder(const NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition NBEdge.h:1883
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:674
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:386
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition NBEdge.cpp:1004
static std::vector< LinkDirection > decodeTurnSigns(int turnSigns, int shift=0)
decode bitset
Definition NBEdge.cpp:2668
void mirrorX()
mirror coordinates along the x-axis
Definition NBEdge.cpp:570
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition NBEdge.cpp:4446
static const int TURN_SIGN_SHIFT_BUS
shift values for decoding turn signs
Definition NBEdge.h:379
double getLaneSpeed(int lane) const
get lane speed
Definition NBEdge.cpp:2210
static const int TURN_SIGN_SHIFT_BICYCLE
Definition NBEdge.h:381
NBEdge * guessOpposite(bool reguess=false)
set oppositeID and return opposite edge if found
Definition NBEdge.cpp:4983
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:4460
double getLength() const
Returns the computed length of the edge.
Definition NBEdge.h:593
double myLaneWidth
This width of this edge's lanes.
Definition NBEdge.h:1806
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition NBEdge.cpp:4469
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition NBEdge.h:1776
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition NBEdge.cpp:1344
double getDistancAt(double pos) const
get distance at the given offset
Definition NBEdge.cpp:5011
double myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
Definition NBEdge.h:1797
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition NBEdge.h:1041
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition NBEdge.h:1788
const Position & getSignalPosition() const
Returns the position of a traffic signal on this edge.
Definition NBEdge.h:712
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:4432
bool isInsideTLS() const
Returns whether this edge was marked as being within an intersection.
Definition NBEdge.h:1148
StopOffset myEdgeStopOffset
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
Definition NBEdge.h:1803
JunctionPriority
junction priority values set by setJunctionPriority
Definition NBEdge.h:384
@ ROUNDABOUT
Definition NBEdge.h:387
@ PRIORITY_ROAD
Definition NBEdge.h:386
@ MINOR_ROAD
Definition NBEdge.h:385
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition NBEdge.h:602
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition NBEdge.cpp:4622
const Lane & getLaneStruct(int lane) const
Definition NBEdge.h:1438
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition NBEdge.cpp:4675
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition NBEdge.cpp:3924
double getLaneFriction(int lane) const
get lane friction of specified lane
Definition NBEdge.cpp:2216
void recheckOpposite(const NBEdgeCont &ec, bool fixOppositeLengths)
recheck whether all opposite and bidi settings are consistent
Definition NBEdge.cpp:3165
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Returns the following edges for the given vClass.
Definition NBEdge.cpp:4874
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition NBEdge.cpp:463
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition NBEdge.cpp:4384
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition NBEdge.cpp:437
double mySpeed
The maximal speed.
Definition NBEdge.h:1762
bool hasLaneSpecificFriction() const
whether lanes differ in friction
Definition NBEdge.cpp:2462
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition NBEdge.h:642
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition NBEdge.cpp:3888
NBNode * getToNode() const
Returns the destination node of the edge.
Definition NBEdge.h:546
void checkGeometry(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool silent)
Check the angles of successive geometry segments.
Definition NBEdge.cpp:1036
std::vector< Connection > myConnections
List of connections to following edges.
Definition NBEdge.h:1773
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:1313
NBEdge()
constructor for dummy edge
Definition NBEdge.cpp:363
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition NBEdge.cpp:3305
ConstRouterEdgePairVector myViaSuccessors
Definition NBEdge.h:1851
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:3906
double buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition NBEdge.cpp:1694
static const double UNSPECIFIED_FRICTION
unspecified lane friction
Definition NBEdge.h:355
void incLaneNo(int by)
increment lane
Definition NBEdge.cpp:4165
static EdgeVector filterByPermissions(const EdgeVector &edges, SVCPermissions permissions)
return only those edges that permit at least one of the give permissions
Definition NBEdge.cpp:4941
Lane & getLaneStruct(int lane)
Definition NBEdge.h:1431
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:1301
const std::vector< NBSign > & getSigns() const
get Signs
Definition NBEdge.h:1458
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
Definition NBEdge.cpp:4121
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:2452
void setAverageLengthWithOpposite(double val)
patch average lane length in regard to the opposite edge
Definition NBEdge.cpp:4489
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition NBEdge.cpp:4228
void removeInvalidConnections()
Definition NBEdge.cpp:3243
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition NBEdge.cpp:2411
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition NBEdge.h:373
bool isBidi()
return whether this edge should be a bidi edge
Definition NBEdge.h:1426
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:3675
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition NBEdge.cpp:4504
std::string myType
The type of the edge.
Definition NBEdge.h:1740
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition NBEdge.h:783
bool hasPermissions() const
whether at least one lane has restrictions
Definition NBEdge.cpp:2427
double myTotalAngle
Definition NBEdge.h:1755
std::vector< Connection > & getConnections()
Returns the connections.
Definition NBEdge.h:1048
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition NBEdge.cpp:998
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition NBEdge.cpp:602
std::string myTurnSignTarget
node for which turnSign information applies
Definition NBEdge.h:1746
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition NBEdge.cpp:749
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
Definition NBEdge.h:376
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition NBEdge.cpp:4856
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition NBEdge.cpp:4495
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition NBEdge.cpp:2577
EdgeBuildingStep getStep() const
The building step of this edge.
Definition NBEdge.h:635
void setInsideTLS(bool inside)
Marks this edge being within an intersection.
Definition NBEdge.h:1141
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition NBEdge.h:1794
void moveConnectionToLeft(int lane)
Definition NBEdge.cpp:1660
void updateChangeRestrictions(SVCPermissions ignoring)
modify all existing restrictions on lane changing
Definition NBEdge.cpp:2228
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition NBEdge.cpp:4681
Position getEndpointAtNode(const NBNode *node) const
Definition NBEdge.cpp:620
NBEdge * getStraightContinuation(SVCPermissions permissions) const
return the straightest follower edge for the given permissions or nullptr (never returns turn-arounds...
Definition NBEdge.cpp:4952
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition NBEdge.h:612
void resetEndpointAtNode(const NBNode *node)
Definition NBEdge.cpp:625
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition NBEdge.cpp:4669
bool addEdge2EdgeConnection(NBEdge *dest, bool overrideRemoval=false, SVCPermissions permission=SVC_UNSPECIFIED)
Adds a connection to another edge.
Definition NBEdge.cpp:1097
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:1133
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
divide selected lanes on edges
Definition NBEdge.cpp:3395
int getNumericalID() const
Returns the index (numeric id) of the edge.
Definition NBEdge.h:1513
void setTurnSignTarget(const std::string &target)
Definition NBEdge.h:1560
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:1498
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:4354
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition NBEdge.h:730
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
Definition NBEdge.cpp:2505
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition NBEdge.cpp:695
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition NBEdge.cpp:4529
EdgeVector mySuccessors
Definition NBEdge.h:1848
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition NBEdge.cpp:4759
static double myDefaultConnectionLength
Definition NBEdge.h:1854
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition NBEdge.cpp:4113
EdgeBuildingStep myStep
The building step.
Definition NBEdge.h:1737
void setLaneType(int lane, const std::string &type)
set lane specific type (negative lane implies set for all lanes)
Definition NBEdge.cpp:4270
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition NBEdge.cpp:2633
EdgeBuildingStep
Current state of the edge within the building process.
Definition NBEdge.h:109
@ INIT_REJECT_CONNECTIONS
The edge has been loaded and connections shall not be added.
@ EDGE2EDGES
The relationships between edges are computed/loaded.
@ LANES2LANES_RECHECK
Lanes to lanes - relationships are computed; should be rechecked.
@ LANES2LANES_DONE
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
@ LANES2EDGES
Lanes to edges - relationships are computed/loaded.
@ LANES2LANES_USER
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
@ INIT
The edge has been loaded, nothing is computed yet.
NBEdge * getStraightPredecessor(SVCPermissions permissions) const
return the straightest predecessor edge for the given permissions or nullptr (never returns turn-arou...
Definition NBEdge.cpp:4967
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition NBEdge.cpp:1432
double getSpeed() const
Returns the speed allowed on this edge.
Definition NBEdge.h:619
~NBEdge()
Destructor.
Definition NBEdge.cpp:545
NBNode * myTo
Definition NBEdge.h:1743
double myEndAngle
Definition NBEdge.h:1754
const std::string & getID() const
Definition NBEdge.h:1531
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:4572
bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition NBEdge.cpp:4616
double getDistance() const
get distance
Definition NBEdge.h:679
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition NBEdge.h:364
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition NBEdge.cpp:4255
void resetLaneShapes()
reset lane shapes to what they would be before cutting with the junction shapes
Definition NBEdge.cpp:2222
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition NBEdge.cpp:3817
bool bothLeftTurns(LinkDirection dir, const NBEdge *otherFrom, LinkDirection dir2) const
determine conflict between opposite left turns
Definition NBEdge.cpp:2115
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition NBEdge.cpp:4416
const StopOffset & getEdgeStopOffset() const
Returns the stopOffset to the end of the edge.
Definition NBEdge.cpp:4322
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition NBEdge.cpp:3768
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition NBEdge.cpp:992
void clearControllingTLInformation()
clears tlID for all connections
Definition NBEdge.cpp:3880
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:3755
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > &priorities)
add some straight connections
Definition NBEdge.cpp:3500
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition NBEdge.cpp:2438
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition NBEdge.cpp:2560
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition NBEdge.cpp:2313
bool isBidiEdge(bool checkPotential=false) const
whether this edge is part of a bidirectional edge pair
Definition NBEdge.cpp:761
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:367
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition NBEdge.cpp:4663
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition NBEdge.cpp:4087
const NBNode * getSignalNode() const
Returns the node that (possibly) represents a traffic signal controlling at the end of this edge.
Definition NBEdge.h:717
std::vector< Lane > myLanes
Lane information.
Definition NBEdge.h:1811
int getNumLanes() const
Returns the number of lanes.
Definition NBEdge.h:520
std::vector< Connection > getConnectionsFromLane(int lane, const NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition NBEdge.cpp:1287
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition NBEdge.cpp:2518
bool myIsBidi
whether this edge is part of a non-rail bidi edge pair
Definition NBEdge.h:1842
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:2051
PositionVector myToBorder
Definition NBEdge.h:1835
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition NBEdge.cpp:658
void setFriction(int lane, double friction)
set lane specific friction (negative lane implies set for all lanes)
Definition NBEdge.cpp:4400
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition NBEdge.h:358
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition NBEdge.h:370
int getNumLanesThatAllow(SVCPermissions permissions, bool allPermissions=true) const
Definition NBEdge.cpp:4598
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition NBEdge.cpp:1014
static NBEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
Definition NBEdge.h:343
bool joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
Definition NBEdge.cpp:4921
void resetNodeBorder(const NBNode *node)
Definition NBEdge.cpp:738
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition NBEdge.cpp:4208
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition NBEdge.cpp:3806
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:4697
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:1448
double myLength
The length of the edge.
Definition NBEdge.h:1749
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
@brif get first non-pedestrian lane
Definition NBEdge.cpp:4638
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition NBEdge.cpp:1529
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:3582
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:1845
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition NBEdge.cpp:4307
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition NBEdge.cpp:794
Position geometryPositionAtOffset(double offset) const
return position taking into account loaded length
Definition NBEdge.cpp:4799
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition NBEdge.h:361
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition NBEdge.cpp:1651
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:4291
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition NBEdge.cpp:4215
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:1331
void addSign(NBSign sign)
add Sign
Definition NBEdge.h:1463
double getMaxLaneOffset()
get max lane offset
Definition NBEdge.cpp:3800
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Definition NBEdge.cpp:4176
std::vector< NBSign > mySigns
the street signs along this edge
Definition NBEdge.h:1826
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition NBEdge.h:1782
const PositionVector & getNodeBorder(const NBNode *node) const
Definition NBEdge.cpp:727
const NBNode * mySignalNode
Definition NBEdge.h:1830
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition NBEdge.cpp:2472
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
Definition NBEdge.h:1505
void moveConnectionToRight(int lane)
Definition NBEdge.cpp:1678
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition NBEdge.cpp:4586
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition NBEdge.cpp:550
static const int TURN_SIGN_SHIFT_TAXI
Definition NBEdge.h:380
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition NBEdge.cpp:3782
std::string getLaneID(int lane) const
get lane ID
Definition NBEdge.cpp:4107
bool myIsOffRamp
whether this edge is an Off-Ramp or leads to one
Definition NBEdge.h:1839
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition NBEdge.h:352
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition NBEdge.h:130
@ USER
The connection was given by the user.
@ VALIDATED
The connection was computed and validated.
@ COMPUTED
The connection was computed.
double getFriction() const
Returns the friction on this edge.
Definition NBEdge.h:626
static PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape)
Definition NBEdge.cpp:926
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
Definition NBEdge.cpp:4647
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:1406
void computeLaneShapes()
compute lane shapes
Definition NBEdge.cpp:2249
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:555
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:2186
int getSpecialLane(SVCPermissions permissions) const
return index of the first lane that allows the given permissions
Definition NBEdge.cpp:4562
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:1186
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition NBEdge.cpp:2494
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition NBEdge.cpp:2134
double myDistance
The mileage/kilometrage at the start of this edge in a linear coordination system.
Definition NBEdge.h:1768
bool isOffRamp() const
Definition NBEdge.h:1402
const std::string & getTypeID() const
get ID of type
Definition NBEdge.h:1181
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition NBEdge.h:1820
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition NBEdge.cpp:1381
const std::string & getStreetName() const
Returns the street name of this edge.
Definition NBEdge.h:669
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition NBEdge.cpp:4424
double myLoadedLength
An optional length to use (-1 if not valid)
Definition NBEdge.h:1814
static void updateTurnPermissions(SVCPermissions &perm, LinkDirection dir, SVCPermissions spec, std::vector< LinkDirection > dirs)
Definition NBEdge.cpp:2680
static void setDefaultConnectionLength(double length)
Definition NBEdge.h:390
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition NBEdge.cpp:1420
bool applyTurnSigns()
apply loaded turn sign information
Definition NBEdge.cpp:2691
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:2124
NBEdge(const NBEdge &s)=delete
invalidated copy constructor
void preferVehicleClass(int lane, SVCPermissions vclasses)
prefer certain vehicle classes for the given lane or for all lanes if -1 is given (ensures also permi...
Definition NBEdge.cpp:4241
const NBEdge * getBidiEdge() const
Definition NBEdge.h:1517
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition NBEdge.h:539
double myStartAngle
The angles of the edge.
Definition NBEdge.h:1753
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:2170
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition NBEdge.cpp:4098
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition NBEdge.cpp:4770
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
Definition NBEdge.cpp:2160
bool hasLaneSpecificType() const
whether lanes differ in type
Definition NBEdge.cpp:2483
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition NBEdge.h:1834
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition NBEdge.cpp:4516
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition NBEdge.cpp:596
void setPriority(int priority)
Sets the priority of the edge.
Definition NBEdge.h:532
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition NBEdge.h:586
bool myAmInTLS
Information whether this is lies within a joined tls.
Definition NBEdge.h:1817
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition NBEdge.cpp:2201
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:609
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition NBEdge.h:1779
int getPriority() const
Returns the priority of the edge.
Definition NBEdge.h:527
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:885
double assignInternalLaneLength(std::vector< Connection >::iterator i, int numLanes, double lengthSum, bool averageLength)
assign length to all lanes of an internal edge
Definition NBEdge.cpp:2011
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition NBEdge.h:346
bool hasRestrictedLane(SUMOVehicleClass vclass) const
returns whether any lane already allows the given vclass exclusively
Definition NBEdge.cpp:4686
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition NBEdge.cpp:1644
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:564
const StopOffset & getLaneStopOffset(int lane) const
Returns the stop offset to the specified lane's end.
Definition NBEdge.cpp:4328
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
Definition NBEdge.cpp:4897
Position mySignalPosition
the position of a traffic light signal on this edge
Definition NBEdge.h:1829
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition NBEdge.cpp:1541
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition NBEdge.cpp:3794
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition NBEdge.cpp:4736
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:1445
double getEndOffset() const
Returns the offset to the destination node.
Definition NBEdge.h:689
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
Definition NBEdge.cpp:779
double myFriction
The current friction.
Definition NBEdge.h:1765
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition NBEdge.cpp:4338
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition NBEdge.h:349
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition NBEdge.cpp:1426
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again
Definition NBEdge.cpp:2921
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition NBEdge.h:1785
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:1169
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:4831
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition NBEdge.cpp:2301
bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition NBEdge.cpp:4610
static int getLaneIndexFromLaneID(const std::string laneID)
Definition NBEdge.cpp:4916
bool hasConnectionTo(const NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
Definition NBEdge.cpp:1325
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition NBEdge.h:1136
void setAsMacroscopicConnector()
Definition NBEdge.h:1129
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition NBEdge.cpp:2529
bool hasLaneParams() const
whether one of the lanes has parameters set
Definition NBEdge.cpp:2540
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition NBEdge.cpp:986
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition NBEdge.cpp:2419
bool prohibitsChanging() const
whether one of the lanes prohibits lane changing
Definition NBEdge.cpp:2550
void setLoadedLength(double val)
set loaded length
Definition NBEdge.cpp:4484
const std::string & getTurnSignTarget() const
Definition NBEdge.h:1556
PositionVector myGeom
The geometry for the edge.
Definition NBEdge.h:1791
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition NBEdge.cpp:590
void setSignalPosition(const Position &pos, const NBNode *signalNode)
sets the offset of a traffic signal from the end of this edge
Definition NBEdge.h:722
void decLaneNo(int by)
decrement lane
Definition NBEdge.cpp:4196
NBNode * myFrom
The source and the destination node.
Definition NBEdge.h:1743
void append(NBEdge *continuation)
append another edge
Definition NBEdge.cpp:4036
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition NBEdge.cpp:2144
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition NBEdge.cpp:4809
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition NBEdge.cpp:681
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition NBEdge.cpp:637
int myPriority
The priority of the edge.
Definition NBEdge.h:1759
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition NBEdge.h:1823
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition NBEdge.cpp:1393
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:4545
Container for nodes during the netbuilding process.
Definition NBNodeCont.h:57
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 std::string & getID() const =0
virtual const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) 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.
An upper class for objects with additional parameters.
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
#define UNUSED_PARAMETER(x)
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:261
const std::string & getID() const
Definition NBEdge.h:315
int fromLane
The lane the connections starts at.
Definition NBEdge.h:210
std::string viaID
if Connection have a via, ID of it
Definition NBEdge.h:279
int toLane
The lane the connections yields in.
Definition NBEdge.h:216
std::vector< int > foeInternalLinks
FOE Internal links.
Definition NBEdge.h:288
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
Definition NBEdge.h:252
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Definition NBEdge.h:334
const Connection * getBidiEdge() const
Definition NBEdge.h:328
int getNumericalID() const
Definition NBEdge.h:325
std::string getInternalViaLaneID() const
get ID of internal lane (second part)
Definition NBEdge.cpp:98
double speed
custom speed for connection
Definition NBEdge.h:240
NBEdge * toEdge
The edge the connections yields in.
Definition NBEdge.h:213
KeepClear keepClear
whether the junction must be kept clear when using this connection
Definition NBEdge.h:231
double getLength() const
Definition NBEdge.h:322
bool isInternal() const
Definition NBEdge.h:331
double getSpeed() const
Definition NBEdge.h:318
double customLength
custom length for connection
Definition NBEdge.h:246
std::string edgeType
optional type of Connection
Definition NBEdge.h:264
double vmax
maximum velocity
Definition NBEdge.h:273
bool uncontrolled
check if Connection is uncontrolled
Definition NBEdge.h:298
PositionVector customShape
custom shape for connection
Definition NBEdge.h:249
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition NBEdge.h:228
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this connections internal lane(s)
Definition NBEdge.h:255
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this connections internal lane(s)
Definition NBEdge.h:258
PositionVector viaShape
shape of via
Definition NBEdge.h:282
std::string getDescription(const NBEdge *parent) const
get string describing this connection
Definition NBEdge.cpp:104
double contPos
custom position for internal junction on this connection
Definition NBEdge.h:234
std::string getInternalLaneID() const
get ID of internal lane
Definition NBEdge.cpp:92
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition NBEdge.h:294
std::string tlID
The id of the traffic light that controls this connection.
Definition NBEdge.h:219
int internalViaLaneIndex
Definition NBEdge.h:295
double visibility
custom foe visiblity for connection
Definition NBEdge.h:237
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
Definition NBEdge.h:225
double length
computed length (average of all internal lane shape lengths that share an internal edge)
Definition NBEdge.h:310
PositionVector shape
shape of Connection
Definition NBEdge.h:270
std::string id
id of Connection
Definition NBEdge.h:267
std::vector< std::string > foeIncomingLanes
FOE Incomings lanes.
Definition NBEdge.h:291
bool haveVia
check if Connection have a Via
Definition NBEdge.h:276
int tlLinkIndex
The index of this connection within the controlling traffic light.
Definition NBEdge.h:222
double viaLength
the length of the via shape (maybe customized)
Definition NBEdge.h:285
static ConstRouterEdgePairVector myViaSuccessors
Definition NBEdge.h:314
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
bool accelRamp
Whether this lane is an acceleration lane.
Definition NBEdge.h:182
PositionVector shape
The lane's shape.
Definition NBEdge.h:148