SUMO - Simulation of Urban MObility
NBEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The representation of a single edge during network building
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef NBEdge_h
23 #define NBEdge_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <map>
36 #include <vector>
37 #include <string>
38 #include <set>
39 #include <cassert>
40 #include <utils/common/Named.h>
44 #include <utils/geom/Bresenham.h>
48 #include "NBCont.h"
49 #include "NBHelpers.h"
50 #include "NBSign.h"
51 
52 
53 // ===========================================================================
54 // class declarations
55 // ===========================================================================
56 class NBNode;
57 class NBConnection;
58 class NBNodeCont;
59 class NBEdgeCont;
60 class OutputDevice;
61 class GNELane;
62 
63 
64 // ===========================================================================
65 // class definitions
66 // ===========================================================================
71 class NBEdge : public Named, public Parameterised {
72  friend class NBEdgeCont;
73 
75  friend class GNELane;
76  friend class GNEEdge;
77  friend class GNEJunction;
78 
79 public:
80 
103  };
104 
105 
116  };
117 
118 
122  struct Lane {
124  Lane(NBEdge* e, const std::string& _origID);
125 
128 
130  double speed;
131 
134 
137 
139  double endOffset;
140 
142  double width;
143 
145  std::string origID;
146 
148  std::string oppositeID;
149 
151  bool accelRamp;
152 
154  // @note (see NIImporter_DlrNavteq::ConnectedLanesHandler)
156 
159  };
160 
161 
165  struct Connection {
171  Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
172 
174  Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
175  bool keepClear_ = true,
176  double contPos_ = UNSPECIFIED_CONTPOS,
177  double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
178  bool haveVia_ = false,
179  bool uncontrolled_ = false);
180 
183 
185  int fromLane;
186 
189 
191  int toLane;
192 
194  std::string tlID;
195 
197  int tlLinkNo;
198 
201 
203  bool keepClear;
204 
206  double contPos;
207 
209  double visibility;
210 
212  std::string origID;
213 
215  std::string id;
216 
219 
221  double vmax;
222 
224  bool haveVia;
225 
227  std::string viaID;
228 
230  double viaVmax;
231 
234 
236  std::vector<int> foeInternalLinks;
237 
239  std::string foeIncomingLanes;
240 
243 
246 
248  std::string getInternalLaneID() const;
249 
251  std::string getDescription(const NBEdge* parent) const;
252  };
253 
254 
256  static const double UNSPECIFIED_WIDTH;
257 
259  static const double UNSPECIFIED_OFFSET;
260 
262  static const double UNSPECIFIED_SPEED;
263 
265  static const double UNSPECIFIED_CONTPOS;
266 
268  static const double UNSPECIFIED_VISIBILITY_DISTANCE;
269 
271  static const double UNSPECIFIED_LOADED_LENGTH;
272 
274  static const double UNSPECIFIED_SIGNAL_OFFSET;
275 
277  static const double ANGLE_LOOKAHEAD;
280 
285  ROUNDABOUT = 1000
286  };
287 
288 public:
307  NBEdge(const std::string& id,
308  NBNode* from, NBNode* to, std::string type,
309  double speed, int nolanes, int priority,
310  double width, double offset,
311  const std::string& streetName = "",
313 
314 
336  NBEdge(const std::string& id,
337  NBNode* from, NBNode* to, std::string type,
338  double speed, int nolanes, int priority,
339  double width, double offset,
340  PositionVector geom,
341  const std::string& streetName = "",
342  const std::string& origID = "",
344  bool tryIgnoreNodePositions = false);
345 
357  NBEdge(const std::string& id,
358  NBNode* from, NBNode* to,
359  NBEdge* tpl,
360  const PositionVector& geom = PositionVector(),
361  int numLanes = -1);
362 
363 
365  ~NBEdge();
366 
367 
383  void reinit(NBNode* from, NBNode* to, const std::string& type,
384  double speed, int nolanes, int priority,
385  PositionVector geom, double width, double offset,
386  const std::string& streetName,
388  bool tryIgnoreNodePositions = false);
389 
394  void reinitNodes(NBNode* from, NBNode* to);
395 
398 
402  void reshiftPosition(double xoff, double yoff);
403 
405  void mirrorX();
407 
409 
410 
414  int getNumLanes() const {
415  return (int)myLanes.size();
416  }
417 
421  int getPriority() const {
422  return myPriority;
423  }
424 
428  NBNode* getFromNode() const {
429  return myFrom;
430  }
431 
435  NBNode* getToNode() const {
436  return myTo;
437  }
438 
444  inline double getStartAngle() const {
445  return myStartAngle;
446  }
447 
453  inline double getEndAngle() const {
454  return myEndAngle;
455  }
456 
461  double getShapeStartAngle() const;
462 
463 
469  double getShapeEndAngle() const;
470 
475  inline double getTotalAngle() const {
476  return myTotalAngle;
477  }
478 
482  double getLength() const {
483  return myLength;
484  }
485 
486 
491  double getLoadedLength() const {
492  return myLoadedLength > 0 ? myLoadedLength : myLength;
493  }
494 
496  double getFinalLength() const;
497 
501  bool hasLoadedLength() const {
502  return myLoadedLength > 0;
503  }
504 
508  double getSpeed() const {
509  return mySpeed;
510  }
511 
518  return myStep;
519  }
520 
524  double getLaneWidth() const {
525  return myLaneWidth;
526  }
527 
531  double getLaneWidth(int lane) const;
532 
534  double getTotalWidth() const;
535 
537  const std::string& getStreetName() const {
538  return myStreetName;
539  }
540 
542  void setStreetName(const std::string& name) {
543  myStreetName = name;
544  }
545 
549  double getEndOffset() const {
550  return myEndOffset;
551  }
552 
556  double getEndOffset(int lane) const;
557 
559  double getSignalOffset() const {
560  return mySignalOffset;
561  }
562 
564  void setSignalOffset(double offset) {
565  mySignalOffset = offset;
566  }
567 
571  const std::vector<NBEdge::Lane>& getLanes() const {
572  return myLanes;
573  }
575 
580  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
581 
583  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
584 
586  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
587 
589  double getCrossingAngle(NBNode* node);
590 
592 
593 
596  const PositionVector& getGeometry() const {
597  return myGeom;
598  }
599 
601  const PositionVector getInnerGeometry() const;
602 
604  bool hasDefaultGeometry() const;
605 
611  bool hasDefaultGeometryEndpoints() const;
612 
618  bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
619 
630  void setGeometry(const PositionVector& g, bool inner = false);
631 
641  void addGeometryPoint(int index, const Position& p);
642 
644  void extendGeometryAtNode(const NBNode* node, double maxExtent);
645 
647  void shortenGeometryAtNode(const NBNode* node, double reduction);
648 
650  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
651 
661  void computeEdgeShape();
662 
666  const PositionVector& getLaneShape(int i) const;
667 
673 
679  return myLaneSpreadFunction;
680  }
681 
687  bool splitGeometry(NBEdgeCont& ec, NBNodeCont& nc);
688 
692  void reduceGeometry(const double minDist);
693 
699  void checkGeometry(const double maxAngle, const double minRadius, bool fix);
701 
704 
718  bool addEdge2EdgeConnection(NBEdge* dest);
719 
740  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
741  int toLane, Lane2LaneInfoType type,
742  bool mayUseSameDestination = false,
743  bool mayDefinitelyPass = false,
744  bool keepClear = true,
745  double contPos = UNSPECIFIED_CONTPOS,
746  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
747 
765  bool addLane2LaneConnections(int fromLane,
766  NBEdge* dest, int toLane, int no,
767  Lane2LaneInfoType type, bool invalidatePrevious = false,
768  bool mayDefinitelyPass = false);
769 
780  bool setConnection(int lane, NBEdge* destEdge,
781  int destLane,
782  Lane2LaneInfoType type,
783  bool mayUseSameDestination = false,
784  bool mayDefinitelyPass = false,
785  bool keepClear = true,
786  double contPos = UNSPECIFIED_CONTPOS,
787  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
788 
790  void insertConnection(NBEdge::Connection connection);
791 
800  std::vector<Connection> getConnectionsFromLane(int lane) const;
801 
806  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
807 
812  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
813 
822  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
823 
830  bool isConnectedTo(const NBEdge* e) const;
831 
835  const std::vector<Connection>& getConnections() const {
836  return myConnections;
837  }
838 
842  std::vector<Connection>& getConnections() {
843  return myConnections;
844  }
845 
850 
855 
860 
864  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing) const;
865 
868 
871 
877  void remapConnections(const EdgeVector& incoming);
878 
886  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false);
887 
889  bool removeFromConnections(NBEdge::Connection connectionToRemove);
890 
892  void invalidateConnections(bool reallowSetting = false);
893 
895  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
896 
898  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
899 
901  void copyConnectionsFrom(NBEdge* src);
902 
904  void shiftToLanesToEdge(NBEdge* to, int laneOff);
906 
912  bool isTurningDirectionAt(const NBEdge* const edge) const;
913 
918  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
919 
925  }
926 
930  bool isMacroscopicConnector() const {
932  }
933 
935  void setIsInnerEdge() {
936  myAmInnerEdge = true;
937  }
938 
942  bool isInnerEdge() const {
943  return myAmInnerEdge;
944  }
946 
952  void setJunctionPriority(const NBNode* const node, int prio);
953 
963  int getJunctionPriority(const NBNode* const node) const;
964 
966  void setLoadedLength(double val);
967 
970 
972  const std::string& getTypeID() const {
973  return myType;
974  }
975 
977  bool needsLaneSpecificOutput() const;
978 
980  bool hasPermissions() const;
981 
983  bool hasLaneSpecificPermissions() const;
984 
986  bool hasLaneSpecificSpeed() const;
987 
989  bool hasLaneSpecificWidth() const;
990 
992  bool hasLaneSpecificEndOffset() const;
993 
995  bool hasAccelLane() const;
996 
998  bool hasCustomLaneShape() const;
999 
1001  bool computeEdge2Edges(bool noLeftMovers);
1002 
1004  bool computeLanes2Edges();
1005 
1007  bool recheckLanes();
1008 
1017  void appendTurnaround(bool noTLSControlled, bool checkPermissions);
1018 
1022  NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1023 
1025  double getMaxLaneOffset();
1026 
1028  bool lanesWereAssigned() const;
1029 
1031  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1032 
1034  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1035 
1038 
1041 
1043  PositionVector getCWBoundaryLine(const NBNode& n) const;
1044 
1046  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1047 
1049  bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1050 
1052  void append(NBEdge* continuation);
1053 
1055  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1056 
1058  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1059 
1060  /* @brief return the turn destination if it exists
1061  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1062  * exists
1063  */
1064  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1065 
1067  std::string getLaneID(int lane) const;
1068 
1070  std::string getLaneIDInsecure(int lane) const;
1071 
1073  double getLaneSpeed(int lane) const;
1074 
1076  bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1077 
1085  double getAngleAtNode(const NBNode* const node) const;
1086 
1095  double getAngleAtNodeToCenter(const NBNode* const node) const;
1096 
1098  void incLaneNo(int by);
1099 
1101  void decLaneNo(int by);
1102 
1104  void deleteLane(int index, bool recompute = true);
1105 
1107  void addLane(int index, bool recompute = true);
1108 
1110  void markAsInLane2LaneState();
1111 
1113  void addSidewalk(double width);
1114 
1116  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1117 
1119  void addBikeLane(double width);
1120 
1122  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1123 
1125  void setPermissions(SVCPermissions permissions, int lane = -1);
1126 
1128  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1129 
1131  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1132 
1134  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1135 
1137  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1138 
1140  void setLaneWidth(int lane, double width);
1141 
1143  void setEndOffset(int lane, double offset);
1144 
1146  void setSpeed(int lane, double speed);
1147 
1149  void setAcceleration(int lane, bool accelRamp);
1150 
1152  void setLaneShape(int lane, const PositionVector& shape);
1153 
1155  SVCPermissions getPermissions(int lane = -1) const;
1156 
1158  void disableConnection4TLS(int fromLane, NBEdge* toEdge, int toLane);
1159 
1160  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1161  Lane& getLaneStruct(int lane) {
1162  assert(lane >= 0);
1163  assert(lane < (int)myLanes.size());
1164  return myLanes[lane];
1165  }
1166 
1167  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1168  const Lane& getLaneStruct(int lane) const {
1169  assert(lane >= 0);
1170  assert(lane < (int)myLanes.size());
1171  return myLanes[lane];
1172  }
1173 
1176  myStep = step;
1177  }
1178 
1179  /* @brief fill connection attributes shape, viaShape, ...
1180  *
1181  * @param[in,out] edgeIndex The number of connections already handled
1182  * @param[in,out] splitIndex The number of via edges already built
1183  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1184  */
1185  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1186 
1188  inline const std::vector<NBSign>& getSigns() const {
1189  return mySigns;
1190  }
1191 
1193  inline void addSign(NBSign sign) {
1194  mySigns.push_back(sign);
1195  }
1196 
1199 
1201  void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1202  void resetNodeBorder(const NBNode* node);
1203 
1204 private:
1209  private:
1211  std::map<NBEdge*, std::vector<int> > myConnections;
1212 
1215 
1216  public:
1219  : myTransitions(transitions) { }
1220 
1223 
1225  void execute(const int lane, const int virtEdge);
1226 
1228  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1229  return myConnections;
1230  }
1231 
1232  private:
1235 
1238  };
1239 
1240 
1249  public:
1251  enum Direction { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD };
1252 
1254  std::vector<Direction> myDirs;
1255 
1256  public:
1258  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, int indexOfStraightest);
1259 
1261  ~MainDirections();
1262 
1264  bool empty() const;
1265 
1267  bool includes(Direction d) const;
1268 
1269  private:
1272 
1275  };
1276 
1278  PositionVector computeLaneShape(int lane, double offset) const;
1279 
1281  void computeLaneShapes();
1282 
1283 private:
1300  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1301 
1303  void divideOnEdges(const EdgeVector* outgoing);
1304 
1306  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1307 
1309  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1310 
1312  std::vector<int>* prepareEdgePriorities(const EdgeVector* outgoing);
1313 
1315  static int computePrioritySum(const std::vector<int>& priorities);
1316 
1319 
1322  void moveConnectionToLeft(int lane);
1323 
1327  void moveConnectionToRight(int lane);
1328 
1330  bool canMoveConnection(const Connection& con, int newFromLane) const;
1332 
1336  PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape) const;
1337 
1339  void computeAngle();
1340 
1342  static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width2);
1343 
1345  void addRestrictedLane(double width, SUMOVehicleClass vclass);
1346 
1348  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1349 
1350 private:
1355 
1357  std::string myType;
1358 
1361 
1363  double myLength;
1364 
1368  double myEndAngle;
1371 
1374 
1376  double mySpeed;
1377 
1381  std::vector<Connection> myConnections;
1382 
1384  std::vector<Connection> myConnectionsToDelete;
1385 
1388 
1391 
1394 
1397 
1400 
1403 
1405  double myEndOffset;
1406 
1408  double myLaneWidth;
1409 
1413  std::vector<Lane> myLanes;
1414 
1417 
1420 
1423 
1428  int toLane;
1429  };
1430 
1432  std::vector<TLSDisabledConnection> myTLSDisabledConnections;
1433 
1435  std::string myStreetName;
1436 
1438  std::vector<NBSign> mySigns;
1439 
1442 
1448 
1449 public:
1452  public:
1454  tls_disable_finder(const TLSDisabledConnection& tpl) : myDefinition(tpl) { }
1455 
1457  bool operator()(const TLSDisabledConnection& e) const {
1458  if (e.to != myDefinition.to) {
1459  return false;
1460  }
1461  if (e.fromLane != myDefinition.fromLane) {
1462  return false;
1463  }
1464  if (e.toLane != myDefinition.toLane) {
1465  return false;
1466  }
1467  return true;
1468  }
1469 
1470  private:
1473 
1474  private:
1477  };
1478 
1479 
1482  public:
1484  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1485  myHasFromLane(hasFromLane),
1486  myEdge2Find(edge2find) { }
1487 
1489  bool operator()(const Connection& c) const {
1490  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1491  }
1492 
1493  private:
1495  const bool myHasFromLane;
1496 
1498  const NBEdge* const myEdge2Find;
1499 
1500  private:
1503  };
1504 
1507  public:
1509  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1510  myEdge2Find(edge2find),
1511  myLane2Find(lane2find),
1512  myFromLane2Find(fromLane2find) { }
1513 
1515  bool operator()(const Connection& c) const {
1516  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1517  }
1518 
1519  private:
1522 
1525 
1528 
1529  private:
1532 
1533  };
1534 
1537  public:
1539  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1540  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1541 
1543  bool operator()(const Connection& c) const {
1544  return ((c.fromLane == myFromLane || myFromLane == -1)
1545  && ((!myInvertEdge2find && c.toEdge == myEdge2Find) || (myInvertEdge2find && c.toEdge != myEdge2Find))
1546  && (c.toLane == myLane2Find || myLane2Find == -1));
1547  }
1548 
1549  private:
1552 
1555 
1558 
1561 
1562  private:
1565 
1566  };
1567 
1570  public:
1572  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1573  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1574 
1576  bool operator()(const Connection& c) const {
1577  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1578  && c.fromLane >= 0 // already assigned
1579  && c.toEdge == myEdge2Find);
1580  }
1581 
1582  private:
1585 
1588 
1591 
1592  private:
1595 
1596  };
1597 
1600  public:
1602  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1603 
1605  bool operator()(const Connection& c) const {
1606  return c.fromLane == myLane2Find;
1607  }
1608 
1609  private:
1612 
1613  private:
1616 
1617  };
1618 
1620  static bool connections_sorter(const Connection& c1, const Connection& c2);
1621 
1627  public:
1629  explicit connections_relative_edgelane_sorter(NBEdge* e) : myEdge(e) {}
1630 
1631  public:
1633  int operator()(const Connection& c1, const Connection& c2) const;
1634 
1635  private:
1638  };
1639 
1640 private:
1642  NBEdge(const NBEdge& s);
1643 
1645  NBEdge& operator=(const NBEdge& s);
1646 };
1647 
1648 
1649 #endif
1650 
1651 /****************************************************************************/
1652 
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1218
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
get first non-pedestrian lane
Definition: NBEdge.cpp:3076
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:444
std::string id
id of Connection
Definition: NBEdge.h:215
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1366
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1254
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:2435
int tlLinkNo
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:197
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:396
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1413
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:622
double vmax
maximun velocity
Definition: NBEdge.h:221
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:972
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:2486
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:2018
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:165
int toLane
The lane the connections yields in.
Definition: NBEdge.h:191
A class representing a single street sign.
Definition: NBSign.h:51
std::string foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:239
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1572
PositionVector shape
The lane&#39;s shape.
Definition: NBEdge.h:127
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:271
std::vector< TLSDisabledConnection > myTLSDisabledConnections
vector with the disabled connections
Definition: NBEdge.h:1432
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1629
~NBEdge()
Destructor.
Definition: NBEdge.cpp:464
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1402
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1159
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:227
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1193
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:1607
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:188
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:500
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:479
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1576
NBNode * myTo
Definition: NBEdge.h:1360
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:268
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:1812
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2913
The relationships between edges are computed/loaded.
Definition: NBEdge.h:94
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge&#39;s geometry at the given node.
Definition: NBEdge.cpp:1595
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:837
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition: NBEdge.cpp:2605
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:453
double myLaneWidth
This width of this edge&#39;s lanes.
Definition: NBEdge.h:1408
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1023
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:2758
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:491
bool operator()(const TLSDisabledConnection &e) const
operator ()
Definition: NBEdge.h:1457
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1438
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1801
double myEndOffset
This edges&#39;s offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1405
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2929
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1248
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:2898
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:277
int myLane2Find
lane to find
Definition: NBEdge.h:1557
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:571
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1351
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1222
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1527
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge&#39;s lanes that reach them
Definition: NBEdge.h:1211
The representation of a single edge during network building.
Definition: NBEdge.h:71
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition: NBEdge.cpp:376
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:2551
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:575
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition: NBEdge.h:109
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:2294
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2475
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:506
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:122
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1515
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:274
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:2587
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:542
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1132
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1254
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:2828
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:259
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:1187
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:2469
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.h:559
TLS Disabled Connections.
Definition: NBEdge.h:1425
Lanes to lanes - relationships are computed; should be recheked.
Definition: NBEdge.h:98
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:2960
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:549
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:508
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1393
void setLoadedLength(double val)
set loaded lenght
Definition: NBEdge.cpp:3003
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:1637
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:200
tls_disable_finder(const TLSDisabledConnection &tpl)
constructor
Definition: NBEdge.h:1454
double endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:139
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:942
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:513
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:246
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1399
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:209
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1171
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1498
bool connectionsDone
Whether connection information for this lane is already completed.
Definition: NBEdge.h:155
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1161
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1445
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:3104
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:3086
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge&#39;s geometry
Definition: NBEdge.cpp:524
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:256
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1214
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed) ...
Definition: NBEdge.cpp:1070
The connection was computed and validated.
Definition: NBEdge.h:115
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)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:954
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:561
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:2952
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:151
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:2944
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1188
The edge has been loaded, nothing is computed yet.
Definition: NBEdge.h:92
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1560
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1396
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1120
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:262
PositionVector shape
shape of Connection
Definition: NBEdge.h:218
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:3092
bool keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:203
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:3110
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:475
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1489
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:1754
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:122
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:133
void addLane(int index, bool recompute=true)
add lane
Definition: NBEdge.cpp:2766
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:889
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:2790
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1422
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:494
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:1746
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:1865
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1387
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1367
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1539
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Definition: NBEdge.h:102
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:1035
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:524
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:1064
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1779
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:421
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
~Connection()
destructor
Definition: NBEdge.h:182
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:2816
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:194
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:136
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:185
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
void deleteLane(int index, bool recompute=true)
delete lane
Definition: NBEdge.cpp:2801
TLSDisabledConnection myDefinition
definition of disable connection
Definition: NBEdge.h:1472
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:937
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:2449
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1765
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:2463
static int computePrioritySum(const std::vector< int > &priorities)
computes the sum of the given list&#39;s entries (sic!)
Definition: NBEdge.cpp:2384
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:3018
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:611
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:265
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1484
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:842
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1228
EdgeBuildingStep
Current state of the edge within the building process.
Definition: NBEdge.h:88
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1390
void setAsMacroscopicConnector()
Definition: NBEdge.h:923
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:2569
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:1681
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:501
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:414
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:517
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2422
void setSignalOffset(double offset)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:564
int myPriority
The priority of the edge.
Definition: NBEdge.h:1373
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:1549
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:3030
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
std::string origID
origin ID
Definition: NBEdge.h:212
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:1833
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1354
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1342
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1495
std::string getLaneIDInsecure(int lane) const
get Lane ID (Insecure)
Definition: NBEdge.cpp:2752
Class to sort edges by their angle.
Definition: NBEdge.h:1626
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1379
double myTotalAngle
Definition: NBEdge.h:1369
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1381
connections_fromlane_finder(int lane2find)
Definition: NBEdge.h:1602
The connection was given by the user.
Definition: NBEdge.h:113
An upper class for objects with additional parameters.
Definition: Parameterised.h:51
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:328
double speed
The speed allowed on this lane.
Definition: NBEdge.h:130
double width
This lane&#39;s width.
Definition: NBEdge.h:142
bool myAmInnerEdge
Information whether this is a junction-inner edge.
Definition: NBEdge.h:1419
Base class for objects which have an id.
Definition: Named.h:46
double myEndAngle
Definition: NBEdge.h:1368
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again ...
Definition: NBEdge.cpp:1889
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1575
int myLane2Find
index of lane to find
Definition: NBEdge.h:1611
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape) const
Definition: NBEdge.cpp:704
double mySpeed
The maximal speed.
Definition: NBEdge.h:1376
std::string origID
An original ID, if given.
Definition: NBEdge.h:145
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition: NBEdge.h:242
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:538
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:58
bool myCheckRight
check if is right
Definition: NBEdge.h:1590
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2988
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:282
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:1622
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1631
int myFromLane
index of from lane
Definition: NBEdge.h:1551
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:435
#define sign(a)
Definition: polyfonts.c:68
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:482
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
Definition: NBEdge.cpp:1145
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:688
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
add some straight connections
Definition: NBEdge.cpp:2212
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
Definition: NBEdge.cpp:2559
PositionVector viaShape
shape of via
Definition: NBEdge.h:233
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:148
PositionVector myToBorder
Definition: NBEdge.h:1446
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:3060
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:41
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:279
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1637
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:2974
double mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
Definition: NBEdge.h:1441
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:596
The edge has been loaded and connections shall not be added.
Definition: NBEdge.h:90
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:3203
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1384
double contPos
custom position for internal junction on this connection
Definition: NBEdge.h:206
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:930
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:245
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1509
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1585
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:3098
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1083
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1554
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:935
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:3144
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1165
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1521
std::string myType
The type of the edge.
Definition: NBEdge.h:1357
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:2696
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)
Adds a connection between the specified this edge&#39;s lane and an approached one.
Definition: NBEdge.cpp:913
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1168
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:1175
The connection was computed.
Definition: NBEdge.h:111
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:678
Represents a single node (junction) during network building.
Definition: NBNode.h:75
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:3009
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:2726
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
Definition: NBEdge.h:100
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1266
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1790
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition: NBEdge.cpp:1823
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
void appendTurnaround(bool noTLSControlled, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
Definition: NBEdge.cpp:2394
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:1738
Direction
enum of possible directions
Definition: NBEdge.h:1251
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:2861
void checkGeometry(const double maxAngle, const double minRadius, bool fix)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:843
std::string getLaneID(int lane) const
get Lane ID (Secure)
Definition: NBEdge.cpp:2746
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2835
void insertConnection(NBEdge::Connection connection)
insert a previously created NBEdge::connection
Definition: NBEdge.cpp:1017
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:782
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:3167
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:1693
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:1846
int myFromLane
index of from lane
Definition: NBEdge.h:1584
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:224
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:776
double myLength
The length of the edge.
Definition: NBEdge.h:1363
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1543
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
divide selected lanes on edges
Definition: NBEdge.cpp:2098
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:3047
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1416
Lanes to edges - relationships are computed/loaded.
Definition: NBEdge.h:96
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1435
double viaVmax
Maximun velocity of via.
Definition: NBEdge.h:230
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:537
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:835
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:158
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1360
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:2737
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:1049
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:236
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:770
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:3178
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1587
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1605
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2848
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1335
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1208
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2874
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:469
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:428
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.
Definition: NBEdge.cpp:792