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 
133 
136 
139 
142 
145 
147  std::string origID;
148 
150  std::string oppositeID;
151  };
152 
153 
157  struct Connection {
163  Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
164 
166  Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
167  bool keepClear_ = true,
168  SUMOReal contPos_ = UNSPECIFIED_CONTPOS,
170  bool haveVia_ = false);
171 
174 
176  int fromLane;
177 
180 
182  int toLane;
183 
185  std::string tlID;
186 
188  int tlLinkNo;
189 
192 
194  bool keepClear;
195 
198 
201 
203  std::string origID;
204 
206  std::string id;
207 
210 
213 
215  bool haveVia;
216 
218  std::string viaID;
219 
222 
225 
227  std::vector<int> foeInternalLinks;
228 
230  std::string foeIncomingLanes;
231 
234 
236  std::string getInternalLaneID() const;
237 
239  std::string getDescription(const NBEdge* parent) const;
240  };
241 
242 
245 
248 
251 
254 
257 
260 
263 
265  static const SUMOReal ANGLE_LOOKAHEAD;
268 
273  ROUNDABOUT = 1000
274  };
275 
276 public:
295  NBEdge(const std::string& id,
296  NBNode* from, NBNode* to, std::string type,
297  SUMOReal speed, int nolanes, int priority,
298  SUMOReal width, SUMOReal offset,
299  const std::string& streetName = "",
301 
302 
324  NBEdge(const std::string& id,
325  NBNode* from, NBNode* to, std::string type,
326  SUMOReal speed, int nolanes, int priority,
327  SUMOReal width, SUMOReal offset,
328  PositionVector geom,
329  const std::string& streetName = "",
330  const std::string& origID = "",
332  bool tryIgnoreNodePositions = false);
333 
345  NBEdge(const std::string& id,
346  NBNode* from, NBNode* to,
347  NBEdge* tpl,
348  const PositionVector& geom = PositionVector(),
349  int numLanes = -1);
350 
351 
353  ~NBEdge();
354 
355 
371  void reinit(NBNode* from, NBNode* to, const std::string& type,
372  SUMOReal speed, int nolanes, int priority,
373  PositionVector geom, SUMOReal width, SUMOReal offset,
374  const std::string& streetName,
376  bool tryIgnoreNodePositions = false);
377 
382  void reinitNodes(NBNode* from, NBNode* to);
383 
386 
390  void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
391 
393  void mirrorX();
395 
397 
398 
402  int getNumLanes() const {
403  return (int)myLanes.size();
404  }
405 
409  int getPriority() const {
410  return myPriority;
411  }
412 
416  NBNode* getFromNode() const {
417  return myFrom;
418  }
419 
423  NBNode* getToNode() const {
424  return myTo;
425  }
426 
432  inline SUMOReal getStartAngle() const {
433  return myStartAngle;
434  }
435 
441  inline SUMOReal getEndAngle() const {
442  return myEndAngle;
443  }
444 
450 
451 
457  SUMOReal getShapeEndAngle() const;
458 
463  inline SUMOReal getTotalAngle() const {
464  return myTotalAngle;
465  }
466 
470  SUMOReal getLength() const {
471  return myLength;
472  }
473 
474 
480  return myLoadedLength > 0 ? myLoadedLength : myLength;
481  }
482 
484  SUMOReal getFinalLength() const;
485 
489  bool hasLoadedLength() const {
490  return myLoadedLength > 0;
491  }
492 
496  SUMOReal getSpeed() const {
497  return mySpeed;
498  }
499 
506  return myStep;
507  }
508 
513  return myLaneWidth;
514  }
515 
519  SUMOReal getLaneWidth(int lane) const;
520 
522  SUMOReal getTotalWidth() const;
523 
525  const std::string& getStreetName() const {
526  return myStreetName;
527  }
528 
530  void setStreetName(const std::string& name) {
531  myStreetName = name;
532  }
533 
538  return myEndOffset;
539  }
540 
544  SUMOReal getEndOffset(int lane) const;
545 
548  return mySignalOffset;
549  }
550 
552  void setSignalOffset(SUMOReal offset) {
553  mySignalOffset = offset;
554  }
555 
559  const std::vector<NBEdge::Lane>& getLanes() const {
560  return myLanes;
561  }
563 
568  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
569 
571  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
572 
574  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
575 
578 
580 
581 
584  const PositionVector& getGeometry() const {
585  return myGeom;
586  }
587 
589  const PositionVector getInnerGeometry() const;
590 
592  bool hasDefaultGeometry() const;
593 
599  bool hasDefaultGeometryEndpoints() const;
600 
611  void setGeometry(const PositionVector& g, bool inner = false);
612 
622  void addGeometryPoint(int index, const Position& p);
623 
625  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
626 
636  void computeEdgeShape();
637 
641  const PositionVector& getLaneShape(int i) const;
642 
648 
654  return myLaneSpreadFunction;
655  }
656 
662  bool splitGeometry(NBEdgeCont& ec, NBNodeCont& nc);
663 
667  void reduceGeometry(const SUMOReal minDist);
668 
674  void checkGeometry(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix);
676 
679 
693  bool addEdge2EdgeConnection(NBEdge* dest);
694 
715  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
716  int toLane, Lane2LaneInfoType type,
717  bool mayUseSameDestination = false,
718  bool mayDefinitelyPass = false,
719  bool keepClear = true,
720  SUMOReal contPos = UNSPECIFIED_CONTPOS,
721  SUMOReal visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
722 
740  bool addLane2LaneConnections(int fromLane,
741  NBEdge* dest, int toLane, int no,
742  Lane2LaneInfoType type, bool invalidatePrevious = false,
743  bool mayDefinitelyPass = false);
744 
755  bool setConnection(int lane, NBEdge* destEdge,
756  int destLane,
757  Lane2LaneInfoType type,
758  bool mayUseSameDestination = false,
759  bool mayDefinitelyPass = false,
760  bool keepClear = true,
761  SUMOReal contPos = UNSPECIFIED_CONTPOS,
762  SUMOReal visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
763 
765  void insertConnection(NBEdge::Connection connection);
766 
775  std::vector<Connection> getConnectionsFromLane(int lane) const;
776 
781  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
782 
787  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
788 
797  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
798 
805  bool isConnectedTo(const NBEdge* e) const;
806 
810  const std::vector<Connection>& getConnections() const {
811  return myConnections;
812  }
813 
817  std::vector<Connection>& getConnections() {
818  return myConnections;
819  }
820 
825 
830 
835 
839  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing) const;
840 
843 
846 
852  void remapConnections(const EdgeVector& incoming);
853 
860  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false);
861 
863  bool removeFromConnections(NBEdge::Connection connectionToRemove);
864 
866  void invalidateConnections(bool reallowSetting = false);
867 
869  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
870 
872  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
873 
875  void copyConnectionsFrom(NBEdge* src);
876 
878  void shiftToLanesToEdge(NBEdge* to, int laneOff);
880 
886  bool isTurningDirectionAt(const NBEdge* const edge) const;
887 
892  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
893 
899  }
900 
904  bool isMacroscopicConnector() const {
906  }
907 
909  void setIsInnerEdge() {
910  myAmInnerEdge = true;
911  }
912 
916  bool isInnerEdge() const {
917  return myAmInnerEdge;
918  }
920 
926  void setJunctionPriority(const NBNode* const node, int prio);
927 
937  int getJunctionPriority(const NBNode* const node) const;
938 
940  void setLoadedLength(SUMOReal val);
941 
944 
946  const std::string& getTypeID() const {
947  return myType;
948  }
949 
951  bool needsLaneSpecificOutput() const;
952 
954  bool hasPermissions() const;
955 
957  bool hasLaneSpecificPermissions() const;
958 
960  bool hasLaneSpecificSpeed() const;
961 
963  bool hasLaneSpecificWidth() const;
964 
966  bool hasLaneSpecificEndOffset() const;
967 
969  bool computeEdge2Edges(bool noLeftMovers);
970 
972  bool computeLanes2Edges();
973 
975  bool recheckLanes();
976 
985  void appendTurnaround(bool noTLSControlled, bool checkPermissions);
986 
990  NBNode* tryGetNodeAtPosition(SUMOReal pos, SUMOReal tolerance = 5.0) const;
991 
994 
996  bool lanesWereAssigned() const;
997 
999  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1000 
1002  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1003 
1006 
1009 
1011  PositionVector getCWBoundaryLine(const NBNode& n) const;
1012 
1014  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1015 
1017  bool expandableBy(NBEdge* possContinuation) const;
1018 
1020  void append(NBEdge* continuation);
1021 
1023  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1024 
1026  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1027 
1028  /* @brief return the turn destination if it exists
1029  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1030  * exists
1031  */
1032  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1033 
1035  std::string getLaneID(int lane) const;
1036 
1038  std::string getLaneIDInsecure(int lane) const;
1039 
1041  SUMOReal getLaneSpeed(int lane) const;
1042 
1044  bool isNearEnough2BeJoined2(NBEdge* e, SUMOReal threshold) const;
1045 
1053  SUMOReal getAngleAtNode(const NBNode* const node) const;
1054 
1063  SUMOReal getAngleAtNodeToCenter(const NBNode* const node) const;
1064 
1066  void incLaneNo(int by);
1067 
1069  void decLaneNo(int by);
1070 
1072  void deleteLane(int index, bool recompute = true);
1073 
1075  void addLane(int index, bool recompute = true);
1076 
1078  void markAsInLane2LaneState();
1079 
1081  void addSidewalk(SUMOReal width);
1082 
1084  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1085 
1087  void addBikeLane(SUMOReal width);
1088 
1090  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1091 
1093  void setPermissions(SVCPermissions permissions, int lane = -1);
1094 
1096  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1097 
1099  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1100 
1102  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1103 
1105  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1106 
1108  void setLaneWidth(int lane, SUMOReal width);
1109 
1111  void setEndOffset(int lane, SUMOReal offset);
1112 
1114  void setSpeed(int lane, SUMOReal speed);
1115 
1117  SVCPermissions getPermissions(int lane = -1) const;
1118 
1120  void disableConnection4TLS(int fromLane, NBEdge* toEdge, int toLane);
1121 
1122  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1123  Lane& getLaneStruct(int lane) {
1124  assert(lane >= 0);
1125  assert(lane < (int)myLanes.size());
1126  return myLanes[lane];
1127  }
1128 
1129  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1130  const Lane& getLaneStruct(int lane) const {
1131  assert(lane >= 0);
1132  assert(lane < (int)myLanes.size());
1133  return myLanes[lane];
1134  }
1135 
1139  }
1140 
1141  /* @brief fill connection attributes shape, viaShape, ...
1142  *
1143  * @param[in,out] edgeIndex The number of connections already handled
1144  * @param[in,out] splitIndex The number of via edges already built
1145  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1146  */
1147  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1148 
1150  inline const std::vector<NBSign>& getSigns() const {
1151  return mySigns;
1152  }
1153 
1155  inline void addSign(NBSign sign) {
1156  mySigns.push_back(sign);
1157  }
1158 
1161 
1163  void setNodeBorder(const NBNode* node, const Position& p);
1164 
1165 private:
1170  private:
1172  std::map<NBEdge*, std::vector<int> > myConnections;
1173 
1176 
1177  public:
1180  : myTransitions(transitions) { }
1181 
1184 
1186  void execute(const int lane, const int virtEdge);
1187 
1189  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1190  return myConnections;
1191  }
1192 
1193  private:
1196 
1199  };
1200 
1201 
1210  public:
1212  enum Direction { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD };
1213 
1215  std::vector<Direction> myDirs;
1216 
1217  public:
1219  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, int indexOfStraightest);
1220 
1222  ~MainDirections();
1223 
1225  bool empty() const;
1226 
1228  bool includes(Direction d) const;
1229 
1230  private:
1233 
1236  };
1237 
1239  PositionVector computeLaneShape(int lane, SUMOReal offset) const;
1240 
1242  void computeLaneShapes();
1243 
1244 private:
1261  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1262 
1264  void divideOnEdges(const EdgeVector* outgoing);
1265 
1267  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1268 
1270  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1271 
1273  std::vector<int>* prepareEdgePriorities(const EdgeVector* outgoing);
1274 
1276  static int computePrioritySum(const std::vector<int>& priorities);
1277 
1280 
1283  void moveConnectionToLeft(int lane);
1284 
1288  void moveConnectionToRight(int lane);
1289 
1291  bool canMoveConnection(const Connection& con, int newFromLane) const;
1293 
1297  PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape) const;
1298 
1300  void computeAngle();
1301 
1303  static SUMOReal firstIntersection(const PositionVector& v1, const PositionVector& v2, SUMOReal width2);
1304 
1306  void addRestrictedLane(SUMOReal width, SUMOVehicleClass vclass);
1307 
1309  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1310 
1311 private:
1316 
1318  std::string myType;
1319 
1322 
1325 
1332 
1335 
1338 
1342  std::vector<Connection> myConnections;
1343 
1345  std::vector<Connection> myConnectionsToDelete;
1346 
1349 
1352 
1355 
1358 
1361 
1364 
1367 
1370 
1374  std::vector<Lane> myLanes;
1375 
1378 
1381 
1384 
1389  int toLane;
1390  };
1391 
1393  std::vector<TLSDisabledConnection> myTLSDisabledConnections;
1394 
1396  std::string myStreetName;
1397 
1399  std::vector<NBSign> mySigns;
1400 
1403 
1409 
1410 public:
1413  public:
1415  tls_disable_finder(const TLSDisabledConnection& tpl) : myDefinition(tpl) { }
1416 
1418  bool operator()(const TLSDisabledConnection& e) const {
1419  if (e.to != myDefinition.to) {
1420  return false;
1421  }
1422  if (e.fromLane != myDefinition.fromLane) {
1423  return false;
1424  }
1425  if (e.toLane != myDefinition.toLane) {
1426  return false;
1427  }
1428  return true;
1429  }
1430 
1431  private:
1434 
1435  private:
1438  };
1439 
1440 
1443  public:
1445  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1446  myHasFromLane(hasFromLane),
1447  myEdge2Find(edge2find) { }
1448 
1450  bool operator()(const Connection& c) const {
1451  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1452  }
1453 
1454  private:
1456  const bool myHasFromLane;
1457 
1459  const NBEdge* const myEdge2Find;
1460 
1461  private:
1464  };
1465 
1468  public:
1470  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1471  myEdge2Find(edge2find),
1472  myLane2Find(lane2find),
1473  myFromLane2Find(fromLane2find) { }
1474 
1476  bool operator()(const Connection& c) const {
1477  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1478  }
1479 
1480  private:
1483 
1486 
1489 
1490  private:
1493 
1494  };
1495 
1498  public:
1500  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1501  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1502 
1504  bool operator()(const Connection& c) const {
1505  return ((c.fromLane == myFromLane || myFromLane == -1)
1506  && ((!myInvertEdge2find && c.toEdge == myEdge2Find) || (myInvertEdge2find && c.toEdge != myEdge2Find))
1507  && (c.toLane == myLane2Find || myLane2Find == -1));
1508  }
1509 
1510  private:
1513 
1516 
1519 
1522 
1523  private:
1526 
1527  };
1528 
1531  public:
1533  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1534  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1535 
1537  bool operator()(const Connection& c) const {
1538  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1539  && c.fromLane >= 0 // already assigned
1540  && c.toEdge == myEdge2Find);
1541  }
1542 
1543  private:
1546 
1549 
1552 
1553  private:
1556 
1557  };
1558 
1561  public:
1563  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1564 
1566  bool operator()(const Connection& c) const {
1567  return c.fromLane == myLane2Find;
1568  }
1569 
1570  private:
1573 
1574  private:
1577 
1578  };
1579 
1581  static bool connections_sorter(const Connection& c1, const Connection& c2);
1582 
1588  public:
1590  explicit connections_relative_edgelane_sorter(NBEdge* e) : myEdge(e) {}
1591 
1592  public:
1594  int operator()(const Connection& c1, const Connection& c2) const;
1595 
1596  private:
1599  };
1600 
1601 private:
1603  NBEdge(const NBEdge& s);
1604 
1606  NBEdge& operator=(const NBEdge& s);
1607 };
1608 
1609 
1610 #endif
1611 
1612 /****************************************************************************/
1613 
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1179
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
get first non-pedestrian lane
Definition: NBEdge.cpp:2851
std::string id
id of Connection
Definition: NBEdge.h:206
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1260
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1148
int tlLinkNo
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:188
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:393
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1374
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:545
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:946
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:2290
SUMOReal endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:141
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:1828
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:157
int toLane
The lane the connections yields in.
Definition: NBEdge.h:182
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:244
SUMOReal myTotalAngle
Definition: NBEdge.h:1330
A class representing a single street sign.
Definition: NBSign.h:51
std::string foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:230
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1533
PositionVector shape
The lane&#39;s shape.
Definition: NBEdge.h:129
SUMOReal myEndOffset
This edges&#39;s offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1366
std::vector< TLSDisabledConnection > myTLSDisabledConnections
vector with the disabled connections
Definition: NBEdge.h:1393
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1590
~NBEdge()
Destructor.
Definition: NBEdge.cpp:450
static const SUMOReal UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:262
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1363
SUMOReal viaVmax
Maximun velocity of via.
Definition: NBEdge.h:221
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1072
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:218
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1155
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:179
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:486
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:465
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1537
NBNode * myTo
Definition: NBEdge.h:1321
The relationships between edges are computed/loaded.
Definition: NBEdge.h:96
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:936
void setNodeBorder(const NBNode *node, const Position &p)
Set Node border.
Definition: NBEdge.cpp:512
bool operator()(const TLSDisabledConnection &e) const
operator ()
Definition: NBEdge.h:1418
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1399
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1679
void setLaneWidth(int lane, SUMOReal width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2664
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1209
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2719
int myLane2Find
lane to find
Definition: NBEdge.h:1518
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:559
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1245
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1183
void addSidewalk(SUMOReal width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:2861
SUMOReal 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:441
int SVCPermissions
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1488
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge&#39;s lanes that reach them
Definition: NBEdge.h:1172
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:373
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:2355
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition: NBEdge.h:111
void declareConnectionsAsLoaded()
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
Definition: NBEdge.h:1137
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:2098
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2279
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:492
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:121
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1476
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:2391
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:530
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1045
static const SUMOReal UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:250
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1215
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:2618
SUMOReal getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:2688
TLS Disabled Connections.
Definition: NBEdge.h:1386
Lanes to lanes - relationships are computed; should be recheked.
Definition: NBEdge.h:100
SUMOReal getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:512
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:2735
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:1354
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:1528
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:191
tls_disable_finder(const TLSDisabledConnection &tpl)
constructor
Definition: NBEdge.h:1415
SUMOReal getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:1616
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:916
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1360
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1084
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1459
static const SUMOReal UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:253
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1123
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:247
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1406
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:2879
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge&#39;s geometry
Definition: NBEdge.cpp:499
static SUMOReal firstIntersection(const PositionVector &v1, const PositionVector &v2, SUMOReal width2)
compute the first intersection point between the given lane geometries considering their rspective wi...
Definition: NBEdge.cpp:1440
void setSignalOffset(SUMOReal offset)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:552
SUMOReal getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1522
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1175
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed) ...
Definition: NBEdge.cpp:983
The connection was computed and validated.
Definition: NBEdge.h:117
void reinit(NBNode *from, NBNode *to, const std::string &type, SUMOReal speed, int nolanes, int priority, PositionVector geom, SUMOReal width, SUMOReal offset, const std::string &streetName, LaneSpreadFunction spread=LANESPREAD_RIGHT, bool tryIgnoreNodePositions=false)
Resets initial values.
Definition: NBEdge.cpp:325
SUMOReal vmax
maximun velocity
Definition: NBEdge.h:212
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1150
The edge has been loaded, nothing is computed yet.
Definition: NBEdge.h:94
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1521
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1357
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1033
PositionVector shape
shape of Connection
Definition: NBEdge.h:209
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:2867
SUMOReal speed
The speed allowed on this lane.
Definition: NBEdge.h:132
bool keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:194
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1450
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:1632
SUMOReal getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:479
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:124
SUMOReal mySpeed
The maximal speed.
Definition: NBEdge.h:1337
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:2556
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:802
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:2580
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1383
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:480
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:455
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:1718
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1348
friend class NBEdgeSuccessorBuilder
Definition: NBEdge.h:73
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1500
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Definition: NBEdge.h:104
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:948
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:977
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1657
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:409
void checkGeometry(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:756
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
~Connection()
destructor
Definition: NBEdge.h:173
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:2606
NBEdge(const std::string &id, NBNode *from, NBNode *to, std::string type, SUMOReal speed, int nolanes, int priority, SUMOReal width, SUMOReal offset, const std::string &streetName="", LaneSpreadFunction spread=LANESPREAD_RIGHT)
Constructor.
Definition: NBEdge.cpp:243
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:185
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:138
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:176
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:2591
TLSDisabledConnection myDefinition
definition of disable connection
Definition: NBEdge.h:1433
NBEdge & operator=(const NBEdge &s)
invalidated assignment operator
A list of positions.
SUMOReal myEndAngle
Definition: NBEdge.h:1329
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:850
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:2253
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1643
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:2267
static int computePrioritySum(const std::vector< int > &priorities)
computes the sum of the given list&#39;s entries (sic!)
Definition: NBEdge.cpp:2188
static const SUMOReal UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:256
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:2793
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1445
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:817
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1189
EdgeBuildingStep
Current state of the edge within the building process.
Definition: NBEdge.h:90
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1351
void setAsMacroscopicConnector()
Definition: NBEdge.h:897
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:2373
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, SUMOReal contPos=UNSPECIFIED_CONTPOS, SUMOReal visibility=UNSPECIFIED_VISIBILITY_DISTANCE)
Adds a connection between the specified this edge&#39;s lane and an approached one.
Definition: NBEdge.cpp:826
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:489
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:402
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:505
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2226
SUMOReal contPos
custom position for internal junction on this connection
Definition: NBEdge.h:197
SUMOReal myLaneWidth
This width of this edge&#39;s lanes.
Definition: NBEdge.h:1369
int myPriority
The priority of the edge.
Definition: NBEdge.h:1334
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:2805
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
std::string origID
origin ID
Definition: NBEdge.h:203
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:1690
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1315
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1236
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1456
std::string getLaneIDInsecure(int lane) const
get Lane ID (Insecure)
Definition: NBEdge.cpp:2542
Class to sort edges by their angle.
Definition: NBEdge.h:1587
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1273
SUMOReal 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:1498
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1342
void setLoadedLength(SUMOReal val)
set loaded lenght
Definition: NBEdge.cpp:2778
connections_fromlane_finder(int lane2find)
Definition: NBEdge.h:1563
The connection was given by the user.
Definition: NBEdge.h:115
An upper class for objects with additional parameters.
Definition: Parameterised.h:51
SUMOReal getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.h:547
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:1100
SUMOReal getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:537
bool myAmInnerEdge
Information whether this is a junction-inner edge.
Definition: NBEdge.h:1380
Base class for objects which have an id.
Definition: Named.h:46
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again ...
Definition: NBEdge.cpp:1742
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1466
int myLane2Find
index of lane to find
Definition: NBEdge.h:1572
SUMOReal myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1377
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape) const
Definition: NBEdge.cpp:627
std::string origID
An original ID, if given.
Definition: NBEdge.h:147
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition: NBEdge.h:233
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
bool myCheckRight
check if is right
Definition: NBEdge.h:1551
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2763
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:270
SUMOReal getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:2835
void addRestrictedLane(SUMOReal width, SUMOVehicleClass vclass)
add a lane of the given width, restricted to the given class and shift existing connections ...
Definition: NBEdge.cpp:2885
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:1513
int myFromLane
index of from lane
Definition: NBEdge.h:1512
void addBikeLane(SUMOReal width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:2873
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:423
#define sign(a)
Definition: polyfonts.c:68
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
Definition: NBEdge.cpp:1058
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:611
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
add some straight connections
Definition: NBEdge.cpp:2018
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
Definition: NBEdge.cpp:2363
PositionVector viaShape
shape of via
Definition: NBEdge.h:224
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:150
SUMOReal getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:2273
PositionVector myToBorder
Definition: NBEdge.h:1407
static const SUMOReal UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:259
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:267
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1598
SUMOReal myLength
The length of the edge.
Definition: NBEdge.h:1324
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:2749
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:584
The edge has been loaded and connections shall not be added.
Definition: NBEdge.h:92
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1345
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:904
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1470
void reduceGeometry(const SUMOReal minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:750
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1476
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:996
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1515
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:909
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:2919
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1078
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1482
std::string myType
The type of the edge.
Definition: NBEdge.h:1318
SUMOReal mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
Definition: NBEdge.h:1402
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:2488
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1130
NBNode * tryGetNodeAtPosition(SUMOReal pos, SUMOReal tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:2239
The connection was computed.
Definition: NBEdge.h:113
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:653
SUMOReal myStartAngle
The angles of the edge.
Definition: NBEdge.h:1328
SUMOReal getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:463
Represents a single node (junction) during network building.
Definition: NBNode.h:75
PositionVector computeLaneShape(int lane, SUMOReal offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:1568
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:2784
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:2516
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:1160
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1668
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
void setEndOffset(int lane, SUMOReal offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2703
void appendTurnaround(bool noTLSControlled, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
Definition: NBEdge.cpp:2198
Direction
enum of possible directions
Definition: NBEdge.h:1212
#define SUMOReal
Definition: config.h:208
bool isNearEnough2BeJoined2(NBEdge *e, SUMOReal threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:2548
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:2651
std::string getLaneID(int lane) const
get Lane ID (Secure)
Definition: NBEdge.cpp:2536
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2625
void insertConnection(NBEdge::Connection connection)
insert a previously created NBEdge::connection
Definition: NBEdge.cpp:930
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:695
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:2942
SUMOReal getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:1624
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:1580
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:496
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
SUMOReal getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:2978
SUMOReal getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
Definition: NBEdge.h:432
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:1697
int myFromLane
index of from lane
Definition: NBEdge.h:1545
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:215
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:689
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1504
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
divide selected lanes on edges
Definition: NBEdge.cpp:1908
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:2822
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:1396
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:525
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:810
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1321
bool expandableBy(NBEdge *possContinuation) const
Check if Node is expandable.
Definition: NBEdge.cpp:2409
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:2527
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:962
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, SUMOReal contPos=UNSPECIFIED_CONTPOS, SUMOReal visibility=UNSPECIFIED_VISIBILITY_DISTANCE)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:867
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:227
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:683
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:2953
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1548
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1566
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2638
SUMOReal width
This lane&#39;s width.
Definition: NBEdge.h:144
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1229
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1169
static const SUMOReal ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:265
SUMOReal getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:470
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge&#39;s geometry at the given node.
Definition: NBEdge.cpp:1486
SUMOReal visibility
custom foe visiblity for connection
Definition: NBEdge.h:200
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:416
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.
Definition: NBEdge.cpp:705