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 {
73  friend class NBEdgeSuccessorBuilder;
74  friend class NBEdgeCont;
75 
77  friend class GNELane;
78  friend class GNEEdge;
79  friend class GNEJunction;
80 
81 public:
82 
105  };
106 
107 
118  };
119 
120 
124  struct Lane {
126  Lane(NBEdge* e, const std::string& _origID);
127 
130 
132  double speed;
133 
136 
139 
141  double endOffset;
142 
144  double width;
145 
147  std::string origID;
148 
150  std::string oppositeID;
151 
153  bool accelRamp;
154 
156  // @note (see NIImporter_DlrNavteq::ConnectedLanesHandler)
158  };
159 
160 
164  struct Connection {
170  Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
171 
173  Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
174  bool keepClear_ = true,
175  double contPos_ = UNSPECIFIED_CONTPOS,
176  double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
177  bool haveVia_ = false,
178  bool uncontrolled_ = false);
179 
182 
184  int fromLane;
185 
188 
190  int toLane;
191 
193  std::string tlID;
194 
196  int tlLinkNo;
197 
200 
202  bool keepClear;
203 
205  double contPos;
206 
208  double visibility;
209 
211  std::string origID;
212 
214  std::string id;
215 
218 
220  double vmax;
221 
223  bool haveVia;
224 
226  std::string viaID;
227 
229  double viaVmax;
230 
233 
235  std::vector<int> foeInternalLinks;
236 
238  std::string foeIncomingLanes;
239 
242 
245 
247  std::string getInternalLaneID() const;
248 
250  std::string getDescription(const NBEdge* parent) const;
251  };
252 
253 
255  static const double UNSPECIFIED_WIDTH;
256 
258  static const double UNSPECIFIED_OFFSET;
259 
261  static const double UNSPECIFIED_SPEED;
262 
264  static const double UNSPECIFIED_CONTPOS;
265 
267  static const double UNSPECIFIED_VISIBILITY_DISTANCE;
268 
270  static const double UNSPECIFIED_LOADED_LENGTH;
271 
273  static const double UNSPECIFIED_SIGNAL_OFFSET;
274 
276  static const double ANGLE_LOOKAHEAD;
279 
284  ROUNDABOUT = 1000
285  };
286 
287 public:
306  NBEdge(const std::string& id,
307  NBNode* from, NBNode* to, std::string type,
308  double speed, int nolanes, int priority,
309  double width, double offset,
310  const std::string& streetName = "",
312 
313 
335  NBEdge(const std::string& id,
336  NBNode* from, NBNode* to, std::string type,
337  double speed, int nolanes, int priority,
338  double width, double offset,
339  PositionVector geom,
340  const std::string& streetName = "",
341  const std::string& origID = "",
343  bool tryIgnoreNodePositions = false);
344 
356  NBEdge(const std::string& id,
357  NBNode* from, NBNode* to,
358  NBEdge* tpl,
359  const PositionVector& geom = PositionVector(),
360  int numLanes = -1);
361 
362 
364  ~NBEdge();
365 
366 
382  void reinit(NBNode* from, NBNode* to, const std::string& type,
383  double speed, int nolanes, int priority,
384  PositionVector geom, double width, double offset,
385  const std::string& streetName,
387  bool tryIgnoreNodePositions = false);
388 
393  void reinitNodes(NBNode* from, NBNode* to);
394 
397 
401  void reshiftPosition(double xoff, double yoff);
402 
404  void mirrorX();
406 
408 
409 
413  int getNumLanes() const {
414  return (int)myLanes.size();
415  }
416 
420  int getPriority() const {
421  return myPriority;
422  }
423 
427  NBNode* getFromNode() const {
428  return myFrom;
429  }
430 
434  NBNode* getToNode() const {
435  return myTo;
436  }
437 
443  inline double getStartAngle() const {
444  return myStartAngle;
445  }
446 
452  inline double getEndAngle() const {
453  return myEndAngle;
454  }
455 
460  double getShapeStartAngle() const;
461 
462 
468  double getShapeEndAngle() const;
469 
474  inline double getTotalAngle() const {
475  return myTotalAngle;
476  }
477 
481  double getLength() const {
482  return myLength;
483  }
484 
485 
490  double getLoadedLength() const {
491  return myLoadedLength > 0 ? myLoadedLength : myLength;
492  }
493 
495  double getFinalLength() const;
496 
500  bool hasLoadedLength() const {
501  return myLoadedLength > 0;
502  }
503 
507  double getSpeed() const {
508  return mySpeed;
509  }
510 
517  return myStep;
518  }
519 
523  double getLaneWidth() const {
524  return myLaneWidth;
525  }
526 
530  double getLaneWidth(int lane) const;
531 
533  double getTotalWidth() const;
534 
536  const std::string& getStreetName() const {
537  return myStreetName;
538  }
539 
541  void setStreetName(const std::string& name) {
542  myStreetName = name;
543  }
544 
548  double getEndOffset() const {
549  return myEndOffset;
550  }
551 
555  double getEndOffset(int lane) const;
556 
558  double getSignalOffset() const {
559  return mySignalOffset;
560  }
561 
563  void setSignalOffset(double offset) {
564  mySignalOffset = offset;
565  }
566 
570  const std::vector<NBEdge::Lane>& getLanes() const {
571  return myLanes;
572  }
574 
579  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
580 
582  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
583 
585  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
586 
588  double getCrossingAngle(NBNode* node);
589 
591 
592 
595  const PositionVector& getGeometry() const {
596  return myGeom;
597  }
598 
600  const PositionVector getInnerGeometry() const;
601 
603  bool hasDefaultGeometry() const;
604 
610  bool hasDefaultGeometryEndpoints() const;
611 
617  bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
618 
629  void setGeometry(const PositionVector& g, bool inner = false);
630 
640  void addGeometryPoint(int index, const Position& p);
641 
643  void extendGeometryAtNode(const NBNode* node, double maxExtent);
644 
646  void shortenGeometryAtNode(const NBNode* node, double reduction);
647 
649  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
650 
660  void computeEdgeShape();
661 
665  const PositionVector& getLaneShape(int i) const;
666 
672 
678  return myLaneSpreadFunction;
679  }
680 
686  bool splitGeometry(NBEdgeCont& ec, NBNodeCont& nc);
687 
691  void reduceGeometry(const double minDist);
692 
698  void checkGeometry(const double maxAngle, const double minRadius, bool fix);
700 
703 
717  bool addEdge2EdgeConnection(NBEdge* dest);
718 
739  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
740  int toLane, Lane2LaneInfoType type,
741  bool mayUseSameDestination = false,
742  bool mayDefinitelyPass = false,
743  bool keepClear = true,
744  double contPos = UNSPECIFIED_CONTPOS,
745  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
746 
764  bool addLane2LaneConnections(int fromLane,
765  NBEdge* dest, int toLane, int no,
766  Lane2LaneInfoType type, bool invalidatePrevious = false,
767  bool mayDefinitelyPass = false);
768 
779  bool setConnection(int lane, NBEdge* destEdge,
780  int destLane,
781  Lane2LaneInfoType type,
782  bool mayUseSameDestination = false,
783  bool mayDefinitelyPass = false,
784  bool keepClear = true,
785  double contPos = UNSPECIFIED_CONTPOS,
786  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
787 
789  void insertConnection(NBEdge::Connection connection);
790 
799  std::vector<Connection> getConnectionsFromLane(int lane) const;
800 
805  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
806 
811  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
812 
821  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
822 
829  bool isConnectedTo(const NBEdge* e) const;
830 
834  const std::vector<Connection>& getConnections() const {
835  return myConnections;
836  }
837 
841  std::vector<Connection>& getConnections() {
842  return myConnections;
843  }
844 
849 
854 
859 
863  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing) const;
864 
867 
870 
876  void remapConnections(const EdgeVector& incoming);
877 
885  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false);
886 
888  bool removeFromConnections(NBEdge::Connection connectionToRemove);
889 
891  void invalidateConnections(bool reallowSetting = false);
892 
894  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
895 
897  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
898 
900  void copyConnectionsFrom(NBEdge* src);
901 
903  void shiftToLanesToEdge(NBEdge* to, int laneOff);
905 
911  bool isTurningDirectionAt(const NBEdge* const edge) const;
912 
917  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
918 
924  }
925 
929  bool isMacroscopicConnector() const {
931  }
932 
934  void setIsInnerEdge() {
935  myAmInnerEdge = true;
936  }
937 
941  bool isInnerEdge() const {
942  return myAmInnerEdge;
943  }
945 
951  void setJunctionPriority(const NBNode* const node, int prio);
952 
962  int getJunctionPriority(const NBNode* const node) const;
963 
965  void setLoadedLength(double val);
966 
969 
971  const std::string& getTypeID() const {
972  return myType;
973  }
974 
976  bool needsLaneSpecificOutput() const;
977 
979  bool hasPermissions() const;
980 
982  bool hasLaneSpecificPermissions() const;
983 
985  bool hasLaneSpecificSpeed() const;
986 
988  bool hasLaneSpecificWidth() const;
989 
991  bool hasLaneSpecificEndOffset() const;
992 
994  bool hasAccelLane() const;
995 
997  bool computeEdge2Edges(bool noLeftMovers);
998 
1000  bool computeLanes2Edges();
1001 
1003  bool recheckLanes();
1004 
1013  void appendTurnaround(bool noTLSControlled, bool checkPermissions);
1014 
1018  NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1019 
1021  double getMaxLaneOffset();
1022 
1024  bool lanesWereAssigned() const;
1025 
1027  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1028 
1030  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1031 
1034 
1037 
1039  PositionVector getCWBoundaryLine(const NBNode& n) const;
1040 
1042  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1043 
1045  bool expandableBy(NBEdge* possContinuation) const;
1046 
1048  void append(NBEdge* continuation);
1049 
1051  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1052 
1054  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1055 
1056  /* @brief return the turn destination if it exists
1057  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1058  * exists
1059  */
1060  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1061 
1063  std::string getLaneID(int lane) const;
1064 
1066  std::string getLaneIDInsecure(int lane) const;
1067 
1069  double getLaneSpeed(int lane) const;
1070 
1072  bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1073 
1081  double getAngleAtNode(const NBNode* const node) const;
1082 
1091  double getAngleAtNodeToCenter(const NBNode* const node) const;
1092 
1094  void incLaneNo(int by);
1095 
1097  void decLaneNo(int by);
1098 
1100  void deleteLane(int index, bool recompute = true);
1101 
1103  void addLane(int index, bool recompute = true);
1104 
1106  void markAsInLane2LaneState();
1107 
1109  void addSidewalk(double width);
1110 
1112  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1113 
1115  void addBikeLane(double width);
1116 
1118  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1119 
1121  void setPermissions(SVCPermissions permissions, int lane = -1);
1122 
1124  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1125 
1127  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1128 
1130  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1131 
1133  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1134 
1136  void setLaneWidth(int lane, double width);
1137 
1139  void setEndOffset(int lane, double offset);
1140 
1142  void setSpeed(int lane, double speed);
1143 
1145  void setAcceleration(int lane, bool accelRamp);
1146 
1148  SVCPermissions getPermissions(int lane = -1) const;
1149 
1151  void disableConnection4TLS(int fromLane, NBEdge* toEdge, int toLane);
1152 
1153  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1154  Lane& getLaneStruct(int lane) {
1155  assert(lane >= 0);
1156  assert(lane < (int)myLanes.size());
1157  return myLanes[lane];
1158  }
1159 
1160  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1161  const Lane& getLaneStruct(int lane) const {
1162  assert(lane >= 0);
1163  assert(lane < (int)myLanes.size());
1164  return myLanes[lane];
1165  }
1166 
1169  myStep = step;
1170  }
1171 
1172  /* @brief fill connection attributes shape, viaShape, ...
1173  *
1174  * @param[in,out] edgeIndex The number of connections already handled
1175  * @param[in,out] splitIndex The number of via edges already built
1176  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1177  */
1178  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1179 
1181  inline const std::vector<NBSign>& getSigns() const {
1182  return mySigns;
1183  }
1184 
1186  inline void addSign(NBSign sign) {
1187  mySigns.push_back(sign);
1188  }
1189 
1192 
1194  void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1195  void resetNodeBorder(const NBNode* node);
1196 
1197 private:
1202  private:
1204  std::map<NBEdge*, std::vector<int> > myConnections;
1205 
1208 
1209  public:
1212  : myTransitions(transitions) { }
1213 
1216 
1218  void execute(const int lane, const int virtEdge);
1219 
1221  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1222  return myConnections;
1223  }
1224 
1225  private:
1228 
1231  };
1232 
1233 
1242  public:
1244  enum Direction { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD };
1245 
1247  std::vector<Direction> myDirs;
1248 
1249  public:
1251  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, int indexOfStraightest);
1252 
1254  ~MainDirections();
1255 
1257  bool empty() const;
1258 
1260  bool includes(Direction d) const;
1261 
1262  private:
1265 
1268  };
1269 
1271  PositionVector computeLaneShape(int lane, double offset) const;
1272 
1274  void computeLaneShapes();
1275 
1276 private:
1293  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1294 
1296  void divideOnEdges(const EdgeVector* outgoing);
1297 
1299  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1300 
1302  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1303 
1305  std::vector<int>* prepareEdgePriorities(const EdgeVector* outgoing);
1306 
1308  static int computePrioritySum(const std::vector<int>& priorities);
1309 
1312 
1315  void moveConnectionToLeft(int lane);
1316 
1320  void moveConnectionToRight(int lane);
1321 
1323  bool canMoveConnection(const Connection& con, int newFromLane) const;
1325 
1329  PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape) const;
1330 
1332  void computeAngle();
1333 
1335  static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width2);
1336 
1338  void addRestrictedLane(double width, SUMOVehicleClass vclass);
1339 
1341  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1342 
1343 private:
1348 
1350  std::string myType;
1351 
1354 
1356  double myLength;
1357 
1361  double myEndAngle;
1364 
1367 
1369  double mySpeed;
1370 
1374  std::vector<Connection> myConnections;
1375 
1377  std::vector<Connection> myConnectionsToDelete;
1378 
1381 
1384 
1387 
1390 
1393 
1396 
1398  double myEndOffset;
1399 
1401  double myLaneWidth;
1402 
1406  std::vector<Lane> myLanes;
1407 
1410 
1413 
1416 
1421  int toLane;
1422  };
1423 
1425  std::vector<TLSDisabledConnection> myTLSDisabledConnections;
1426 
1428  std::string myStreetName;
1429 
1431  std::vector<NBSign> mySigns;
1432 
1435 
1441 
1442 public:
1445  public:
1447  tls_disable_finder(const TLSDisabledConnection& tpl) : myDefinition(tpl) { }
1448 
1450  bool operator()(const TLSDisabledConnection& e) const {
1451  if (e.to != myDefinition.to) {
1452  return false;
1453  }
1454  if (e.fromLane != myDefinition.fromLane) {
1455  return false;
1456  }
1457  if (e.toLane != myDefinition.toLane) {
1458  return false;
1459  }
1460  return true;
1461  }
1462 
1463  private:
1466 
1467  private:
1470  };
1471 
1472 
1475  public:
1477  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1478  myHasFromLane(hasFromLane),
1479  myEdge2Find(edge2find) { }
1480 
1482  bool operator()(const Connection& c) const {
1483  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1484  }
1485 
1486  private:
1488  const bool myHasFromLane;
1489 
1491  const NBEdge* const myEdge2Find;
1492 
1493  private:
1496  };
1497 
1500  public:
1502  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1503  myEdge2Find(edge2find),
1504  myLane2Find(lane2find),
1505  myFromLane2Find(fromLane2find) { }
1506 
1508  bool operator()(const Connection& c) const {
1509  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1510  }
1511 
1512  private:
1515 
1518 
1521 
1522  private:
1525 
1526  };
1527 
1530  public:
1532  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1533  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1534 
1536  bool operator()(const Connection& c) const {
1537  return ((c.fromLane == myFromLane || myFromLane == -1)
1538  && ((!myInvertEdge2find && c.toEdge == myEdge2Find) || (myInvertEdge2find && c.toEdge != myEdge2Find))
1539  && (c.toLane == myLane2Find || myLane2Find == -1));
1540  }
1541 
1542  private:
1545 
1548 
1551 
1554 
1555  private:
1558 
1559  };
1560 
1563  public:
1565  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1566  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1567 
1569  bool operator()(const Connection& c) const {
1570  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1571  && c.fromLane >= 0 // already assigned
1572  && c.toEdge == myEdge2Find);
1573  }
1574 
1575  private:
1578 
1581 
1584 
1585  private:
1588 
1589  };
1590 
1593  public:
1595  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1596 
1598  bool operator()(const Connection& c) const {
1599  return c.fromLane == myLane2Find;
1600  }
1601 
1602  private:
1605 
1606  private:
1609 
1610  };
1611 
1613  static bool connections_sorter(const Connection& c1, const Connection& c2);
1614 
1620  public:
1622  explicit connections_relative_edgelane_sorter(NBEdge* e) : myEdge(e) {}
1623 
1624  public:
1626  int operator()(const Connection& c1, const Connection& c2) const;
1627 
1628  private:
1631  };
1632 
1633 private:
1635  NBEdge(const NBEdge& s);
1636 
1638  NBEdge& operator=(const NBEdge& s);
1639 };
1640 
1641 
1642 #endif
1643 
1644 /****************************************************************************/
1645 
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1211
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2420
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:677
std::string id
id of Connection
Definition: NBEdge.h:214
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1350
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1238
int tlLinkNo
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:196
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:395
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1406
double vmax
maximun velocity
Definition: NBEdge.h:220
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:481
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:1588
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:2431
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:1963
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:164
int toLane
The lane the connections yields in.
Definition: NBEdge.h:190
A class representing a single street sign.
Definition: NBSign.h:51
std::string foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:238
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1565
PositionVector shape
The lane&#39;s shape.
Definition: NBEdge.h:129
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:270
std::vector< TLSDisabledConnection > myTLSDisabledConnections
vector with the disabled connections
Definition: NBEdge.h:1425
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1622
~NBEdge()
Destructor.
Definition: NBEdge.cpp:452
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1395
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1146
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:226
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1186
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:187
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1119
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:467
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
NBNode * myTo
Definition: NBEdge.h:1353
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:267
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2846
The relationships between edges are computed/loaded.
Definition: NBEdge.h:96
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1612
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:1731
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed) ...
Definition: NBEdge.cpp:1057
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:824
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:2659
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1598
double myLaneWidth
This width of this edge&#39;s lanes.
Definition: NBEdge.h:1401
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1431
double myEndOffset
This edges&#39;s offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1398
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2862
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1241
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.h:558
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:276
int myLane2Find
lane to find
Definition: NBEdge.h:1550
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1556
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1335
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1215
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:420
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:971
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:1181
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1520
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge&#39;s lanes that reach them
Definition: NBEdge.h:1204
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:375
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:2496
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:563
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition: NBEdge.h:111
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:2239
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:121
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1756
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:273
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:541
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1247
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:2761
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:258
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:1174
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:2414
TLS Disabled Connections.
Definition: NBEdge.h:1418
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:941
Lanes to lanes - relationships are computed; should be recheked.
Definition: NBEdge.h:100
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:500
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:2670
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:2885
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1386
void setLoadedLength(double val)
set loaded lenght
Definition: NBEdge.cpp:2928
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:1618
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:570
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:199
tls_disable_finder(const TLSDisabledConnection &tpl)
constructor
Definition: NBEdge.h:1447
double endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:141
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:245
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1392
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:208
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1482
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1158
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1491
bool connectionsDone
Whether connection information for this lane is already completed.
Definition: NBEdge.h:157
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
Definition: NBEdge.cpp:1132
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1154
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1438
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:3029
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:3011
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge&#39;s geometry
Definition: NBEdge.cpp:512
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:1715
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:255
bool expandableBy(NBEdge *possContinuation) const
Check if Node is expandable.
Definition: NBEdge.cpp:2550
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1207
The connection was computed and validated.
Definition: NBEdge.h:117
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:494
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:941
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:549
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:153
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:2877
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:610
The edge has been loaded, nothing is computed yet.
Definition: NBEdge.h:94
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:2380
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:2955
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1553
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1389
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:261
PositionVector shape
shape of Connection
Definition: NBEdge.h:217
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:3017
bool keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:202
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:3035
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1010
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:124
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:135
void addLane(int index, bool recompute=true)
add lane
Definition: NBEdge.cpp:2699
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:876
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:2723
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1415
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:1830
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1380
friend class NBEdgeSuccessorBuilder
Definition: NBEdge.h:73
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1508
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1360
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1767
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1532
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Definition: NBEdge.h:104
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1778
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
~Connection()
destructor
Definition: NBEdge.h:181
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:501
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:2749
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:193
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:138
std::string getLaneID(int lane) const
get Lane ID (Secure)
Definition: NBEdge.cpp:2679
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:413
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:184
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:2734
TLSDisabledConnection myDefinition
definition of disable connection
Definition: NBEdge.h:1465
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:924
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:482
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:2394
static int computePrioritySum(const std::vector< int > &priorities)
computes the sum of the given list&#39;s entries (sic!)
Definition: NBEdge.cpp:2329
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:2943
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:599
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:264
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:1799
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1477
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:841
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1161
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:1051
EdgeBuildingStep
Current state of the edge within the building process.
Definition: NBEdge.h:90
bool operator()(const TLSDisabledConnection &e) const
operator ()
Definition: NBEdge.h:1450
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1383
void setAsMacroscopicConnector()
Definition: NBEdge.h:922
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:488
void setSignalOffset(double offset)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:563
int myPriority
The priority of the edge.
Definition: NBEdge.h:1366
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:1530
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
std::string origID
origin ID
Definition: NBEdge.h:211
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1347
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:516
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1488
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:536
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge&#39;s geometry at the given node.
Definition: NBEdge.cpp:1576
Class to sort edges by their angle.
Definition: NBEdge.h:1619
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1363
double myTotalAngle
Definition: NBEdge.h:1362
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:2514
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:548
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1374
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape) const
Definition: NBEdge.cpp:692
std::string getLaneIDInsecure(int lane) const
get Lane ID (Insecure)
Definition: NBEdge.cpp:2685
connections_fromlane_finder(int lane2find)
Definition: NBEdge.h:1595
The connection was given by the user.
Definition: NBEdge.h:115
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:327
double speed
The speed allowed on this lane.
Definition: NBEdge.h:132
double width
This lane&#39;s width.
Definition: NBEdge.h:144
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:2972
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2913
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:2408
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:3128
bool myAmInnerEdge
Information whether this is a junction-inner edge.
Definition: NBEdge.h:1412
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1742
Base class for objects which have an id.
Definition: Named.h:46
double myEndAngle
Definition: NBEdge.h:1361
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again ...
Definition: NBEdge.cpp:1854
int myLane2Find
index of lane to find
Definition: NBEdge.h:1604
double mySpeed
The maximal speed.
Definition: NBEdge.h:1369
std::string origID
An original ID, if given.
Definition: NBEdge.h:147
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:507
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition: NBEdge.h:241
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:595
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:526
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:57
bool myCheckRight
check if is right
Definition: NBEdge.h:1583
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:281
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:1022
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:523
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:474
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:1603
int myFromLane
index of from lane
Definition: NBEdge.h:1544
#define sign(a)
Definition: polyfonts.c:68
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:676
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
add some straight connections
Definition: NBEdge.cpp:2157
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
Definition: NBEdge.cpp:2504
PositionVector viaShape
shape of via
Definition: NBEdge.h:232
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:150
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:1789
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:757
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:834
PositionVector myToBorder
Definition: NBEdge.h:1439
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:2985
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:41
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:2831
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:278
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1630
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:2899
double mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
Definition: NBEdge.h:1434
The edge has been loaded and connections shall not be added.
Definition: NBEdge.h:92
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1569
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1377
double contPos
custom position for internal junction on this connection
Definition: NBEdge.h:205
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:244
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1502
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1566
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:3023
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1070
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1547
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:934
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:3069
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1152
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1514
std::string myType
The type of the edge.
Definition: NBEdge.h:1350
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:2629
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:900
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:443
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2367
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:1168
The connection was computed.
Definition: NBEdge.h:113
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1536
Represents a single node (junction) during network building.
Definition: NBNode.h:75
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:2934
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
Definition: NBEdge.h:102
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1250
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1107
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:2339
Direction
enum of possible directions
Definition: NBEdge.h:1244
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:2794
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:929
void checkGeometry(const double maxAngle, const double minRadius, bool fix)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:830
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2768
void insertConnection(NBEdge::Connection connection)
insert a previously created NBEdge::connection
Definition: NBEdge.cpp:1004
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:769
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:3092
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:1670
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:427
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:1811
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:2532
int myFromLane
index of from lane
Definition: NBEdge.h:1577
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:223
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:490
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:763
double myLength
The length of the edge.
Definition: NBEdge.h:1356
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
divide selected lanes on edges
Definition: NBEdge.cpp:2043
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:1658
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:1723
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1409
Lanes to edges - relationships are computed/loaded.
Definition: NBEdge.h:98
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1428
double viaVmax
Maximun velocity of via.
Definition: NBEdge.h:229
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1353
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1326
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:1036
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:2691
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:434
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:235
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:3103
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1580
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2781
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1319
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1201
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2807
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:452
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:457
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1221
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
get first non-pedestrian lane
Definition: NBEdge.cpp:3001
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.
Definition: NBEdge.cpp:779