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.dev/sumo
3 // Copyright (C) 2001-2024 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>
34 #include <utils/geom/Bresenham.h>
38 #include "NBCont.h"
39 #include "NBHelpers.h"
40 #include "NBSign.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class NBNode;
47 class NBConnection;
48 class NBNodeCont;
49 class NBEdgeCont;
50 class OutputDevice;
51 class GNELane;
52 class NBVehicle;
53 
54 
55 // ===========================================================================
56 // class definitions
57 // ===========================================================================
62 class NBRouterEdge {
63 public:
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 
92 class 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 
100 public:
101 
109  enum class EdgeBuildingStep {
113  INIT,
115  EDGE2EDGES,
117  LANES2EDGES,
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 
182  bool accelRamp;
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 
210  int fromLane;
211 
214 
216  int toLane;
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 
246  double customLength;
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 
295 
297  bool uncontrolled = false;
298 
300  std::string getInternalLaneID() const;
301 
303  std::string getDescription(const NBEdge* parent) const;
304 
307 
311  const std::string& getID() const {
312  return id;
313  }
314  double getSpeed() const {
315  return vmax;
316  }
317  // @brief needed for NBRouterEdge
318  double getLength() const {
319  return shape.length() + viaShape.length();
320  }
321  int getNumericalID() const {
322  throw ProcessError("NBEdge::Connection does not implement getNumericalID()");
323  }
324  const Connection* getBidiEdge() const {
325  return nullptr;
326  }
327  bool isInternal() const {
328  return true;
329  }
330  const ConstRouterEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING, bool ignoreTransientPermissions = false) const {
331  UNUSED_PARAMETER(vClass);
332  UNUSED_PARAMETER(ignoreTransientPermissions);
333  return myViaSuccessors;
334  }
336  };
337 
340 
342  static const double UNSPECIFIED_WIDTH;
343 
345  static const double UNSPECIFIED_OFFSET;
346 
348  static const double UNSPECIFIED_SPEED;
349 
351  static const double UNSPECIFIED_FRICTION;
352 
354  static const double UNSPECIFIED_CONTPOS;
355 
357  static const double UNSPECIFIED_VISIBILITY_DISTANCE;
358 
360  static const double UNSPECIFIED_LOADED_LENGTH;
361 
363  static const double UNSPECIFIED_SIGNAL_OFFSET;
364 
366  static const double ANGLE_LOOKAHEAD;
367 
370 
373 
375  static const int TURN_SIGN_SHIFT_BUS = 8;
376  static const int TURN_SIGN_SHIFT_TAXI = 16;
377  static const int TURN_SIGN_SHIFT_BICYCLE = 24;
378 
383  ROUNDABOUT = 1000
384  };
385 
386  static void setDefaultConnectionLength(double length) {
387  myDefaultConnectionLength = length;
388  }
389 
390 public:
410  NBEdge(const std::string& id,
411  NBNode* from, NBNode* to, std::string type,
412  double speed, double friction, int nolanes, int priority,
413  double width, double endOffset,
414  LaneSpreadFunction spread,
415  const std::string& streetName = "");
416 
439  NBEdge(const std::string& id,
440  NBNode* from, NBNode* to, std::string type,
441  double speed, double friction, int nolanes, int priority,
442  double width, double endOffset,
443  PositionVector geom,
444  LaneSpreadFunction spread,
445  const std::string& streetName = "",
446  const std::string& origID = "",
447  bool tryIgnoreNodePositions = false);
448 
460  NBEdge(const std::string& id,
461  NBNode* from, NBNode* to,
462  const NBEdge* tpl,
463  const PositionVector& geom = PositionVector(),
464  int numLanes = -1);
465 
467  ~NBEdge();
468 
469 
485  void reinit(NBNode* from, NBNode* to, const std::string& type,
486  double speed, double friction, int nolanes, int priority,
487  PositionVector geom, double width, double endOffset,
488  const std::string& streetName,
489  LaneSpreadFunction spread,
490  bool tryIgnoreNodePositions = false);
491 
496  void reinitNodes(NBNode* from, NBNode* to);
497 
500 
504  void reshiftPosition(double xoff, double yoff);
505 
507  void mirrorX();
509 
511 
512 
516  int getNumLanes() const {
517  return (int)myLanes.size();
518  }
519 
523  int getPriority() const {
524  return myPriority;
525  }
526 
528  void setPriority(int priority) {
529  myPriority = priority;
530  }
531 
535  inline NBNode* getFromNode() const {
536  return myFrom;
537  }
538 
542  inline NBNode* getToNode() const {
543  return myTo;
544  }
545 
551  inline double getStartAngle() const {
552  return myStartAngle;
553  }
554 
560  inline double getEndAngle() const {
561  return myEndAngle;
562  }
563 
568  double getShapeStartAngle() const;
569 
570 
576  double getShapeEndAngle() const;
577 
582  inline double getTotalAngle() const {
583  return myTotalAngle;
584  }
585 
589  double getLength() const {
590  return myLength;
591  }
592 
593 
598  double getLoadedLength() const {
599  return myLoadedLength > 0 ? myLoadedLength : myLength;
600  }
601 
603  double getFinalLength() const;
604 
608  bool hasLoadedLength() const {
609  return myLoadedLength > 0;
610  }
611 
615  double getSpeed() const {
616  return mySpeed;
617  }
618 
622  double getFriction() const {
623  return myFriction;
624  }
625 
632  return myStep;
633  }
634 
638  double getLaneWidth() const {
639  return myLaneWidth;
640  }
641 
645  double getLaneWidth(int lane) const;
646 
655  double getInternalLaneWidth(
656  const NBNode& node,
657  const NBEdge::Connection& connection,
658  const NBEdge::Lane& successor,
659  bool isVia) const;
660 
662  double getTotalWidth() const;
663 
665  const std::string& getStreetName() const {
666  return myStreetName;
667  }
668 
670  void setStreetName(const std::string& name) {
671  myStreetName = name;
672  }
673 
675  double getDistance() const {
676  return myDistance;
677  }
678 
680  double getDistancAt(double pos) const;
681 
685  double getEndOffset() const {
686  return myEndOffset;
687  }
688 
692  double getEndOffset(int lane) const;
693 
697  const StopOffset& getEdgeStopOffset() const;
698 
702  const StopOffset& getLaneStopOffset(int lane) const;
703 
705  double getSignalOffset() const;
706 
708  const Position& getSignalPosition() const {
709  return mySignalPosition;
710  }
711 
713  const NBNode* getSignalNode() const {
714  return mySignalNode;
715  }
716 
718  void setSignalPosition(const Position& pos, const NBNode* signalNode) {
719  mySignalPosition = pos;
720  mySignalNode = signalNode;
721  }
722 
726  const std::vector<NBEdge::Lane>& getLanes() const {
727  return myLanes;
728  }
730 
735  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
736 
741  int getFirstNonPedestrianNonBicycleLaneIndex(int direction, bool exclusive = false) const;
742 
744  int getSpecialLane(SVCPermissions permissions) const;
745 
749  int getFirstAllowedLaneIndex(int direction) const;
750 
752  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
753 
755  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
756 
757  /* @brief get lane indices that allow the given permissions
758  * @param[in] allPermissions: whether all the given permissions must be allowed (or just some of them)
759  */
760  int getNumLanesThatAllow(SVCPermissions permissions, bool allPermissions = true) const;
761 
763  bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const;
764 
766  bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const;
767 
769  double getCrossingAngle(NBNode* node);
770 
772  std::string getSidewalkID();
773 
775 
776 
779  const PositionVector& getGeometry() const {
780  return myGeom;
781  }
782 
784  const PositionVector getInnerGeometry() const;
785 
787  bool hasDefaultGeometry() const;
788 
794  bool hasDefaultGeometryEndpoints() const;
795 
801  bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
802 
803  Position getEndpointAtNode(const NBNode* node) const;
804 
805  void resetEndpointAtNode(const NBNode* node);
806 
817  void setGeometry(const PositionVector& g, bool inner = false);
818 
828  void addGeometryPoint(int index, const Position& p);
829 
831  void extendGeometryAtNode(const NBNode* node, double maxExtent);
832 
834  void shortenGeometryAtNode(const NBNode* node, double reduction);
835 
837  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
838 
840  Position geometryPositionAtOffset(double offset) const;
841 
851  void computeEdgeShape(double smoothElevationThreshold = -1);
852 
856  const PositionVector& getLaneShape(int i) const;
857 
863 
869 
873  void reduceGeometry(const double minDist);
874 
880  void checkGeometry(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool silent);
882 
885 
899  bool addEdge2EdgeConnection(NBEdge* dest, bool overrideRemoval = false, SVCPermissions permission = SVC_UNSPECIFIED);
900 
921  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
922  int toLane, Lane2LaneInfoType type,
923  bool mayUseSameDestination = false,
924  bool mayDefinitelyPass = false,
925  KeepClear keepClear = KEEPCLEAR_UNSPECIFIED,
926  double contPos = UNSPECIFIED_CONTPOS,
927  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
928  double speed = UNSPECIFIED_SPEED,
929  double friction = UNSPECIFIED_FRICTION,
930  double length = myDefaultConnectionLength,
931  const PositionVector& customShape = PositionVector::EMPTY,
932  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
933  SVCPermissions permissions = SVC_UNSPECIFIED,
934  const bool indirectLeft = false,
935  const std::string& edgeType = "",
936  SVCPermissions changeLeft = SVC_UNSPECIFIED,
937  SVCPermissions changeRight = SVC_UNSPECIFIED,
938  bool postProcess = false);
939 
957  bool addLane2LaneConnections(int fromLane,
958  NBEdge* dest, int toLane, int no,
959  Lane2LaneInfoType type, bool invalidatePrevious = false,
960  bool mayDefinitelyPass = false);
961 
972  bool setConnection(int lane, NBEdge* destEdge,
973  int destLane,
974  Lane2LaneInfoType type,
975  bool mayUseSameDestination = false,
976  bool mayDefinitelyPass = false,
977  KeepClear keepClear = KEEPCLEAR_UNSPECIFIED,
978  double contPos = UNSPECIFIED_CONTPOS,
979  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
980  double speed = UNSPECIFIED_SPEED,
981  double friction = UNSPECIFIED_FRICTION,
982  double length = myDefaultConnectionLength,
983  const PositionVector& customShape = PositionVector::EMPTY,
984  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
985  SVCPermissions permissions = SVC_UNSPECIFIED,
986  bool indirectLeft = false,
987  const std::string& edgeType = "",
988  SVCPermissions changeLeft = SVC_UNSPECIFIED,
989  SVCPermissions changeRight = SVC_UNSPECIFIED,
990  bool postProcess = false);
991 
1002  std::vector<Connection> getConnectionsFromLane(int lane, const NBEdge* to = nullptr, int toLane = -1) const;
1003 
1008  const Connection& getConnection(int fromLane, const NBEdge* to, int toLane) const;
1009 
1014  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
1015 
1024  bool hasConnectionTo(const NBEdge* destEdge, int destLane, int fromLane = -1) const;
1025 
1032  bool isConnectedTo(const NBEdge* e, const bool ignoreTurnaround = false) const;
1033 
1037  const std::vector<Connection>& getConnections() const {
1038  return myConnections;
1039  }
1040 
1044  std::vector<Connection>& getConnections() {
1045  return myConnections;
1046  }
1047 
1051  const EdgeVector* getConnectedSorted();
1052 
1056  EdgeVector getConnectedEdges() const;
1057 
1061  EdgeVector getIncomingEdges() const;
1062 
1066  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing, bool withBikes = true) const;
1067 
1070 
1073 
1079  void remapConnections(const EdgeVector& incoming);
1080 
1088  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false, const bool keepPossibleTurns = false);
1089 
1091  bool removeFromConnections(const NBEdge::Connection& connectionToRemove);
1092 
1094  void invalidateConnections(bool reallowSetting = false);
1095 
1097  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
1098 
1100  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
1101 
1103  void copyConnectionsFrom(NBEdge* src);
1104 
1106  void shiftToLanesToEdge(NBEdge* to, int laneOff);
1108 
1114  bool isTurningDirectionAt(const NBEdge* const edge) const;
1115 
1120  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
1121 
1126  myAmMacroscopicConnector = true;
1127  }
1128 
1132  bool isMacroscopicConnector() const {
1133  return myAmMacroscopicConnector;
1134  }
1135 
1137  void setInsideTLS(bool inside) {
1138  myAmInTLS = inside;
1139  }
1140 
1144  bool isInsideTLS() const {
1145  return myAmInTLS;
1146  }
1148 
1154  void setJunctionPriority(const NBNode* const node, int prio);
1155 
1165  int getJunctionPriority(const NBNode* const node) const;
1166 
1168  void setLoadedLength(double val);
1169 
1171  void setAverageLengthWithOpposite(double val);
1172 
1175 
1177  const std::string& getTypeID() const {
1178  return myType;
1179  }
1180 
1182  bool needsLaneSpecificOutput() const;
1183 
1185  bool hasPermissions() const;
1186 
1188  bool hasLaneSpecificPermissions() const;
1189 
1191  bool hasLaneSpecificSpeed() const;
1192 
1194  bool hasLaneSpecificFriction() const;
1195 
1197  bool hasLaneSpecificWidth() const;
1198 
1200  bool hasLaneSpecificType() const;
1201 
1203  bool hasLaneSpecificEndOffset() const;
1204 
1206  bool hasLaneSpecificStopOffsets() const;
1207 
1209  bool hasAccelLane() const;
1210 
1212  bool hasCustomLaneShape() const;
1213 
1215  bool hasLaneParams() const;
1216 
1218  bool prohibitsChanging() const;
1219 
1221  bool computeEdge2Edges(bool noLeftMovers);
1222 
1224  bool computeLanes2Edges();
1225 
1227  bool recheckLanes();
1228 
1237  void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions);
1238 
1242  NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1243 
1245  double getMaxLaneOffset();
1246 
1248  bool lanesWereAssigned() const;
1249 
1251  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1252 
1254  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1255 
1258 
1260  PositionVector getCWBoundaryLine(const NBNode& n) const;
1261 
1263  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1264 
1266  bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1267 
1269  void append(NBEdge* continuation);
1270 
1272  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1273 
1275  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1276 
1277  /* @brief return the turn destination if it exists
1278  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1279  * exists
1280  */
1281  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1282 
1284  std::string getLaneID(int lane) const;
1285 
1287  double getLaneSpeed(int lane) const;
1288 
1290  double getLaneFriction(int lane) const;
1291 
1293  bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1294 
1301  double getAngleAtNode(const NBNode* const node) const;
1302 
1308  double getAngleAtNodeNormalized(const NBNode* const node) const;
1309 
1318  double getAngleAtNodeToCenter(const NBNode* const node) const;
1319 
1321  void incLaneNo(int by);
1322 
1324  void decLaneNo(int by);
1325 
1327  void deleteLane(int index, bool recompute, bool shiftIndices);
1328 
1330  void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices);
1331 
1333  void markAsInLane2LaneState();
1334 
1336  void addSidewalk(double width);
1337 
1339  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1340 
1342  void addBikeLane(double width);
1343 
1345  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1346 
1348  void addRestrictedLane(double width, SUMOVehicleClass vclass);
1349 
1351  void setPermissions(SVCPermissions permissions, int lane = -1);
1352 
1354  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1355 
1357  void setPermittedChanging(int lane, SVCPermissions changeLeft, SVCPermissions changeRight);
1358 
1360  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1361 
1363  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1364 
1366  void preferVehicleClass(int lane, SVCPermissions vclasses);
1367 
1369  void setLaneWidth(int lane, double width);
1370 
1372  void setLaneType(int lane, const std::string& type);
1373 
1375  void setEndOffset(int lane, double offset);
1376 
1378  void setSpeed(int lane, double speed);
1379 
1381  void setFriction(int lane, double friction);
1382 
1385  bool setEdgeStopOffset(int lane, const StopOffset& offset, bool overwrite = false);
1386 
1388  void setAcceleration(int lane, bool accelRamp);
1389 
1391  void markOffRamp(bool isOffRamp) {
1393  }
1394 
1395  bool isOffRamp() const {
1396  return myIsOffRamp;
1397  }
1398 
1400  void setLaneShape(int lane, const PositionVector& shape);
1401 
1403  SVCPermissions getPermissions(int lane = -1) const;
1404 
1406  void setOrigID(const std::string origID, const bool append, const int laneIdx = -1);
1407 
1409  void setDistance(double distance) {
1410  myDistance = distance;
1411  }
1412 
1414  void setBidi(bool isBidi) {
1415  myIsBidi = isBidi;
1416  }
1417 
1419  bool isBidi() {
1420  return myIsBidi;
1421  }
1422 
1423  // @brief returns a reference to the internal structure for the convenience of netedit
1424  Lane& getLaneStruct(int lane) {
1425  assert(lane >= 0);
1426  assert(lane < (int)myLanes.size());
1427  return myLanes[lane];
1428  }
1429 
1430  // @brief returns a reference to the internal structure for the convenience of netedit
1431  const Lane& getLaneStruct(int lane) const {
1432  assert(lane >= 0);
1433  assert(lane < (int)myLanes.size());
1434  return myLanes[lane];
1435  }
1436 
1439  myStep = step;
1440  }
1441 
1442  /* @brief fill connection attributes shape, viaShape, ...
1443  *
1444  * @param[in,out] edgeIndex The number of connections already handled
1445  * @param[in,out] splitIndex The number of via edges already built
1446  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1447  */
1448  double buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1449 
1451  inline const std::vector<NBSign>& getSigns() const {
1452  return mySigns;
1453  }
1454 
1456  inline void addSign(NBSign sign) {
1457  mySigns.push_back(sign);
1458  }
1459 
1462 
1464  void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1465  const PositionVector& getNodeBorder(const NBNode* node) const;
1466  void resetNodeBorder(const NBNode* node);
1467 
1469  bool isBidiRail(bool ignoreSpread = false) const;
1470 
1472  bool isBidiEdge(bool checkPotential = false) const;
1473 
1475  bool isRailDeadEnd() const;
1476 
1478  void debugPrintConnections(bool outgoing = true, bool incoming = false) const;
1479 
1481  static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width1, double width2, const std::string& error = "", bool secondIntersection = false);
1482 
1486  static PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape);
1487 
1489 
1490 
1491  static inline double getTravelTimeStatic(const NBEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
1492  return edge->getLength() / edge->getSpeed();
1493  }
1494 
1495  static int getLaneIndexFromLaneID(const std::string laneID);
1496 
1498  void setNumericalID(int index) {
1499  myIndex = index;
1500  }
1501 
1506  int getNumericalID() const {
1507  return myIndex;
1508  }
1509 
1510  const NBEdge* getBidiEdge() const {
1511  return isBidiRail() || isBidiEdge() ? myPossibleTurnDestination : nullptr;
1512  }
1513 
1516  const EdgeVector& getSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const;
1517 
1518 
1521  const ConstRouterEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING, bool ignoreTransientPermissions = false) const;
1522 
1524  const std::string& getID() const {
1525  return Named::getID();
1526  }
1527 
1529  bool joinLanes(SVCPermissions perms);
1530 
1532  void resetLaneShapes();
1533 
1536 
1539  NBEdge* getStraightContinuation(SVCPermissions permissions) const;
1540 
1543  NBEdge* getStraightPredecessor(SVCPermissions permissions) const;
1544 
1546  NBEdge* guessOpposite(bool reguess = false);
1547 
1548 
1549  const std::string& getTurnSignTarget() const {
1550  return myTurnSignTarget;
1551  }
1552 
1553  void setTurnSignTarget(const std::string& target) {
1554  myTurnSignTarget = target;
1555  }
1556 
1558  static EdgeVector filterByPermissions(const EdgeVector& edges, SVCPermissions permissions);
1559 
1560 private:
1565  private:
1567  std::map<NBEdge*, std::vector<int> > myConnections;
1568 
1571 
1572  public:
1575  : myTransitions(transitions) { }
1576 
1579 
1581  void execute(const int lane, const int virtEdge);
1582 
1584  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1585  return myConnections;
1586  }
1587 
1588  private:
1591 
1594  };
1595 
1596 
1605  public:
1607  enum class Direction {
1608  RIGHTMOST,
1609  LEFTMOST,
1610  FORWARD
1611  };
1612 
1613  public:
1615  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, const std::vector<int>& availableLanes);
1616 
1618  ~MainDirections();
1619 
1621  int getStraightest() const {
1622  return myStraightest;
1623  }
1624 
1626  bool empty() const;
1627 
1629  bool includes(Direction d) const;
1630 
1631  private:
1634 
1636  std::vector<Direction> myDirs;
1637 
1639  MainDirections(const MainDirections&) = delete;
1640 
1643  };
1644 
1646  PositionVector computeLaneShape(int lane, double offset) const;
1647 
1649  void computeLaneShapes();
1650 
1651 private:
1668  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1669 
1671  void divideOnEdges(const EdgeVector* outgoing);
1672 
1674  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1675 
1677  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>& priorities);
1678 
1680  const std::vector<int> prepareEdgePriorities(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1681 
1684 
1687  void moveConnectionToLeft(int lane);
1688 
1692  void moveConnectionToRight(int lane);
1693 
1695  bool canMoveConnection(const Connection& con, int newFromLane) const;
1697 
1699  void computeAngle();
1700 
1702  bool bothLeftTurns(LinkDirection dir, const NBEdge* otherFrom, LinkDirection dir2) const;
1703  bool haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon,
1704  int numPoints, double width1, double width2, int shapeFlag = 0) const;
1705 
1707  bool hasRestrictedLane(SUMOVehicleClass vclass) const;
1708 
1710  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1711 
1713  double assignInternalLaneLength(std::vector<Connection>::iterator i, int numLanes, double lengthSum, bool averageLength);
1714 
1716  static std::vector<LinkDirection> decodeTurnSigns(int turnSigns, int shift = 0);
1717  static void updateTurnPermissions(SVCPermissions& perm, LinkDirection dir, SVCPermissions spec, std::vector<LinkDirection> dirs);
1718 
1720  bool applyTurnSigns();
1721 
1722  /* @brief remove connections with incompatible permissions (should only be
1723  * called for guessed connections) */
1724  void removeInvalidConnections();
1725 
1726 private:
1731 
1733  std::string myType;
1734 
1737 
1739  std::string myTurnSignTarget;
1740 
1742  double myLength;
1743 
1747  double myEndAngle;
1750 
1753 
1755  double mySpeed;
1756 
1758  double myFriction;
1759 
1761  double myDistance;
1762 
1766  std::vector<Connection> myConnections;
1767 
1769  std::vector<Connection> myConnectionsToDelete;
1770 
1773 
1776 
1779 
1782 
1785 
1788 
1790  double myEndOffset;
1791 
1797 
1799  double myLaneWidth;
1800 
1804  std::vector<Lane> myLanes;
1805 
1808 
1811 
1814 
1816  std::string myStreetName;
1817 
1819  std::vector<NBSign> mySigns;
1820 
1824 
1830 
1833 
1835  bool myIsBidi;
1836 
1838  int myIndex;
1839 
1840  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1842 
1843  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1845 
1846  // @brief default length for overriding connection lengths
1848 
1849 public:
1850 
1853  public:
1855  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1856  myHasFromLane(hasFromLane),
1857  myEdge2Find(edge2find) { }
1858 
1860  bool operator()(const Connection& c) const {
1861  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1862  }
1863 
1864  private:
1866  const bool myHasFromLane;
1867 
1869  const NBEdge* const myEdge2Find;
1870  };
1871 
1874  public:
1876  connections_toedgelane_finder(const NBEdge* const edge2find, int lane2find, int fromLane2find) :
1877  myEdge2Find(edge2find),
1878  myLane2Find(lane2find),
1879  myFromLane2Find(fromLane2find) { }
1880 
1882  bool operator()(const Connection& c) const {
1883  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1884  }
1885 
1886  private:
1888  const NBEdge* const myEdge2Find;
1889 
1892 
1895  };
1896 
1899  public:
1901  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1902  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1903 
1905  bool operator()(const Connection& c) const {
1906  return ((c.fromLane == myFromLane || myFromLane == -1)
1908  && (c.toLane == myLane2Find || myLane2Find == -1));
1909  }
1910 
1911  private:
1914 
1917 
1920 
1923  };
1924 
1927  public:
1929  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1930  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1931 
1933  bool operator()(const Connection& c) const {
1934  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1935  && c.fromLane >= 0 // already assigned
1936  && c.toEdge == myEdge2Find);
1937  }
1938 
1939  private:
1942 
1945 
1948  };
1949 
1952  public:
1954  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1955 
1957  bool operator()(const Connection& c) const {
1958  return c.fromLane == myLane2Find;
1959  }
1960 
1961  private:
1964 
1965  private:
1968  };
1969 
1971  static bool connections_sorter(const Connection& c1, const Connection& c2);
1972 
1978  public:
1981 
1982  public:
1984  int operator()(const Connection& c1, const Connection& c2) const;
1985 
1986  private:
1989  };
1990 
1991 private:
1993  NBEdge(const NBEdge& s) = delete;
1994 
1996  NBEdge& operator=(const NBEdge& s) = delete;
1997 
1999  NBEdge();
2000 };
std::vector< std::pair< const NBRouterEdge *, const NBRouterEdge * > > ConstRouterEdgePairVector
Definition: NBCont.h:46
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:35
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)....
#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:1604
bool empty() const
returns the information whether no following street has a higher priority
Definition: NBEdge.cpp:224
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:230
int getStraightest() const
returns the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1621
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to, const std::vector< int > &availableLanes)
constructor
Definition: NBEdge.cpp:167
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1636
~MainDirections()
destructor
Definition: NBEdge.cpp:220
int myStraightest
the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1633
Direction
enum of possible directions
Definition: NBEdge.h:1607
MainDirections & operator=(const MainDirections &)=delete
Invalidated assignment operator.
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1564
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)=delete
Invalidated assignment operator.
ToEdgeConnectionsAdder(const ToEdgeConnectionsAdder &)=delete
Invalidated copy constructor.
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1578
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1574
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1570
void execute(const int lane, const int virtEdge)
executes a bresenham - step
Definition: NBEdge.cpp:136
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1584
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
Definition: NBEdge.h:1567
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1944
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1933
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1929
bool myCheckRight
check if is right
Definition: NBEdge.h:1947
int myFromLane
index of from lane
Definition: NBEdge.h:1941
int myLane2Find
lane to find
Definition: NBEdge.h:1919
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1905
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1901
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1916
int myFromLane
index of from lane
Definition: NBEdge.h:1913
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1922
int myLane2Find
index of lane to find
Definition: NBEdge.h:1963
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1957
connections_fromlane_finder(int lane2find)
@briefconstructor
Definition: NBEdge.h:1954
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)=delete
invalidated assignment operator
Class to sort edges by their angle.
Definition: NBEdge.h:1977
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1988
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
Definition: NBEdge.cpp:239
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1980
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1855
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1866
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1860
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1869
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1882
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1894
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1888
connections_toedgelane_finder(const NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1876
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:670
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:380
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:998
static std::vector< LinkDirection > decodeTurnSigns(int turnSigns, int shift=0)
decode bitset
Definition: NBEdge.cpp:2656
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:564
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:4345
static const int TURN_SIGN_SHIFT_BUS
shift values for decoding turn signs
Definition: NBEdge.h:375
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:2198
static const int TURN_SIGN_SHIFT_BICYCLE
Definition: NBEdge.h:377
NBEdge * guessOpposite(bool reguess=false)
set oppositeID and return opposite edge if found
Definition: NBEdge.cpp:4878
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:4359
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:589
double myLaneWidth
This width of this edge's lanes.
Definition: NBEdge.h:1799
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:4368
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1769
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1337
double getDistancAt(double pos) const
get distance at the given offset
Definition: NBEdge.cpp:4906
double myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1790
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1781
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:4331
bool isInsideTLS() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:1144
StopOffset myEdgeStopOffset
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
Definition: NBEdge.h:1796
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:380
@ ROUNDABOUT
Definition: NBEdge.h:383
@ PRIORITY_ROAD
Definition: NBEdge.h:382
@ MINOR_ROAD
Definition: NBEdge.h:381
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition: NBEdge.h:598
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:4521
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:4574
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition: NBEdge.cpp:3823
double getLaneFriction(int lane) const
get lane friction of specified lane
Definition: NBEdge.cpp:2204
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:4769
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:457
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4283
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition: NBEdge.cpp:431
double mySpeed
The maximal speed.
Definition: NBEdge.h:1755
bool hasLaneSpecificFriction() const
whether lanes differ in friction
Definition: NBEdge.cpp:2450
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:638
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:3787
void checkGeometry(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool silent)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:1030
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1766
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:1306
NBEdge()
constructor for dummy edge
Definition: NBEdge.cpp:357
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:3204
ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:1844
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:3805
double buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1687
static const double UNSPECIFIED_FRICTION
unspecified lane friction
Definition: NBEdge.h:351
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:4064
static EdgeVector filterByPermissions(const EdgeVector &edges, SVCPermissions permissions)
return only those edges that permit at least one of the give permissions
Definition: NBEdge.cpp:4836
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:1294
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:665
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
Definition: NBEdge.cpp:4020
void markOffRamp(bool isOffRamp)
marks this edge has being an offRamp or leading to one (used for connection computation)
Definition: NBEdge.h:1391
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:2440
void setAverageLengthWithOpposite(double val)
patch average lane length in regard to the opposite edge
Definition: NBEdge.cpp:4388
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:4127
void removeInvalidConnections()
Definition: NBEdge.cpp:3142
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:2399
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:369
bool isBidi()
return whether this edge should be a bidi edge
Definition: NBEdge.h:1419
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:3574
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:4403
std::string myType
The type of the edge.
Definition: NBEdge.h:1733
const Position & getSignalPosition() const
Returns the position of a traffic signal on this edge.
Definition: NBEdge.h:708
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:2415
double myTotalAngle
Definition: NBEdge.h:1748
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.cpp:992
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:596
std::string myTurnSignTarget
node for which turnSign information applies
Definition: NBEdge.h:1739
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:743
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
Definition: NBEdge.h:372
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:4751
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:4394
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:2565
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:631
void setInsideTLS(bool inside)
Marks this edge being within an intersection.
Definition: NBEdge.h:1137
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1787
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1653
void updateChangeRestrictions(SVCPermissions ignoring)
modify all existing restrictions on lane changing
Definition: NBEdge.cpp:2216
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:4580
Position getEndpointAtNode(const NBNode *node) const
Definition: NBEdge.cpp:614
NBEdge * getStraightContinuation(SVCPermissions permissions) const
return the straightest follower edge for the given permissions or nullptr (never returns turn-arounds...
Definition: NBEdge.cpp:4847
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:608
void resetEndpointAtNode(const NBNode *node)
Definition: NBEdge.cpp:619
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:4568
bool addEdge2EdgeConnection(NBEdge *dest, bool overrideRemoval=false, SVCPermissions permission=SVC_UNSPECIFIED)
Adds a connection to another edge.
Definition: NBEdge.cpp:1091
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:1126
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
divide selected lanes on edges
Definition: NBEdge.cpp:3294
int getNumericalID() const
Returns the index (numeric id) of the edge.
Definition: NBEdge.h:1506
void setTurnSignTarget(const std::string &target)
Definition: NBEdge.h:1553
void setDistance(double distance)
set kilometrage at start of edge (negative value implies couting down along the edge)
Definition: NBEdge.h:1409
const NBNode * getSignalNode() const
Returns the node that (possibly) represents a traffic signal controlling at the end of this edge.
Definition: NBEdge.h:713
static double getTravelTimeStatic(const NBEdge *const edge, const NBVehicle *const, double)
Definition: NBEdge.h:1491
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:4253
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1451
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
Definition: NBEdge.cpp:2493
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:689
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:4428
const std::string & getID() const
Definition: NBEdge.h:1524
EdgeVector mySuccessors
Definition: NBEdge.h:1841
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:726
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:4658
static double myDefaultConnectionLength
Definition: NBEdge.h:1847
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:4012
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1730
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:542
void setLaneType(int lane, const std::string &type)
set lane specific type (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4169
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:2621
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1431
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:4862
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1425
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:615
~NBEdge()
Destructor.
Definition: NBEdge.cpp:539
NBNode * myTo
Definition: NBEdge.h:1736
double myEndAngle
Definition: NBEdge.h:1747
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:4471
bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition: NBEdge.cpp:4515
double getDistance() const
get distance
Definition: NBEdge.h:675
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:360
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4154
void resetLaneShapes()
reset lane shapes to what they would be before cutting with the junction shapes
Definition: NBEdge.cpp:2210
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:3716
bool bothLeftTurns(LinkDirection dir, const NBEdge *otherFrom, LinkDirection dir2) const
determine conflict between opposite left turns
Definition: NBEdge.cpp:2103
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:4315
const StopOffset & getEdgeStopOffset() const
Returns the stopOffset to the end of the edge.
Definition: NBEdge.cpp:4221
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:3667
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:986
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:3779
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:3654
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > &priorities)
add some straight connections
Definition: NBEdge.cpp:3399
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:2426
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:2548
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:2301
bool isBidiEdge(bool checkPotential=false) const
whether this edge is part of a bidirectional edge pair
Definition: NBEdge.cpp:755
void setBidi(bool isBidi)
mark this edge as a bidi edge
Definition: NBEdge.h:1414
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:363
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:4562
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:3986
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1804
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:516
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:779
std::vector< Connection > getConnectionsFromLane(int lane, const NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1280
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:2506
bool myIsBidi
whether this edge is part of a non-rail bidi edge pair
Definition: NBEdge.h:1835
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:2039
PositionVector myToBorder
Definition: NBEdge.h:1828
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:652
void setFriction(int lane, double friction)
set lane specific friction (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4299
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:354
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:366
int getNumLanesThatAllow(SVCPermissions permissions, bool allPermissions=true) const
Definition: NBEdge.cpp:4497
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:1008
static NBEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
Definition: NBEdge.h:339
bool joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
Definition: NBEdge.cpp:4816
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:732
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:4107
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:3705
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:4596
NBEdge & operator=(const NBEdge &s)=delete
invalidated assignment operator
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:1441
double myLength
The length of the edge.
Definition: NBEdge.h:1742
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
@brif get first non-pedestrian lane
Definition: NBEdge.cpp:4537
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1522
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:3481
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:1838
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:4206
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:788
Position geometryPositionAtOffset(double offset) const
return position taking into account loaded length
Definition: NBEdge.cpp:4694
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:357
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1644
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:4190
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:4114
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:1324
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1456
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:3699
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Definition: NBEdge.cpp:4075
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1819
const std::string & getTurnSignTarget() const
Definition: NBEdge.h:1549
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1775
const PositionVector & getNodeBorder(const NBNode *node) const
Definition: NBEdge.cpp:721
const NBNode * mySignalNode
Definition: NBEdge.h:1823
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:2460
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
Definition: NBEdge.h:1498
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1671
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:4485
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:544
static const int TURN_SIGN_SHIFT_TAXI
Definition: NBEdge.h:376
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:3681
std::string getLaneID(int lane) const
get lane ID
Definition: NBEdge.cpp:4006
bool myIsOffRamp
whether this edge is an Off-Ramp or leads to one
Definition: NBEdge.h:1832
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:348
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:622
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:1044
static PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape)
Definition: NBEdge.cpp:920
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
Definition: NBEdge.cpp:4546
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:1399
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:2237
const NBEdge * getBidiEdge() const
Definition: NBEdge.h:1510
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:551
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:2174
int getSpecialLane(SVCPermissions permissions) const
return index of the first lane that allows the given permissions
Definition: NBEdge.cpp:4461
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:1179
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:2482
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:2122
double myDistance
The mileage/kilometrage at the start of this edge in a linear coordination system.
Definition: NBEdge.h:1761
bool isOffRamp() const
Definition: NBEdge.h:1395
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1813
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1374
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:4323
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1807
static void updateTurnPermissions(SVCPermissions &perm, LinkDirection dir, SVCPermissions spec, std::vector< LinkDirection > dirs)
Definition: NBEdge.cpp:2668
static void setDefaultConnectionLength(double length)
Definition: NBEdge.h:386
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1413
bool applyTurnSigns()
apply loaded turn sign information
Definition: NBEdge.cpp:2679
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:2112
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:4140
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1746
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:2158
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:3997
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:4669
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
Definition: NBEdge.cpp:2148
bool hasLaneSpecificType() const
whether lanes differ in type
Definition: NBEdge.cpp:2471
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1827
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.cpp:4415
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:590
void setPriority(int priority)
Sets the priority of the edge.
Definition: NBEdge.h:528
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:582
bool myAmInTLS
Information whether this is lies within a joined tls.
Definition: NBEdge.h:1810
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:2189
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:603
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1772
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:523
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:879
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:1999
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:342
bool hasRestrictedLane(SUMOVehicleClass vclass) const
returns whether any lane already allows the given vclass exclusively
Definition: NBEdge.cpp:4585
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:1037
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1637
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:560
const StopOffset & getLaneStopOffset(int lane) const
Returns the stop offset to the specified lane's end.
Definition: NBEdge.cpp:4227
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
Definition: NBEdge.cpp:4792
Position mySignalPosition
the position of a traffic light signal on this edge
Definition: NBEdge.h:1822
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1534
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:1177
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:3693
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:4635
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:1438
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:685
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
Definition: NBEdge.cpp:773
double myFriction
The current friction.
Definition: NBEdge.h:1758
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:4237
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:345
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1419
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again
Definition: NBEdge.cpp:2901
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1778
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:1162
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:4726
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:2289
bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition: NBEdge.cpp:4509
static int getLaneIndexFromLaneID(const std::string laneID)
Definition: NBEdge.cpp:4811
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:1318
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:1132
void setAsMacroscopicConnector()
Definition: NBEdge.h:1125
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition: NBEdge.cpp:2517
bool hasLaneParams() const
whether one of the lanes has parameters set
Definition: NBEdge.cpp:2528
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:980
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:2407
bool prohibitsChanging() const
whether one of the lanes prohibits lane changing
Definition: NBEdge.cpp:2538
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1424
void setLoadedLength(double val)
set loaded length
Definition: NBEdge.cpp:4383
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1784
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:584
void setSignalPosition(const Position &pos, const NBNode *signalNode)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:718
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:4095
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1736
void append(NBEdge *continuation)
append another edge
Definition: NBEdge.cpp:3935
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:2132
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:4704
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:675
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition: NBEdge.cpp:631
int myPriority
The priority of the edge.
Definition: NBEdge.h:1752
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1816
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:535
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1386
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:4444
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
virtual const NBRouterEdge * getBidiEdge() const =0
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, bool ignoreTransientPermissions=false) const =0
virtual const std::string & getID() 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:261
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
Connection(int fromLane_, NBEdge *toEdge_, int toLane_, const bool mayDefinitelyPass_=false)
Constructor.
Definition: NBEdge.cpp:104
int getNumericalID() const
Definition: NBEdge.h:321
double speed
custom speed for connection
Definition: NBEdge.h:240
const std::string & getID() const
Definition: NBEdge.h:311
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
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Definition: NBEdge.h:330
double getLength() const
Definition: NBEdge.h:318
bool isInternal() const
Definition: NBEdge.h:327
double getSpeed() const
Definition: NBEdge.h:314
double customLength
custom length for connection
Definition: NBEdge.h:246
const Connection * getBidiEdge() const
Definition: NBEdge.h:324
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:297
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:98
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
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:306
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 friction
Definition: NBEdge.h:243
double viaLength
the length of the via shape (maybe customized)
Definition: NBEdge.h:285
static ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:310
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:114
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:182
PositionVector shape
The lane's shape.
Definition: NBEdge.h:148