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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // The representation of a single edge during network building
20 /****************************************************************************/
21 #ifndef NBEdge_h
22 #define NBEdge_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <map>
35 #include <vector>
36 #include <string>
37 #include <set>
38 #include <cassert>
39 #include <utils/common/Named.h>
43 #include <utils/geom/Bresenham.h>
47 #include "NBCont.h"
48 #include "NBHelpers.h"
49 #include "NBSign.h"
50 
51 
52 // ===========================================================================
53 // class declarations
54 // ===========================================================================
55 class NBNode;
56 class NBConnection;
57 class NBNodeCont;
58 class NBEdgeCont;
59 class OutputDevice;
60 class GNELane;
61 
62 
63 // ===========================================================================
64 // class definitions
65 // ===========================================================================
70 class NBEdge : public Named, public Parameterised {
71  friend class NBEdgeCont;
72 
74  friend class GNELane;
75  friend class GNEEdge;
76  friend class GNEJunction;
77 
78 public:
79 
102  };
103 
104 
115  };
116 
117 
121  struct Lane : public Parameterised {
123  Lane(NBEdge* e, const std::string& _origID);
124 
127 
129  double speed;
130 
133 
136 
138  double endOffset;
139 
141  double width;
142 
144  std::string oppositeID;
145 
147  bool accelRamp;
148 
150  // @note (see NIImporter_DlrNavteq::ConnectedLanesHandler)
152 
155  };
156 
157 
161  struct Connection : public Parameterised {
167  Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
168 
170  Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
171  bool keepClear_ = true,
172  double contPos_ = UNSPECIFIED_CONTPOS,
173  double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
174  double speed_ = UNSPECIFIED_SPEED,
175  bool haveVia_ = false,
176  bool uncontrolled_ = false,
177  const PositionVector& customShape_ = PositionVector::EMPTY);
178 
181 
183  int fromLane;
184 
187 
189  int toLane;
190 
192  std::string tlID;
193 
195  int tlLinkNo;
196 
199 
201  bool keepClear;
202 
204  double contPos;
205 
207  double visibility;
208 
210  double speed;
211 
214 
216  std::string id;
217 
220 
222  double vmax;
223 
225  bool haveVia;
226 
228  std::string viaID;
229 
232 
234  std::vector<int> foeInternalLinks;
235 
237  std::string foeIncomingLanes;
238 
241 
244 
246  std::string getInternalLaneID() const;
247 
249  std::string getDescription(const NBEdge* parent) const;
250  };
251 
252 
254  static const double UNSPECIFIED_WIDTH;
255 
257  static const double UNSPECIFIED_OFFSET;
258 
260  static const double UNSPECIFIED_SPEED;
261 
263  static const double UNSPECIFIED_CONTPOS;
264 
266  static const double UNSPECIFIED_VISIBILITY_DISTANCE;
267 
269  static const double UNSPECIFIED_LOADED_LENGTH;
270 
272  static const double UNSPECIFIED_SIGNAL_OFFSET;
273 
275  static const double ANGLE_LOOKAHEAD;
278 
283  ROUNDABOUT = 1000
284  };
285 
286 public:
305  NBEdge(const std::string& id,
306  NBNode* from, NBNode* to, std::string type,
307  double speed, int nolanes, int priority,
308  double width, double offset,
309  const std::string& streetName = "",
311 
312 
334  NBEdge(const std::string& id,
335  NBNode* from, NBNode* to, std::string type,
336  double speed, int nolanes, int priority,
337  double width, double offset,
338  PositionVector geom,
339  const std::string& streetName = "",
340  const std::string& origID = "",
342  bool tryIgnoreNodePositions = false);
343 
355  NBEdge(const std::string& id,
356  NBNode* from, NBNode* to,
357  NBEdge* tpl,
358  const PositionVector& geom = PositionVector(),
359  int numLanes = -1);
360 
361 
363  ~NBEdge();
364 
365 
381  void reinit(NBNode* from, NBNode* to, const std::string& type,
382  double speed, int nolanes, int priority,
383  PositionVector geom, double width, double offset,
384  const std::string& streetName,
386  bool tryIgnoreNodePositions = false);
387 
392  void reinitNodes(NBNode* from, NBNode* to);
393 
396 
400  void reshiftPosition(double xoff, double yoff);
401 
403  void mirrorX();
405 
407 
408 
412  int getNumLanes() const {
413  return (int)myLanes.size();
414  }
415 
419  int getPriority() const {
420  return myPriority;
421  }
422 
426  NBNode* getFromNode() const {
427  return myFrom;
428  }
429 
433  NBNode* getToNode() const {
434  return myTo;
435  }
436 
442  inline double getStartAngle() const {
443  return myStartAngle;
444  }
445 
451  inline double getEndAngle() const {
452  return myEndAngle;
453  }
454 
459  double getShapeStartAngle() const;
460 
461 
467  double getShapeEndAngle() const;
468 
473  inline double getTotalAngle() const {
474  return myTotalAngle;
475  }
476 
480  double getLength() const {
481  return myLength;
482  }
483 
484 
489  double getLoadedLength() const {
490  return myLoadedLength > 0 ? myLoadedLength : myLength;
491  }
492 
494  double getFinalLength() const;
495 
499  bool hasLoadedLength() const {
500  return myLoadedLength > 0;
501  }
502 
506  double getSpeed() const {
507  return mySpeed;
508  }
509 
516  return myStep;
517  }
518 
522  double getLaneWidth() const {
523  return myLaneWidth;
524  }
525 
529  double getLaneWidth(int lane) const;
530 
532  double getTotalWidth() const;
533 
535  const std::string& getStreetName() const {
536  return myStreetName;
537  }
538 
540  void setStreetName(const std::string& name) {
541  myStreetName = name;
542  }
543 
547  double getEndOffset() const {
548  return myEndOffset;
549  }
550 
554  double getEndOffset(int lane) const;
555 
557  double getSignalOffset() const {
558  return mySignalOffset;
559  }
560 
562  void setSignalOffset(double offset) {
563  mySignalOffset = offset;
564  }
565 
569  const std::vector<NBEdge::Lane>& getLanes() const {
570  return myLanes;
571  }
573 
578  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
579 
583  int getFirstAllowedLaneIndex(int direction) const;
584 
586  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
587 
589  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
590 
592  double getCrossingAngle(NBNode* node);
593 
595  std::string getSidewalkID();
596 
598 
599 
602  const PositionVector& getGeometry() const {
603  return myGeom;
604  }
605 
607  const PositionVector getInnerGeometry() const;
608 
610  bool hasDefaultGeometry() const;
611 
617  bool hasDefaultGeometryEndpoints() const;
618 
624  bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
625 
636  void setGeometry(const PositionVector& g, bool inner = false);
637 
647  void addGeometryPoint(int index, const Position& p);
648 
650  void extendGeometryAtNode(const NBNode* node, double maxExtent);
651 
653  void shortenGeometryAtNode(const NBNode* node, double reduction);
654 
656  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
657 
667  void computeEdgeShape();
668 
672  const PositionVector& getLaneShape(int i) const;
673 
679 
685  return myLaneSpreadFunction;
686  }
687 
693  bool splitGeometry(NBEdgeCont& ec, NBNodeCont& nc);
694 
698  void reduceGeometry(const double minDist);
699 
705  void checkGeometry(const double maxAngle, const double minRadius, bool fix);
707 
710 
724  bool addEdge2EdgeConnection(NBEdge* dest);
725 
746  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
747  int toLane, Lane2LaneInfoType type,
748  bool mayUseSameDestination = false,
749  bool mayDefinitelyPass = false,
750  bool keepClear = true,
751  double contPos = UNSPECIFIED_CONTPOS,
752  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
753  double speed = UNSPECIFIED_SPEED,
755 
773  bool addLane2LaneConnections(int fromLane,
774  NBEdge* dest, int toLane, int no,
775  Lane2LaneInfoType type, bool invalidatePrevious = false,
776  bool mayDefinitelyPass = false);
777 
788  bool setConnection(int lane, NBEdge* destEdge,
789  int destLane,
790  Lane2LaneInfoType type,
791  bool mayUseSameDestination = false,
792  bool mayDefinitelyPass = false,
793  bool keepClear = true,
794  double contPos = UNSPECIFIED_CONTPOS,
795  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
796  double speed = UNSPECIFIED_SPEED,
798 
800  void insertConnection(NBEdge::Connection connection);
801 
810  std::vector<Connection> getConnectionsFromLane(int lane) const;
811 
816  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
817 
822  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
823 
832  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
833 
840  bool isConnectedTo(const NBEdge* e) const;
841 
845  const std::vector<Connection>& getConnections() const {
846  return myConnections;
847  }
848 
852  std::vector<Connection>& getConnections() {
853  return myConnections;
854  }
855 
860 
865 
870 
874  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing) const;
875 
878 
881 
887  void remapConnections(const EdgeVector& incoming);
888 
896  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false);
897 
899  bool removeFromConnections(NBEdge::Connection connectionToRemove);
900 
902  void invalidateConnections(bool reallowSetting = false);
903 
905  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
906 
908  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
909 
911  void copyConnectionsFrom(NBEdge* src);
912 
914  void shiftToLanesToEdge(NBEdge* to, int laneOff);
916 
922  bool isTurningDirectionAt(const NBEdge* const edge) const;
923 
928  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
929 
935  }
936 
940  bool isMacroscopicConnector() const {
942  }
943 
945  void setIsInnerEdge() {
946  myAmInnerEdge = true;
947  }
948 
952  bool isInnerEdge() const {
953  return myAmInnerEdge;
954  }
956 
962  void setJunctionPriority(const NBNode* const node, int prio);
963 
973  int getJunctionPriority(const NBNode* const node) const;
974 
976  void setLoadedLength(double val);
977 
980 
982  const std::string& getTypeID() const {
983  return myType;
984  }
985 
987  bool needsLaneSpecificOutput() const;
988 
990  bool hasPermissions() const;
991 
993  bool hasLaneSpecificPermissions() const;
994 
996  bool hasLaneSpecificSpeed() const;
997 
999  bool hasLaneSpecificWidth() const;
1000 
1002  bool hasLaneSpecificEndOffset() const;
1003 
1005  bool hasAccelLane() const;
1006 
1008  bool hasCustomLaneShape() const;
1009 
1011  bool hasLaneParams() const;
1012 
1014  bool computeEdge2Edges(bool noLeftMovers);
1015 
1017  bool computeLanes2Edges();
1018 
1020  bool recheckLanes();
1021 
1030  void appendTurnaround(bool noTLSControlled, bool checkPermissions);
1031 
1035  NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1036 
1038  double getMaxLaneOffset();
1039 
1041  bool lanesWereAssigned() const;
1042 
1044  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1045 
1047  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1048 
1051 
1054 
1056  PositionVector getCWBoundaryLine(const NBNode& n) const;
1057 
1059  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1060 
1062  bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1063 
1065  void append(NBEdge* continuation);
1066 
1068  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1069 
1071  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1072 
1073  /* @brief return the turn destination if it exists
1074  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1075  * exists
1076  */
1077  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1078 
1080  std::string getLaneID(int lane) const;
1081 
1083  std::string getLaneIDInsecure(int lane) const;
1084 
1086  double getLaneSpeed(int lane) const;
1087 
1089  bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1090 
1098  double getAngleAtNode(const NBNode* const node) const;
1099 
1108  double getAngleAtNodeToCenter(const NBNode* const node) const;
1109 
1111  void incLaneNo(int by);
1112 
1114  void decLaneNo(int by);
1115 
1117  void deleteLane(int index, bool recompute = true);
1118 
1120  void addLane(int index, bool recompute = true);
1121 
1123  void markAsInLane2LaneState();
1124 
1126  void addSidewalk(double width);
1127 
1129  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1130 
1132  void addBikeLane(double width);
1133 
1135  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1136 
1138  void setPermissions(SVCPermissions permissions, int lane = -1);
1139 
1141  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1142 
1144  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1145 
1147  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1148 
1150  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1151 
1153  void setLaneWidth(int lane, double width);
1154 
1156  void setEndOffset(int lane, double offset);
1157 
1159  void setSpeed(int lane, double speed);
1160 
1162  void setAcceleration(int lane, bool accelRamp);
1163 
1165  void setLaneShape(int lane, const PositionVector& shape);
1166 
1168  SVCPermissions getPermissions(int lane = -1) const;
1169 
1171  void setOrigID(const std::string origID);
1172 
1174  void disableConnection4TLS(int fromLane, NBEdge* toEdge, int toLane);
1175 
1176  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1177  Lane& getLaneStruct(int lane) {
1178  assert(lane >= 0);
1179  assert(lane < (int)myLanes.size());
1180  return myLanes[lane];
1181  }
1182 
1183  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1184  const Lane& getLaneStruct(int lane) const {
1185  assert(lane >= 0);
1186  assert(lane < (int)myLanes.size());
1187  return myLanes[lane];
1188  }
1189 
1192  myStep = step;
1193  }
1194 
1195  /* @brief fill connection attributes shape, viaShape, ...
1196  *
1197  * @param[in,out] edgeIndex The number of connections already handled
1198  * @param[in,out] splitIndex The number of via edges already built
1199  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1200  */
1201  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1202 
1204  inline const std::vector<NBSign>& getSigns() const {
1205  return mySigns;
1206  }
1207 
1209  inline void addSign(NBSign sign) {
1210  mySigns.push_back(sign);
1211  }
1212 
1215 
1217  void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1218  void resetNodeBorder(const NBNode* node);
1219 
1220 private:
1225  private:
1227  std::map<NBEdge*, std::vector<int> > myConnections;
1228 
1231 
1232  public:
1235  : myTransitions(transitions) { }
1236 
1239 
1241  void execute(const int lane, const int virtEdge);
1242 
1244  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1245  return myConnections;
1246  }
1247 
1248  private:
1251 
1254  };
1255 
1256 
1265  public:
1267  enum Direction { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD };
1268 
1270  std::vector<Direction> myDirs;
1271 
1272  public:
1274  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, int indexOfStraightest);
1275 
1277  ~MainDirections();
1278 
1280  bool empty() const;
1281 
1283  bool includes(Direction d) const;
1284 
1285  private:
1288 
1291  };
1292 
1294  PositionVector computeLaneShape(int lane, double offset) const;
1295 
1297  void computeLaneShapes();
1298 
1299 private:
1316  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1317 
1319  void divideOnEdges(const EdgeVector* outgoing);
1320 
1322  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1323 
1325  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1326 
1328  std::vector<int>* prepareEdgePriorities(const EdgeVector* outgoing);
1329 
1331  static int computePrioritySum(const std::vector<int>& priorities);
1332 
1335 
1338  void moveConnectionToLeft(int lane);
1339 
1343  void moveConnectionToRight(int lane);
1344 
1346  bool canMoveConnection(const Connection& con, int newFromLane) const;
1348 
1352  PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape) const;
1353 
1355  void computeAngle();
1356 
1358  static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width2);
1359 
1361  void addRestrictedLane(double width, SUMOVehicleClass vclass);
1362 
1364  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1365 
1366 private:
1371 
1373  std::string myType;
1374 
1377 
1379  double myLength;
1380 
1384  double myEndAngle;
1387 
1390 
1392  double mySpeed;
1393 
1397  std::vector<Connection> myConnections;
1398 
1400  std::vector<Connection> myConnectionsToDelete;
1401 
1404 
1407 
1410 
1413 
1416 
1419 
1421  double myEndOffset;
1422 
1424  double myLaneWidth;
1425 
1429  std::vector<Lane> myLanes;
1430 
1433 
1436 
1439 
1444  int toLane;
1445  };
1446 
1448  std::vector<TLSDisabledConnection> myTLSDisabledConnections;
1449 
1451  std::string myStreetName;
1452 
1454  std::vector<NBSign> mySigns;
1455 
1458 
1464 
1465 public:
1468  public:
1470  tls_disable_finder(const TLSDisabledConnection& tpl) : myDefinition(tpl) { }
1471 
1473  bool operator()(const TLSDisabledConnection& e) const {
1474  if (e.to != myDefinition.to) {
1475  return false;
1476  }
1477  if (e.fromLane != myDefinition.fromLane) {
1478  return false;
1479  }
1480  if (e.toLane != myDefinition.toLane) {
1481  return false;
1482  }
1483  return true;
1484  }
1485 
1486  private:
1489 
1490  private:
1493  };
1494 
1495 
1498  public:
1500  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1501  myHasFromLane(hasFromLane),
1502  myEdge2Find(edge2find) { }
1503 
1505  bool operator()(const Connection& c) const {
1506  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1507  }
1508 
1509  private:
1511  const bool myHasFromLane;
1512 
1514  const NBEdge* const myEdge2Find;
1515 
1516  private:
1519  };
1520 
1523  public:
1525  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1526  myEdge2Find(edge2find),
1527  myLane2Find(lane2find),
1528  myFromLane2Find(fromLane2find) { }
1529 
1531  bool operator()(const Connection& c) const {
1532  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1533  }
1534 
1535  private:
1538 
1541 
1544 
1545  private:
1548 
1549  };
1550 
1553  public:
1555  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1556  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1557 
1559  bool operator()(const Connection& c) const {
1560  return ((c.fromLane == myFromLane || myFromLane == -1)
1561  && ((!myInvertEdge2find && c.toEdge == myEdge2Find) || (myInvertEdge2find && c.toEdge != myEdge2Find))
1562  && (c.toLane == myLane2Find || myLane2Find == -1));
1563  }
1564 
1565  private:
1568 
1571 
1574 
1577 
1578  private:
1581 
1582  };
1583 
1586  public:
1588  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1589  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1590 
1592  bool operator()(const Connection& c) const {
1593  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1594  && c.fromLane >= 0 // already assigned
1595  && c.toEdge == myEdge2Find);
1596  }
1597 
1598  private:
1601 
1604 
1607 
1608  private:
1611 
1612  };
1613 
1616  public:
1618  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1619 
1621  bool operator()(const Connection& c) const {
1622  return c.fromLane == myLane2Find;
1623  }
1624 
1625  private:
1628 
1629  private:
1632 
1633  };
1634 
1636  static bool connections_sorter(const Connection& c1, const Connection& c2);
1637 
1643  public:
1645  explicit connections_relative_edgelane_sorter(NBEdge* e) : myEdge(e) {}
1646 
1647  public:
1649  int operator()(const Connection& c1, const Connection& c2) const;
1650 
1651  private:
1654  };
1655 
1656 private:
1658  NBEdge(const NBEdge& s);
1659 
1661  NBEdge& operator=(const NBEdge& s);
1662 };
1663 
1664 
1665 #endif
1666 
1667 /****************************************************************************/
1668 
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1234
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2503
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:684
static const PositionVector EMPTY
empty Vector
std::string id
id of Connection
Definition: NBEdge.h:216
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1381
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1268
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition: NBEdge.cpp:2637
int tlLinkNo
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:195
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:401
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1429
double vmax
maximun velocity
Definition: NBEdge.h:222
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:480
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:1623
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:2514
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:2046
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:161
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:3084
int toLane
The lane the connections yields in.
Definition: NBEdge.h:189
A class representing a single street sign.
Definition: NBSign.h:50
std::string foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:237
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1588
PositionVector shape
The lane&#39;s shape.
Definition: NBEdge.h:126
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:269
std::vector< TLSDisabledConnection > myTLSDisabledConnections
vector with the disabled connections
Definition: NBEdge.h:1448
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1645
~NBEdge()
Destructor.
Definition: NBEdge.cpp:469
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1418
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1173
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:228
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1209
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:186
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1146
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:487
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
NBNode * myTo
Definition: NBEdge.h:1376
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:266
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2950
The relationships between edges are computed/loaded.
Definition: NBEdge.h:93
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1647
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:1770
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed) ...
Definition: NBEdge.cpp:1084
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:845
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:2763
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1621
double myLaneWidth
This width of this edge&#39;s lanes.
Definition: NBEdge.h:1424
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1454
double myEndOffset
This edges&#39;s offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1421
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2966
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1264
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.h:557
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:275
int myLane2Find
lane to find
Definition: NBEdge.h:1573
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1591
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1366
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1238
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:419
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:982
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:1204
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1543
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge&#39;s lanes that reach them
Definition: NBEdge.h:1227
The representation of a single edge during network building.
Definition: NBEdge.h:70
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition: NBEdge.cpp:381
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:2579
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:583
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition: NBEdge.h:108
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:2322
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:125
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1795
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:272
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:540
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1270
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:2865
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:257
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:1201
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:2497
TLS Disabled Connections.
Definition: NBEdge.h:1441
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:952
Lanes to lanes - relationships are computed; should be recheked.
Definition: NBEdge.h:97
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:499
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:2774
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:2997
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1409
void setLoadedLength(double val)
set loaded lenght
Definition: NBEdge.cpp:3040
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:1653
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:569
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:198
tls_disable_finder(const TLSDisabledConnection &tpl)
constructor
Definition: NBEdge.h:1470
double endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:138
NBEdge(const std::string &id, NBNode *from, NBNode *to, std::string type, double speed, int nolanes, int priority, double width, double offset, const std::string &streetName="", LaneSpreadFunction spread=LANESPREAD_RIGHT)
Constructor.
Definition: NBEdge.cpp:251
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1415
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:207
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1505
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1185
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1514
bool connectionsDone
Whether connection information for this lane is already completed.
Definition: NBEdge.h:151
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
Definition: NBEdge.cpp:1159
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1177
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1461
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:3170
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:3152
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge&#39;s geometry
Definition: NBEdge.cpp:532
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:1754
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:254
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1230
PositionVector customShape
custom shape for connection
Definition: NBEdge.h:213
The connection was computed and validated.
Definition: NBEdge.h:114
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:514
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:569
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:2989
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:147
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:2981
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:630
The edge has been loaded, nothing is computed yet.
Definition: NBEdge.h:91
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:2463
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:3067
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1576
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1412
PositionVector shape
shape of Connection
Definition: NBEdge.h:219
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:260
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:3158
bool keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:201
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:3176
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1037
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:121
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:132
void addLane(int index, bool recompute=true)
add lane
Definition: NBEdge.cpp:2803
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:897
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:2827
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1438
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:1893
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1403
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1531
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1383
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1806
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1555
double speed
custom speed for connection
Definition: NBEdge.h:210
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Definition: NBEdge.h:101
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1817
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
~Connection()
destructor
Definition: NBEdge.h:180
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:521
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:2853
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:192
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:135
std::string getLaneID(int lane) const
get Lane ID (Secure)
Definition: NBEdge.cpp:2783
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:412
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:183
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
void deleteLane(int index, bool recompute=true)
delete lane
Definition: NBEdge.cpp:2838
TLSDisabledConnection myDefinition
definition of disable connection
Definition: NBEdge.h:1488
NBEdge & operator=(const NBEdge &s)
invalidated assignment operator
A list of positions.
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:947
void setOrigID(const std::string origID)
set origID for all lanes
Definition: NBEdge.cpp:3282
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:502
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:2477
static int computePrioritySum(const std::vector< int > &priorities)
computes the sum of the given list&#39;s entries (sic!)
Definition: NBEdge.cpp:2412
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:3055
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:619
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:263
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:1860
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1500
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:852
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1184
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:1078
EdgeBuildingStep
Current state of the edge within the building process.
Definition: NBEdge.h:87
bool operator()(const TLSDisabledConnection &e) const
operator ()
Definition: NBEdge.h:1473
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1406
void setAsMacroscopicConnector()
Definition: NBEdge.h:933
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:508
void setSignalOffset(double offset)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:562
int myPriority
The priority of the edge.
Definition: NBEdge.h:1389
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:1565
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
Definition: NBEdge.cpp:3136
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1370
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:515
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1511
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:535
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge&#39;s geometry at the given node.
Definition: NBEdge.cpp:1611
Class to sort edges by their angle.
Definition: NBEdge.h:1642
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1394
double myTotalAngle
Definition: NBEdge.h:1385
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:2597
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:547
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1397
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape) const
Definition: NBEdge.cpp:712
std::string getLaneIDInsecure(int lane) const
get Lane ID (Insecure)
Definition: NBEdge.cpp:2789
connections_fromlane_finder(int lane2find)
Definition: NBEdge.h:1618
The connection was given by the user.
Definition: NBEdge.h:112
An upper class for objects with additional parameters.
Definition: Parameterised.h:50
void reinit(NBNode *from, NBNode *to, const std::string &type, double speed, int nolanes, int priority, PositionVector geom, double width, double offset, const std::string &streetName, LaneSpreadFunction spread=LANESPREAD_RIGHT, bool tryIgnoreNodePositions=false)
Resets initial values.
Definition: NBEdge.cpp:333
double speed
The speed allowed on this lane.
Definition: NBEdge.h:129
double width
This lane&#39;s width.
Definition: NBEdge.h:141
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:3098
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3025
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:2491
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:3269
bool myAmInnerEdge
Information whether this is a junction-inner edge.
Definition: NBEdge.h:1435
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1781
Base class for objects which have an id.
Definition: Named.h:45
double myEndAngle
Definition: NBEdge.h:1384
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again ...
Definition: NBEdge.cpp:1917
int myLane2Find
index of lane to find
Definition: NBEdge.h:1627
bool hasLaneParams() const
whether one of the lanes has parameters set
Definition: NBEdge.cpp:1850
double mySpeed
The maximal speed.
Definition: NBEdge.h:1392
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:506
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition: NBEdge.h:240
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:602
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:546
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
bool myCheckRight
check if is right
Definition: NBEdge.h:1606
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:280
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:1049
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:522
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:473
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:1638
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)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:964
int myFromLane
index of from lane
Definition: NBEdge.h:1567
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)
Adds a connection between the specified this edge&#39;s lane and an approached one.
Definition: NBEdge.cpp:921
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:696
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
add some straight connections
Definition: NBEdge.cpp:2240
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
Definition: NBEdge.cpp:2587
PositionVector viaShape
shape of via
Definition: NBEdge.h:231
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:144
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:1828
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:778
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:845
PositionVector myToBorder
Definition: NBEdge.h:1462
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:3111
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:40
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:2935
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:1653
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:3011
double mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
Definition: NBEdge.h:1457
The edge has been loaded and connections shall not be added.
Definition: NBEdge.h:89
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition: NBEdge.cpp:1839
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1592
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1400
double contPos
custom position for internal junction on this connection
Definition: NBEdge.h:204
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:243
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1525
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1601
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:3164
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1097
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1570
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:945
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:3210
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1179
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1537
std::string myType
The type of the edge.
Definition: NBEdge.h:1373
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:2728
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:442
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2450
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:1191
The connection was computed.
Definition: NBEdge.h:110
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1559
Represents a single node (junction) during network building.
Definition: NBNode.h:74
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:3046
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
Definition: NBEdge.h:99
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1280
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1134
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
void appendTurnaround(bool noTLSControlled, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
Definition: NBEdge.cpp:2422
Direction
enum of possible directions
Definition: NBEdge.h:1267
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:2898
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:940
void checkGeometry(const double maxAngle, const double minRadius, bool fix)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:851
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2872
void insertConnection(NBEdge::Connection connection)
insert a previously created NBEdge::connection
Definition: NBEdge.cpp:1031
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:790
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:3233
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:1709
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:426
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:66
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:1874
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:2617
int myFromLane
index of from lane
Definition: NBEdge.h:1600
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:225
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:489
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:784
double myLength
The length of the edge.
Definition: NBEdge.h:1379
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
divide selected lanes on edges
Definition: NBEdge.cpp:2126
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:1697
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:1762
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1432
Lanes to edges - relationships are computed/loaded.
Definition: NBEdge.h:95
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1451
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:154
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1376
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1357
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:1063
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:2795
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:433
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:234
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:3244
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1603
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2885
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1350
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1224
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2911
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:451
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:474
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1244
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
get first non-pedestrian lane
Definition: NBEdge.cpp:3127
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.
Definition: NBEdge.cpp:800