SUMO - Simulation of Urban MObility
NBEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // The representation of a single edge during network building
18 /****************************************************************************/
19 #ifndef NBEdge_h
20 #define NBEdge_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <map>
29 #include <vector>
30 #include <string>
31 #include <set>
32 #include <cassert>
33 #include <utils/common/Named.h>
37 #include <utils/geom/Bresenham.h>
41 #include "NBCont.h"
42 #include "NBHelpers.h"
43 #include "NBSign.h"
44 
45 
46 // ===========================================================================
47 // class declarations
48 // ===========================================================================
49 class NBNode;
50 class NBConnection;
51 class NBNodeCont;
52 class NBEdgeCont;
53 class OutputDevice;
54 class GNELane;
55 class NBVehicle;
56 
57 
58 // ===========================================================================
59 // class definitions
60 // ===========================================================================
65 class NBEdge : public Named, public Parameterised {
66  friend class NBEdgeCont;
67 
69  friend class GNELane;
70  friend class GNEEdge;
71  friend class GNEJunction;
72 
73 public:
74 
97  };
98 
99 
110  };
111 
112 
116  struct Lane : public Parameterised {
118  Lane(NBEdge* e, const std::string& _origID);
119 
122 
124  double speed;
125 
128 
131 
133  double endOffset;
134 
137  std::map<int, double> stopOffsets;
138 
140  double width;
141 
143  std::string oppositeID;
144 
146  bool accelRamp;
147 
149  // @note (see NIImporter_DlrNavteq::ConnectedLanesHandler)
151 
154  };
155 
156 
160  struct Connection : public Parameterised {
166  Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
167 
169  Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
170  bool keepClear_ = true,
171  double contPos_ = UNSPECIFIED_CONTPOS,
172  double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
173  double speed_ = UNSPECIFIED_SPEED,
174  bool haveVia_ = false,
175  bool uncontrolled_ = false,
176  const PositionVector& customShape_ = PositionVector::EMPTY);
177 
180 
182  int fromLane;
183 
186 
188  int toLane;
189 
191  std::string tlID;
192 
195 
198 
200  bool keepClear;
201 
203  double contPos;
204 
206  double visibility;
207 
209  double speed;
210 
213 
215  std::string id;
216 
219 
221  double vmax;
222 
224  bool haveVia;
225 
227  std::string viaID;
228 
231 
233  std::vector<int> foeInternalLinks;
234 
236  std::vector<std::string> foeIncomingLanes;
237 
240 
243 
245  std::string getInternalLaneID() const;
246 
248  std::string getDescription(const NBEdge* parent) const;
249  };
250 
251 
253  static const double UNSPECIFIED_WIDTH;
254 
256  static const double UNSPECIFIED_OFFSET;
257 
259  static const double UNSPECIFIED_SPEED;
260 
262  static const double UNSPECIFIED_CONTPOS;
263 
265  static const double UNSPECIFIED_VISIBILITY_DISTANCE;
266 
268  static const double UNSPECIFIED_LOADED_LENGTH;
269 
271  static const double UNSPECIFIED_SIGNAL_OFFSET;
272 
274  static const double ANGLE_LOOKAHEAD;
275 
278 
281 
286  ROUNDABOUT = 1000
287  };
288 
289 public:
308  NBEdge(const std::string& id,
309  NBNode* from, NBNode* to, std::string type,
310  double speed, int nolanes, int priority,
311  double width, double endOffset,
312  const std::string& streetName = "",
314 
315 
337  NBEdge(const std::string& id,
338  NBNode* from, NBNode* to, std::string type,
339  double speed, int nolanes, int priority,
340  double width, double endOffset,
341  PositionVector geom,
342  const std::string& streetName = "",
343  const std::string& origID = "",
345  bool tryIgnoreNodePositions = false);
346 
358  NBEdge(const std::string& id,
359  NBNode* from, NBNode* to,
360  const NBEdge* tpl,
361  const PositionVector& geom = PositionVector(),
362  int numLanes = -1);
363 
364 
366  ~NBEdge();
367 
368 
384  void reinit(NBNode* from, NBNode* to, const std::string& type,
385  double speed, int nolanes, int priority,
386  PositionVector geom, double width, double endOffset,
387  const std::string& streetName,
389  bool tryIgnoreNodePositions = false);
390 
395  void reinitNodes(NBNode* from, NBNode* to);
396 
399 
403  void reshiftPosition(double xoff, double yoff);
404 
406  void mirrorX();
408 
410 
411 
415  int getNumLanes() const {
416  return (int)myLanes.size();
417  }
418 
422  int getPriority() const {
423  return myPriority;
424  }
425 
429  NBNode* getFromNode() const {
430  return myFrom;
431  }
432 
436  NBNode* getToNode() const {
437  return myTo;
438  }
439 
445  inline double getStartAngle() const {
446  return myStartAngle;
447  }
448 
454  inline double getEndAngle() const {
455  return myEndAngle;
456  }
457 
462  double getShapeStartAngle() const;
463 
464 
470  double getShapeEndAngle() const;
471 
476  inline double getTotalAngle() const {
477  return myTotalAngle;
478  }
479 
483  double getLength() const {
484  return myLength;
485  }
486 
487 
492  double getLoadedLength() const {
493  return myLoadedLength > 0 ? myLoadedLength : myLength;
494  }
495 
497  double getFinalLength() const;
498 
502  bool hasLoadedLength() const {
503  return myLoadedLength > 0;
504  }
505 
509  double getSpeed() const {
510  return mySpeed;
511  }
512 
519  return myStep;
520  }
521 
525  double getLaneWidth() const {
526  return myLaneWidth;
527  }
528 
532  double getLaneWidth(int lane) const;
533 
535  double getTotalWidth() const;
536 
538  const std::string& getStreetName() const {
539  return myStreetName;
540  }
541 
543  void setStreetName(const std::string& name) {
544  myStreetName = name;
545  }
546 
550  double getEndOffset() const {
551  return myEndOffset;
552  }
553 
557  const std::map<int, double>& getStopOffsets() const {
558  return myStopOffsets;
559  }
560 
564  double getEndOffset(int lane) const;
565 
569  const std::map<int, double>& getStopOffsets(int lane) const;
570 
572  double getSignalOffset() const {
573  return mySignalOffset;
574  }
575 
577  void setSignalOffset(double offset) {
578  mySignalOffset = offset;
579  }
580 
584  const std::vector<NBEdge::Lane>& getLanes() const {
585  return myLanes;
586  }
588 
593  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
594 
598  int getFirstAllowedLaneIndex(int direction) const;
599 
601  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
602 
604  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
605 
607  double getCrossingAngle(NBNode* node);
608 
610  std::string getSidewalkID();
611 
613 
614 
617  const PositionVector& getGeometry() const {
618  return myGeom;
619  }
620 
622  const PositionVector getInnerGeometry() const;
623 
625  bool hasDefaultGeometry() const;
626 
632  bool hasDefaultGeometryEndpoints() const;
633 
639  bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
640 
651  void setGeometry(const PositionVector& g, bool inner = false);
652 
662  void addGeometryPoint(int index, const Position& p);
663 
665  void extendGeometryAtNode(const NBNode* node, double maxExtent);
666 
668  void shortenGeometryAtNode(const NBNode* node, double reduction);
669 
671  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
672 
682  void computeEdgeShape();
683 
687  const PositionVector& getLaneShape(int i) const;
688 
694 
700  return myLaneSpreadFunction;
701  }
702 
708  bool splitGeometry(NBEdgeCont& ec, NBNodeCont& nc);
709 
713  void reduceGeometry(const double minDist);
714 
720  void checkGeometry(const double maxAngle, const double minRadius, bool fix);
722 
725 
739  bool addEdge2EdgeConnection(NBEdge* dest);
740 
761  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
762  int toLane, Lane2LaneInfoType type,
763  bool mayUseSameDestination = false,
764  bool mayDefinitelyPass = false,
765  bool keepClear = true,
766  double contPos = UNSPECIFIED_CONTPOS,
767  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
768  double speed = UNSPECIFIED_SPEED,
770  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED);
771 
789  bool addLane2LaneConnections(int fromLane,
790  NBEdge* dest, int toLane, int no,
791  Lane2LaneInfoType type, bool invalidatePrevious = false,
792  bool mayDefinitelyPass = false);
793 
804  bool setConnection(int lane, NBEdge* destEdge,
805  int destLane,
806  Lane2LaneInfoType type,
807  bool mayUseSameDestination = false,
808  bool mayDefinitelyPass = false,
809  bool keepClear = true,
810  double contPos = UNSPECIFIED_CONTPOS,
811  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
812  double speed = UNSPECIFIED_SPEED,
814  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED);
815 
817  void insertConnection(NBEdge::Connection connection);
818 
827  std::vector<Connection> getConnectionsFromLane(int lane) const;
828 
833  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
834 
839  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
840 
849  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
850 
857  bool isConnectedTo(const NBEdge* e) const;
858 
862  const std::vector<Connection>& getConnections() const {
863  return myConnections;
864  }
865 
869  std::vector<Connection>& getConnections() {
870  return myConnections;
871  }
872 
877 
882 
887 
891  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing) const;
892 
895 
898 
904  void remapConnections(const EdgeVector& incoming);
905 
913  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false);
914 
916  bool removeFromConnections(NBEdge::Connection connectionToRemove);
917 
919  void invalidateConnections(bool reallowSetting = false);
920 
922  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
923 
925  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
926 
928  void copyConnectionsFrom(NBEdge* src);
929 
931  void shiftToLanesToEdge(NBEdge* to, int laneOff);
933 
939  bool isTurningDirectionAt(const NBEdge* const edge) const;
940 
945  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
946 
952  }
953 
957  bool isMacroscopicConnector() const {
959  }
960 
962  void setIsInnerEdge() {
963  myAmInnerEdge = true;
964  }
965 
969  bool isInnerEdge() const {
970  return myAmInnerEdge;
971  }
973 
979  void setJunctionPriority(const NBNode* const node, int prio);
980 
990  int getJunctionPriority(const NBNode* const node) const;
991 
993  void setLoadedLength(double val);
994 
997 
999  const std::string& getTypeID() const {
1000  return myType;
1001  }
1002 
1004  bool needsLaneSpecificOutput() const;
1005 
1007  bool hasPermissions() const;
1008 
1010  bool hasLaneSpecificPermissions() const;
1011 
1013  bool hasLaneSpecificSpeed() const;
1014 
1016  bool hasLaneSpecificWidth() const;
1017 
1019  bool hasLaneSpecificEndOffset() const;
1020 
1022  bool hasLaneSpecificStopOffsets() const;
1023 
1025  bool hasAccelLane() const;
1026 
1028  bool hasCustomLaneShape() const;
1029 
1031  bool hasLaneParams() const;
1032 
1034  bool computeEdge2Edges(bool noLeftMovers);
1035 
1037  bool computeLanes2Edges();
1038 
1040  bool recheckLanes();
1041 
1050  void appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool checkPermissions);
1051 
1055  NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1056 
1058  double getMaxLaneOffset();
1059 
1061  bool lanesWereAssigned() const;
1062 
1064  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1065 
1067  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1068 
1071 
1074 
1076  PositionVector getCWBoundaryLine(const NBNode& n) const;
1077 
1079  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1080 
1082  bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1083 
1085  void append(NBEdge* continuation);
1086 
1088  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1089 
1091  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1092 
1093  /* @brief return the turn destination if it exists
1094  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1095  * exists
1096  */
1097  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1098 
1100  std::string getLaneID(int lane) const;
1101 
1103  std::string getLaneIDInsecure(int lane) const;
1104 
1106  double getLaneSpeed(int lane) const;
1107 
1109  bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1110 
1118  double getAngleAtNode(const NBNode* const node) const;
1119 
1128  double getAngleAtNodeToCenter(const NBNode* const node) const;
1129 
1131  void incLaneNo(int by);
1132 
1134  void decLaneNo(int by);
1135 
1137  void deleteLane(int index, bool recompute, bool shiftIndices);
1138 
1140  void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices);
1141 
1143  void markAsInLane2LaneState();
1144 
1146  void addSidewalk(double width);
1147 
1149  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1150 
1152  void addBikeLane(double width);
1153 
1155  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1156 
1158  void setPermissions(SVCPermissions permissions, int lane = -1);
1159 
1161  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1162 
1164  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1165 
1167  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1168 
1170  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1171 
1173  void setLaneWidth(int lane, double width);
1174 
1176  void setEndOffset(int lane, double offset);
1177 
1179  void setSpeed(int lane, double speed);
1180 
1183  bool setStopOffsets(int lane, std::map<int, double> offsets, bool overwrite = false);
1184 
1186  void setAcceleration(int lane, bool accelRamp);
1187 
1189  void setLaneShape(int lane, const PositionVector& shape);
1190 
1192  SVCPermissions getPermissions(int lane = -1) const;
1193 
1195  void setOrigID(const std::string origID);
1196 
1198  void disableConnection4TLS(int fromLane, NBEdge* toEdge, int toLane);
1199 
1200  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1201  Lane& getLaneStruct(int lane) {
1202  assert(lane >= 0);
1203  assert(lane < (int)myLanes.size());
1204  return myLanes[lane];
1205  }
1206 
1207  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1208  const Lane& getLaneStruct(int lane) const {
1209  assert(lane >= 0);
1210  assert(lane < (int)myLanes.size());
1211  return myLanes[lane];
1212  }
1213 
1216  myStep = step;
1217  }
1218 
1219  /* @brief fill connection attributes shape, viaShape, ...
1220  *
1221  * @param[in,out] edgeIndex The number of connections already handled
1222  * @param[in,out] splitIndex The number of via edges already built
1223  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1224  */
1225  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1226 
1228  inline const std::vector<NBSign>& getSigns() const {
1229  return mySigns;
1230  }
1231 
1233  inline void addSign(NBSign sign) {
1234  mySigns.push_back(sign);
1235  }
1236 
1239 
1241  void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1242  void resetNodeBorder(const NBNode* node);
1243 
1245  bool isBidiRail(bool ignoreSpread = false) const;
1246 
1248  bool isRailDeadEnd() const;
1249 
1251  void debugPrintConnections(bool outgoing = true, bool incoming = false) const;
1252 
1254  static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width2);
1255 
1257 
1258 
1259  static inline double getTravelTimeStatic(const NBEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
1260  return edge->getLength() / edge->getSpeed();
1261  }
1262 
1263  static int getLaneIndexFromLaneID(const std::string laneID);
1264 
1266  void setNumericalID(int index) {
1267  myIndex = index;
1268  }
1269 
1274  int getNumericalID() const {
1275  return myIndex;
1276  }
1277 
1280  const EdgeVector& getSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const;
1281 
1282 
1286 
1287 
1289 
1290 private:
1295  private:
1297  std::map<NBEdge*, std::vector<int> > myConnections;
1298 
1301 
1302  public:
1305  : myTransitions(transitions) { }
1306 
1309 
1311  void execute(const int lane, const int virtEdge);
1312 
1314  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1315  return myConnections;
1316  }
1317 
1318  private:
1321 
1324  };
1325 
1326 
1335  public:
1337  enum Direction { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD };
1338 
1340  std::vector<Direction> myDirs;
1341 
1342  public:
1344  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, int indexOfStraightest);
1345 
1347  ~MainDirections();
1348 
1350  bool empty() const;
1351 
1353  bool includes(Direction d) const;
1354 
1355  private:
1358 
1361  };
1362 
1364  PositionVector computeLaneShape(int lane, double offset) const;
1365 
1367  void computeLaneShapes();
1368 
1369 private:
1386  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1387 
1389  void divideOnEdges(const EdgeVector* outgoing);
1390 
1392  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1393 
1395  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1396 
1398  std::vector<int>* prepareEdgePriorities(const EdgeVector* outgoing);
1399 
1401  static int computePrioritySum(const std::vector<int>& priorities);
1402 
1405 
1408  void moveConnectionToLeft(int lane);
1409 
1413  void moveConnectionToRight(int lane);
1414 
1416  bool canMoveConnection(const Connection& con, int newFromLane) const;
1418 
1422  PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape) const;
1423 
1425  void computeAngle();
1426 
1428  bool bothLeftIntersect(const NBNode& n, const PositionVector& shape, LinkDirection dir, NBEdge* otherFrom, const NBEdge::Connection& otherCon, int numPoints, double width2) const;
1429 
1431  void addRestrictedLane(double width, SUMOVehicleClass vclass);
1432 
1434  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1435 
1436 private:
1441 
1443  std::string myType;
1444 
1447 
1449  double myLength;
1450 
1454  double myEndAngle;
1457 
1460 
1462  double mySpeed;
1463 
1467  std::vector<Connection> myConnections;
1468 
1470  std::vector<Connection> myConnectionsToDelete;
1471 
1474 
1477 
1480 
1483 
1486 
1489 
1491  double myEndOffset;
1492 
1497  std::map<int, double> myStopOffsets;
1498 
1500  double myLaneWidth;
1501 
1505  std::vector<Lane> myLanes;
1506 
1509 
1512 
1515 
1520  int toLane;
1521  };
1522 
1524  std::vector<TLSDisabledConnection> myTLSDisabledConnections;
1525 
1527  std::string myStreetName;
1528 
1530  std::vector<NBSign> mySigns;
1531 
1534 
1540 
1541 
1543  int myIndex;
1544 
1545  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1547 
1548  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1550 
1551 public:
1554  public:
1556  tls_disable_finder(const TLSDisabledConnection& tpl) : myDefinition(tpl) { }
1557 
1559  bool operator()(const TLSDisabledConnection& e) const {
1560  if (e.to != myDefinition.to) {
1561  return false;
1562  }
1563  if (e.fromLane != myDefinition.fromLane) {
1564  return false;
1565  }
1566  if (e.toLane != myDefinition.toLane) {
1567  return false;
1568  }
1569  return true;
1570  }
1571 
1572  private:
1575 
1576  private:
1579  };
1580 
1581 
1584  public:
1586  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1587  myHasFromLane(hasFromLane),
1588  myEdge2Find(edge2find) { }
1589 
1591  bool operator()(const Connection& c) const {
1592  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1593  }
1594 
1595  private:
1597  const bool myHasFromLane;
1598 
1600  const NBEdge* const myEdge2Find;
1601 
1602  private:
1605  };
1606 
1609  public:
1611  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1612  myEdge2Find(edge2find),
1613  myLane2Find(lane2find),
1614  myFromLane2Find(fromLane2find) { }
1615 
1617  bool operator()(const Connection& c) const {
1618  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1619  }
1620 
1621  private:
1624 
1627 
1630 
1631  private:
1634 
1635  };
1636 
1639  public:
1641  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1642  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1643 
1645  bool operator()(const Connection& c) const {
1646  return ((c.fromLane == myFromLane || myFromLane == -1)
1647  && ((!myInvertEdge2find && c.toEdge == myEdge2Find) || (myInvertEdge2find && c.toEdge != myEdge2Find))
1648  && (c.toLane == myLane2Find || myLane2Find == -1));
1649  }
1650 
1651  private:
1654 
1657 
1660 
1663 
1664  private:
1667 
1668  };
1669 
1672  public:
1674  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1675  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1676 
1678  bool operator()(const Connection& c) const {
1679  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1680  && c.fromLane >= 0 // already assigned
1681  && c.toEdge == myEdge2Find);
1682  }
1683 
1684  private:
1687 
1690 
1693 
1694  private:
1697 
1698  };
1699 
1702  public:
1704  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1705 
1707  bool operator()(const Connection& c) const {
1708  return c.fromLane == myLane2Find;
1709  }
1710 
1711  private:
1714 
1715  private:
1718 
1719  };
1720 
1722  static bool connections_sorter(const Connection& c1, const Connection& c2);
1723 
1729  public:
1731  explicit connections_relative_edgelane_sorter(NBEdge* e) : myEdge(e) {}
1732 
1733  public:
1735  int operator()(const Connection& c1, const Connection& c2) const;
1736 
1737  private:
1740  };
1741 
1742 private:
1744  NBEdge(const NBEdge& s);
1745 
1747  NBEdge& operator=(const NBEdge& s);
1748 };
1749 
1750 
1751 #endif
1752 
1753 /****************************************************************************/
1754 
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1304
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2685
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:699
static const PositionVector EMPTY
empty Vector
std::string id
id of Connection
Definition: NBEdge.h:215
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1434
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1316
bool bothLeftIntersect(const NBNode &n, const PositionVector &shape, LinkDirection dir, NBEdge *otherFrom, const NBEdge::Connection &otherCon, int numPoints, double width2) const
determine conflict between opposite left turns
Definition: NBEdge.cpp:1706
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition: NBEdge.cpp:2819
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:418
void appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
Definition: NBEdge.cpp:2588
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
Definition: NBEdge.h:280
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1505
double vmax
maximum velocity
Definition: NBEdge.h:221
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:483
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:1761
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:2696
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:2212
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:160
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:3338
int toLane
The lane the connections yields in.
Definition: NBEdge.h:188
A class representing a single street sign.
Definition: NBSign.h:44
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
Definition: NBEdge.cpp:3586
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1674
PositionVector shape
The lane&#39;s shape.
Definition: NBEdge.h:121
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:268
std::vector< TLSDisabledConnection > myTLSDisabledConnections
vector with the disabled connections
Definition: NBEdge.h:1524
const std::map< int, double > & getStopOffsets() const
Returns the stopOffset to the end of the edge.
Definition: NBEdge.h:557
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1731
~NBEdge()
Destructor.
Definition: NBEdge.cpp:489
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1488
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1221
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:227
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1233
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:185
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1194
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:507
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
NBNode * myTo
Definition: NBEdge.h:1446
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:265
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3170
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1010
The relationships between edges are computed/loaded.
Definition: NBEdge.h:88
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1785
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:1915
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed) ...
Definition: NBEdge.cpp:1132
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:890
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:2950
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1707
NBEdge(const std::string &id, NBNode *from, NBNode *to, std::string type, double speed, int nolanes, int priority, double width, double endOffset, const std::string &streetName="", LaneSpreadFunction spread=LANESPREAD_RIGHT)
Constructor.
Definition: NBEdge.cpp:254
std::vector< std::pair< const NBEdge *, const NBEdge * > > NBConstEdgePairVector
Definition: NBCont.h:43
double myLaneWidth
This width of this edge&#39;s lanes.
Definition: NBEdge.h:1500
std::map< int, double > myStopOffsets
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
Definition: NBEdge.h:1497
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1530
double myEndOffset
This edges&#39;s offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1491
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
Definition: NBEdge.cpp:2990
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3220
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1334
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.h:572
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:274
int myLane2Find
lane to find
Definition: NBEdge.h:1659
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1729
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1419
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1308
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:422
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:999
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1228
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1629
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge&#39;s lanes that reach them
Definition: NBEdge.h:1297
The representation of a single edge during network building.
Definition: NBEdge.h:65
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition: NBEdge.cpp:392
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:2761
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:603
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition: NBEdge.h:103
std::vector< int > * prepareEdgePriorities(const EdgeVector *outgoing)
recomputes the edge priorities and manipulates them for a distribution of lanes on edges which is mor...
Definition: NBEdge.cpp:2488
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:126
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1940
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:271
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:650
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:543
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1340
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:3076
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:256
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:1249
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:2679
TLS Disabled Connections.
Definition: NBEdge.h:1517
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:969
Lanes to lanes - relationships are computed; should be recheked.
Definition: NBEdge.h:92
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:502
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:2961
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:3251
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1479
void setLoadedLength(double val)
set loaded lenght
Definition: NBEdge.cpp:3294
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:1791
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:584
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:197
tls_disable_finder(const TLSDisabledConnection &tpl)
constructor
Definition: NBEdge.h:1556
double endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:133
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1485
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:206
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1591
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1233
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1600
bool connectionsDone
Whether connection information for this lane is already completed.
Definition: NBEdge.h:150
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
Definition: NBEdge.cpp:1207
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1201
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1537
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:3424
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
Definition: NBEdge.cpp:661
bool setStopOffsets(int lane, std::map< int, double > offsets, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes) ...
Definition: NBEdge.cpp:3186
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:3406
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge&#39;s geometry
Definition: NBEdge.cpp:552
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
Definition: NBEdge.cpp:1973
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:1899
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:253
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1300
PositionVector customShape
custom shape for connection
Definition: NBEdge.h:212
The connection was computed and validated.
Definition: NBEdge.h:109
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:534
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:589
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:3243
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:146
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:3235
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:676
The edge has been loaded, nothing is computed yet.
Definition: NBEdge.h:86
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:2645
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:3321
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1662
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1482
PositionVector shape
shape of Connection
Definition: NBEdge.h:218
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:259
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:3412
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED)
Adds a connection between the specified this edge&#39;s lane and an approached one.
Definition: NBEdge.cpp:966
bool keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:200
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:3430
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1085
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:116
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:127
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:942
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:3033
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1514
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:2059
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1473
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1617
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1453
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1951
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1641
double speed
custom speed for connection
Definition: NBEdge.h:209
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Definition: NBEdge.h:96
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1962
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
~Connection()
destructor
Definition: NBEdge.h:179
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:541
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:3064
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:191
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:130
std::string getLaneID(int lane) const
get Lane ID (Secure)
Definition: NBEdge.cpp:2970
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:415
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:182
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
TLSDisabledConnection myDefinition
definition of disable connection
Definition: NBEdge.h:1574
NBEdge & operator=(const NBEdge &s)
invalidated assignment operator
A list of positions.
int getNumericalID() const
Returns the index (numeric id) of the edge.
Definition: NBEdge.h:1274
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:993
void setOrigID(const std::string origID)
set origID for all lanes
Definition: NBEdge.cpp:3536
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:522
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:2659
static int computePrioritySum(const std::vector< int > &priorities)
computes the sum of the given list&#39;s entries (sic!)
Definition: NBEdge.cpp:2578
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:3309
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:639
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:262
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:2019
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1586
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:869
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1208
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Definition: NBEdge.cpp:3044
bool hasConnectionTo(NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1126
EdgeBuildingStep
Current state of the edge within the building process.
Definition: NBEdge.h:82
bool operator()(const TLSDisabledConnection &e) const
operator ()
Definition: NBEdge.h:1559
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1476
void setAsMacroscopicConnector()
Definition: NBEdge.h:950
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:528
void setSignalOffset(double offset)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:577
static int getLaneIndexFromLaneID(const std::string laneID)
Definition: NBEdge.cpp:3605
int myPriority
The priority of the edge.
Definition: NBEdge.h:1459
static double firstIntersection(const PositionVector &v1, const PositionVector &v2, double width2)
compute the first intersection point between the given lane geometries considering their rspective wi...
Definition: NBEdge.cpp:1680
NBConstEdgePairVector myViaSuccessors
Definition: NBEdge.h:1549
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
Definition: NBEdge.cpp:3390
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1440
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:518
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1597
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:538
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge&#39;s geometry at the given node.
Definition: NBEdge.cpp:1749
Class to sort edges by their angle.
Definition: NBEdge.h:1728
A vehicle as used by router.
Definition: NBVehicle.h:44
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1447
double myTotalAngle
Definition: NBEdge.h:1455
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:2779
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:550
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1467
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape) const
Definition: NBEdge.cpp:757
std::string getLaneIDInsecure(int lane) const
get Lane ID (Insecure)
Definition: NBEdge.cpp:2976
connections_fromlane_finder(int lane2find)
Definition: NBEdge.h:1704
The connection was given by the user.
Definition: NBEdge.h:107
An upper class for objects with additional parameters.
Definition: Parameterised.h:44
double speed
The speed allowed on this lane.
Definition: NBEdge.h:124
double width
This lane&#39;s width.
Definition: NBEdge.h:140
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:3352
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3279
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:2673
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:3523
bool myAmInnerEdge
Information whether this is a junction-inner edge.
Definition: NBEdge.h:1511
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:1543
int tlLinkIndex
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:194
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1926
Base class for objects which have an id.
Definition: Named.h:49
double myEndAngle
Definition: NBEdge.h:1454
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again ...
Definition: NBEdge.cpp:2083
int myLane2Find
index of lane to find
Definition: NBEdge.h:1713
bool hasLaneParams() const
whether one of the lanes has parameters set
Definition: NBEdge.cpp:2009
void reinit(NBNode *from, NBNode *to, const std::string &type, double speed, int nolanes, int priority, PositionVector geom, double width, double endOffset, const std::string &streetName, LaneSpreadFunction spread=LANESPREAD_RIGHT, bool tryIgnoreNodePositions=false)
Resets initial values.
Definition: NBEdge.cpp:344
double mySpeed
The maximal speed.
Definition: NBEdge.h:1462
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:509
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition: NBEdge.h:239
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:617
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:566
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
bool myCheckRight
check if is right
Definition: NBEdge.h:1692
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:283
Connection getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection This method goes through "myConnections" and returns the specified o...
Definition: NBEdge.cpp:1097
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:525
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:476
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:1776
int myFromLane
index of from lane
Definition: NBEdge.h:1653
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:742
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
add some straight connections
Definition: NBEdge.cpp:2406
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
Definition: NBEdge.cpp:2769
PositionVector viaShape
shape of via
Definition: NBEdge.h:230
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:143
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:1987
EdgeVector mySuccessors
Definition: NBEdge.h:1546
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:823
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:862
PositionVector myToBorder
Definition: NBEdge.h:1538
std::map< int, double > stopOffsets
stopOffsets.second - The stop offset for vehicles stopping at the lane&#39;s end. Applies if vClass is in...
Definition: NBEdge.h:137
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:3365
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:3146
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:277
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1739
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:3265
double mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
Definition: NBEdge.h:1533
The edge has been loaded and connections shall not be added.
Definition: NBEdge.h:84
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition: NBEdge.cpp:1998
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1678
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1470
double contPos
custom position for internal junction on this connection
Definition: NBEdge.h:203
std::vector< std::string > foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:236
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:242
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1611
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1739
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:3418
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1145
static double getTravelTimeStatic(const NBEdge *const edge, const NBVehicle *const, double)
Definition: NBEdge.h:1259
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1656
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:962
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:3464
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1227
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1623
std::string myType
The type of the edge.
Definition: NBEdge.h:1443
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge&#39;s lateral offset shal...
void append(NBEdge *continuation)
append another edge
Definition: NBEdge.cpp:2915
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:445
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2632
void declareConnectionsAsLoaded(EdgeBuildingStep step=LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
Definition: NBEdge.h:1215
The connection was computed.
Definition: NBEdge.h:105
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1645
Represents a single node (junction) during network building.
Definition: NBNode.h:68
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:3300
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
Definition: NBEdge.h:94
const NBConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:3569
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1328
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1182
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
Direction
enum of possible directions
Definition: NBEdge.h:1337
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:3551
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:3109
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:957
void checkGeometry(const double maxAngle, const double minRadius, bool fix)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:896
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3083
void insertConnection(NBEdge::Connection connection)
insert a previously created NBEdge::connection
Definition: NBEdge.cpp:1079
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:835
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:3487
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:1847
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:429
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:2034
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:2799
int myFromLane
index of from lane
Definition: NBEdge.h:1686
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:224
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:492
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:829
double myLength
The length of the edge.
Definition: NBEdge.h:1449
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
divide selected lanes on edges
Definition: NBEdge.cpp:2292
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:1835
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:1907
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1508
Lanes to edges - relationships are computed/loaded.
Definition: NBEdge.h:90
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1527
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:153
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1446
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1410
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:1111
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:2982
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:436
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:233
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
Definition: NBEdge.h:1266
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:3498
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1689
vehicles ignoring classes
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3096
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1403
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1294
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3122
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:454
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:494
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1314
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
get first non-pedestrian lane
Definition: NBEdge.cpp:3381
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.
Definition: NBEdge.cpp:845