SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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-2016 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_, bool keepClear_, SUMOReal contPos_, SUMOReal visibility_, bool haveVia_ = false);
167 
170 
172  int fromLane;
173 
176 
178  int toLane;
179 
181  std::string tlID;
182 
184  int tlLinkNo;
185 
188 
190  bool keepClear;
191 
194 
197 
199  std::string origID;
200 
202  std::string id;
203 
206 
209 
211  bool haveVia;
212 
214  std::string viaID;
215 
218 
221 
223  std::vector<int> foeInternalLinks;
224 
226  std::string foeIncomingLanes;
227 
230 
232  std::string getInternalLaneID() const;
233  };
234 
235 
238 
241 
244 
247 
250 
253 
256 
258  static const SUMOReal ANGLE_LOOKAHEAD;
261 
266  ROUNDABOUT = 1000
267  };
268 
269 public:
288  NBEdge(const std::string& id,
289  NBNode* from, NBNode* to, std::string type,
290  SUMOReal speed, int nolanes, int priority,
291  SUMOReal width, SUMOReal offset,
292  const std::string& streetName = "",
294 
295 
317  NBEdge(const std::string& id,
318  NBNode* from, NBNode* to, std::string type,
319  SUMOReal speed, int nolanes, int priority,
320  SUMOReal width, SUMOReal offset,
321  PositionVector geom,
322  const std::string& streetName = "",
323  const std::string& origID = "",
325  bool tryIgnoreNodePositions = false);
326 
338  NBEdge(const std::string& id,
339  NBNode* from, NBNode* to,
340  NBEdge* tpl,
341  const PositionVector& geom = PositionVector(),
342  int numLanes = -1);
343 
344 
346  ~NBEdge();
347 
348 
364  void reinit(NBNode* from, NBNode* to, const std::string& type,
365  SUMOReal speed, int nolanes, int priority,
366  PositionVector geom, SUMOReal width, SUMOReal offset,
367  const std::string& streetName,
369  bool tryIgnoreNodePositions = false);
370 
375  void reinitNodes(NBNode* from, NBNode* to);
376 
379 
383  void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
384 
386  void mirrorX();
388 
390 
391 
395  int getNumLanes() const {
396  return (int)myLanes.size();
397  }
398 
402  int getPriority() const {
403  return myPriority;
404  }
405 
409  NBNode* getFromNode() const {
410  return myFrom;
411  }
412 
416  NBNode* getToNode() const {
417  return myTo;
418  }
419 
425  inline SUMOReal getStartAngle() const {
426  return myStartAngle;
427  }
428 
434  inline SUMOReal getEndAngle() const {
435  return myEndAngle;
436  }
437 
443 
444 
450  SUMOReal getShapeEndAngle() const;
451 
456  inline SUMOReal getTotalAngle() const {
457  return myTotalAngle;
458  }
459 
463  SUMOReal getLength() const {
464  return myLength;
465  }
466 
467 
473  return myLoadedLength > 0 ? myLoadedLength : myLength;
474  }
475 
477  SUMOReal getFinalLength() const;
478 
482  bool hasLoadedLength() const {
483  return myLoadedLength > 0;
484  }
485 
489  SUMOReal getSpeed() const {
490  return mySpeed;
491  }
492 
499  return myStep;
500  }
501 
506  return myLaneWidth;
507  }
508 
512  SUMOReal getLaneWidth(int lane) const;
513 
515  SUMOReal getTotalWidth() const;
516 
518  const std::string& getStreetName() const {
519  return myStreetName;
520  }
521 
523  void setStreetName(const std::string& name) {
524  myStreetName = name;
525  }
526 
531  return myEndOffset;
532  }
533 
537  SUMOReal getEndOffset(int lane) const;
538 
541  return mySignalOffset;
542  }
543 
545  void setSignalOffset(SUMOReal offset) {
546  mySignalOffset = offset;
547  }
548 
552  const std::vector<NBEdge::Lane>& getLanes() const {
553  return myLanes;
554  }
556 
561  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
562 
564  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
565 
567  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
568 
571 
573 
574 
577  const PositionVector& getGeometry() const {
578  return myGeom;
579  }
580 
582  const PositionVector getInnerGeometry() const;
583 
585  bool hasDefaultGeometry() const;
586 
592  bool hasDefaultGeometryEndpoints() const;
593 
604  void setGeometry(const PositionVector& g, bool inner = false);
605 
615  void addGeometryPoint(int index, const Position& p);
616 
618  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
619 
629  void computeEdgeShape();
630 
634  const PositionVector& getLaneShape(int i) const;
635 
641 
647  return myLaneSpreadFunction;
648  }
649 
655  bool splitGeometry(NBEdgeCont& ec, NBNodeCont& nc);
656 
660  void reduceGeometry(const SUMOReal minDist);
661 
667  void checkGeometry(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix);
669 
672 
686  bool addEdge2EdgeConnection(NBEdge* dest);
687 
708  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
709  int toLane, Lane2LaneInfoType type,
710  bool mayUseSameDestination = false,
711  bool mayDefinitelyPass = false,
712  bool keepClear = true,
713  SUMOReal contPos = UNSPECIFIED_CONTPOS,
714  SUMOReal visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
715 
733  bool addLane2LaneConnections(int fromLane,
734  NBEdge* dest, int toLane, int no,
735  Lane2LaneInfoType type, bool invalidatePrevious = false,
736  bool mayDefinitelyPass = false);
737 
748  bool setConnection(int lane, NBEdge* destEdge,
749  int destLane,
750  Lane2LaneInfoType type,
751  bool mayUseSameDestination = false,
752  bool mayDefinitelyPass = false,
753  bool keepClear = true,
754  SUMOReal contPos = UNSPECIFIED_CONTPOS,
755  SUMOReal visibility = UNSPECIFIED_VISIBILITY_DISTANCE);
756 
758  void insertConnection(NBEdge::Connection connection);
759 
768  std::vector<Connection> getConnectionsFromLane(int lane) const;
769 
774  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
775 
780  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
781 
790  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
791 
798  bool isConnectedTo(NBEdge* e);
799 
803  const std::vector<Connection>& getConnections() const {
804  return myConnections;
805  }
806 
810  std::vector<Connection>& getConnections() {
811  return myConnections;
812  }
813 
818 
823 
827  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing) const;
828 
831 
834 
840  void remapConnections(const EdgeVector& incoming);
841 
848  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false);
849 
851  bool removeFromConnections(NBEdge::Connection connectionToRemove);
852 
854  void invalidateConnections(bool reallowSetting = false);
855 
857  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
858 
860  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
861 
863  void copyConnectionsFrom(NBEdge* src);
864 
866  void shiftToLanesToEdge(NBEdge* to, int laneOff);
868 
874  bool isTurningDirectionAt(const NBEdge* const edge) const;
875 
880  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
881 
887  }
888 
892  bool isMacroscopicConnector() const {
894  }
895 
897  void setIsInnerEdge() {
898  myAmInnerEdge = true;
899  }
900 
904  bool isInnerEdge() const {
905  return myAmInnerEdge;
906  }
908 
914  void setJunctionPriority(const NBNode* const node, int prio);
915 
925  int getJunctionPriority(const NBNode* const node) const;
926 
928  void setLoadedLength(SUMOReal val);
929 
932 
934  const std::string& getTypeID() const {
935  return myType;
936  }
937 
939  bool needsLaneSpecificOutput() const;
940 
942  bool hasPermissions() const;
943 
945  bool hasLaneSpecificPermissions() const;
946 
948  bool hasLaneSpecificSpeed() const;
949 
951  bool hasLaneSpecificWidth() const;
952 
954  bool hasLaneSpecificEndOffset() const;
955 
957  bool computeEdge2Edges(bool noLeftMovers);
958 
960  bool computeLanes2Edges();
961 
963  bool recheckLanes();
964 
973  void appendTurnaround(bool noTLSControlled, bool checkPermissions);
974 
978  NBNode* tryGetNodeAtPosition(SUMOReal pos, SUMOReal tolerance = 5.0) const;
979 
982 
984  bool lanesWereAssigned() const;
985 
987  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
988 
990  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
991 
994 
997 
999  PositionVector getCWBoundaryLine(const NBNode& n) const;
1000 
1002  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1003 
1005  bool expandableBy(NBEdge* possContinuation) const;
1006 
1008  void append(NBEdge* continuation);
1009 
1011  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1012 
1014  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1015 
1016  /* @brief return the turn destination if it exists
1017  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1018  * exists
1019  */
1020  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1021 
1023  std::string getLaneID(int lane) const;
1024 
1026  std::string getLaneIDInsecure(int lane) const;
1027 
1029  SUMOReal getLaneSpeed(int lane) const;
1030 
1032  bool isNearEnough2BeJoined2(NBEdge* e, SUMOReal threshold) const;
1033 
1041  SUMOReal getAngleAtNode(const NBNode* const node) const;
1042 
1051  SUMOReal getAngleAtNodeToCenter(const NBNode* const node) const;
1052 
1054  void incLaneNo(int by);
1055 
1057  void decLaneNo(int by);
1058 
1060  void deleteLane(int index, bool recompute = true);
1061 
1063  void addLane(int index, bool recompute = true);
1064 
1066  void markAsInLane2LaneState();
1067 
1069  void addSidewalk(SUMOReal width);
1070 
1072  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1073 
1075  bool hatSidewalk() const;
1076 
1078  void addBikeLane(SUMOReal width);
1079 
1081  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1082 
1084  bool hatBikelane() const;
1085 
1087  void setPermissions(SVCPermissions permissions, int lane = -1);
1088 
1090  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1091 
1093  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1094 
1096  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1097 
1099  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1100 
1102  void setLaneWidth(int lane, SUMOReal width);
1103 
1105  void setEndOffset(int lane, SUMOReal offset);
1106 
1108  void setSpeed(int lane, SUMOReal speed);
1109 
1111  SVCPermissions getPermissions(int lane = -1) const;
1112 
1114  void disableConnection4TLS(int fromLane, NBEdge* toEdge, int toLane);
1115 
1116  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1117  Lane& getLaneStruct(int lane) {
1118  assert(lane < (int)myLanes.size());
1119  return myLanes[lane];
1120  }
1121 
1122  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1123  const Lane& getLaneStruct(int lane) const {
1124  assert(lane < (int)myLanes.size());
1125  return myLanes[lane];
1126  }
1127 
1131  }
1132 
1133  /* @brief fill connection attributes shape, viaShape, ...
1134  *
1135  * @param[in,out] edgeIndex The number of connections already handled
1136  * @param[in,out] splitIndex The number of via edges already built
1137  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1138  */
1139  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1140 
1142  inline const std::vector<NBSign>& getSigns() const {
1143  return mySigns;
1144  }
1145 
1147  inline void addSign(NBSign sign) {
1148  mySigns.push_back(sign);
1149  }
1150 
1153 
1155  void setNodeBorder(const NBNode* node, const Position& p);
1156 
1157 private:
1162  private:
1164  std::map<NBEdge*, std::vector<int> > myConnections;
1165 
1168 
1169  public:
1172  : myTransitions(transitions) { }
1173 
1176 
1178  void execute(const int lane, const int virtEdge);
1179 
1181  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1182  return myConnections;
1183  }
1184 
1185  private:
1188 
1191  };
1192 
1193 
1202  public:
1205 
1207  std::vector<Direction> myDirs;
1208 
1209  public:
1211  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, int indexOfStraightest);
1212 
1214  ~MainDirections();
1215 
1217  bool empty() const;
1218 
1220  bool includes(Direction d) const;
1221 
1222  private:
1225 
1228  };
1229 
1231  PositionVector computeLaneShape(int lane, SUMOReal offset) const;
1232 
1234  void computeLaneShapes();
1235 
1236 private:
1253  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1254 
1256  void divideOnEdges(const EdgeVector* outgoing);
1257 
1259  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1260 
1262  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>* priorities);
1263 
1265  std::vector<int>* prepareEdgePriorities(const EdgeVector* outgoing);
1266 
1268  static int computePrioritySum(const std::vector<int>& priorities);
1269 
1272 
1275  void moveConnectionToLeft(int lane);
1276 
1280  void moveConnectionToRight(int lane);
1281 
1283  bool canMoveConnection(const Connection& con, int newFromLane) const;
1285 
1289  PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape) const;
1290 
1292  void computeAngle();
1293 
1295  static SUMOReal firstIntersection(const PositionVector& v1, const PositionVector& v2, SUMOReal width2);
1296 
1298  void addRestrictedLane(SUMOReal width, SUMOVehicleClass vclass);
1299 
1301  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1302 
1303 private:
1308 
1310  std::string myType;
1311 
1314 
1317 
1324 
1327 
1330 
1334  std::vector<Connection> myConnections;
1335 
1337  std::vector<Connection> myConnectionsToDelete;
1338 
1341 
1344 
1347 
1350 
1353 
1356 
1359 
1362 
1366  std::vector<Lane> myLanes;
1367 
1370 
1373 
1376 
1381  int toLane;
1382  };
1383 
1385  std::vector<TLSDisabledConnection> myTLSDisabledConnections;
1386 
1388  std::string myStreetName;
1389 
1391  std::vector<NBSign> mySigns;
1392 
1395 
1401 
1402 public:
1405  public:
1408 
1410  bool operator()(const TLSDisabledConnection& e) const {
1411  if (e.to != myDefinition.to) {
1412  return false;
1413  }
1414  if (e.fromLane != myDefinition.fromLane) {
1415  return false;
1416  }
1417  if (e.toLane != myDefinition.toLane) {
1418  return false;
1419  }
1420  return true;
1421  }
1422 
1423  private:
1426 
1427  private:
1430  };
1431 
1432 
1435  public:
1437  connections_toedge_finder(NBEdge* const edge2find, bool hasFromLane = false) :
1438  myHasFromLane(hasFromLane),
1439  myEdge2Find(edge2find) { }
1440 
1442  bool operator()(const Connection& c) const {
1443  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1444  }
1445 
1446  private:
1448  const bool myHasFromLane;
1449 
1452 
1453  private:
1456  };
1457 
1460  public:
1462  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1463  myEdge2Find(edge2find),
1464  myLane2Find(lane2find),
1465  myFromLane2Find(fromLane2find) { }
1466 
1468  bool operator()(const Connection& c) const {
1469  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1470  }
1471 
1472  private:
1475 
1478 
1481 
1482  private:
1485 
1486  };
1487 
1490  public:
1492  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1493  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1494 
1496  bool operator()(const Connection& c) const {
1497  return ((c.fromLane == myFromLane || myFromLane == -1)
1499  && (c.toLane == myLane2Find || myLane2Find == -1));
1500  }
1501 
1502  private:
1505 
1508 
1511 
1514 
1515  private:
1518 
1519  };
1520 
1523  public:
1525  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1526  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1527 
1529  bool operator()(const Connection& c) const {
1530  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1531  && c.fromLane >= 0 // already assigned
1532  && c.toEdge == myEdge2Find);
1533  }
1534 
1535  private:
1538 
1541 
1544 
1545  private:
1548 
1549  };
1550 
1553  public:
1555  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1556 
1558  bool operator()(const Connection& c) const {
1559  return c.fromLane == myLane2Find;
1560  }
1561 
1562  private:
1565 
1566  private:
1569 
1570  };
1571 
1573  static bool connections_sorter(const Connection& c1, const Connection& c2);
1574 
1580  public:
1583 
1584  public:
1586  int operator()(const Connection& c1, const Connection& c2) const;
1587 
1588  private:
1591  };
1592 
1593 private:
1595  NBEdge(const NBEdge& s);
1596 
1598  NBEdge& operator=(const NBEdge& s);
1599 };
1600 
1601 
1602 #endif
1603 
1604 /****************************************************************************/
1605 
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1171
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
get first non-pedestrian lane
Definition: NBEdge.cpp:2814
std::string id
id of Connection
Definition: NBEdge.h:202
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1223
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1111
int tlLinkNo
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:184
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:387
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1366
bool includes(Direction d) const
returns the information whether the street in the given direction has a higher priority ...
Definition: NBEdge.cpp:217
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:539
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:934
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:2253
SUMOReal endOffset
This lane'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:1791
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:178
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:237
SUMOReal myTotalAngle
Definition: NBEdge.h:1322
A class representing a single street sign.
Definition: NBSign.h:51
std::string foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:226
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1525
PositionVector shape
The lane's shape.
Definition: NBEdge.h:129
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1451
SUMOReal myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1358
std::vector< TLSDisabledConnection > myTLSDisabledConnections
vector with the disabled connections
Definition: NBEdge.h:1385
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1582
~NBEdge()
Destructor.
Definition: NBEdge.cpp:444
static const SUMOReal UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:255
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1355
SUMOReal viaVmax
Maximun velocity of via.
Definition: NBEdge.h:217
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1035
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:214
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1147
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:175
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:480
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:459
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1529
NBNode * myTo
Definition: NBEdge.h:1313
The relationships between edges are computed/loaded.
Definition: NBEdge.h:96
bool empty() const
returns the information whether no following street has a higher priority
Definition: NBEdge.cpp:211
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:912
void setNodeBorder(const NBNode *node, const Position &p)
Set Node border.
Definition: NBEdge.cpp:506
connections_toedge_finder & operator=(const connections_toedge_finder &s)
invalidated assignment operator
bool operator()(const TLSDisabledConnection &e) const
operator ()
Definition: NBEdge.h:1410
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1391
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1642
void setLaneWidth(int lane, SUMOReal width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2627
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1201
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2682
int myLane2Find
lane to find
Definition: NBEdge.h:1510
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:552
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1208
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1175
void addSidewalk(SUMOReal width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:2824
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:434
int SVCPermissions
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1480
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
Definition: NBEdge.h:1164
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:367
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:2318
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:1129
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:2061
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2242
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:486
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:115
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1468
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:2354
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:523
static const SUMOReal UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:243
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1207
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:2581
SUMOReal getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:2651
TLS Disabled Connections.
Definition: NBEdge.h:1378
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:505
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:2698
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:55
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1346
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:1491
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:187
tls_disable_finder(const TLSDisabledConnection &tpl)
constructor
Definition: NBEdge.h:1407
SUMOReal getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:1579
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:904
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1352
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1047
static const SUMOReal UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:246
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1117
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:240
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1398
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:2852
MainDirections & operator=(const MainDirections &)
Invalidated assignment operator.
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition: NBEdge.cpp:493
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:1403
void setSignalOffset(SUMOReal offset)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:545
SUMOReal getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1485
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1167
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:319
SUMOReal vmax
maximun velocity
Definition: NBEdge.h:208
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1142
The edge has been loaded, nothing is computed yet.
Definition: NBEdge.h:94
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1513
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1349
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1009
PositionVector shape
shape of Connection
Definition: NBEdge.h:205
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:2830
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:190
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1442
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:1595
SUMOReal getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition: NBEdge.h:472
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:124
connections_toedge_finder(NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1437
SUMOReal mySpeed
The maximal speed.
Definition: NBEdge.h:1329
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:2519
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:778
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:2543
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1375
bool isConnectedTo(NBEdge *e)
Returns the information whethe a connection to the given edge has been added (or computed) ...
Definition: NBEdge.cpp:959
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:474
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:449
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:1681
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1340
friend class NBEdgeSuccessorBuilder
Definition: NBEdge.h:73
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1492
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:924
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
Definition: NBEdge.cpp:226
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:953
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1620
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:402
void checkGeometry(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:732
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
~Connection()
destructor
Definition: NBEdge.h:169
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:2569
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:237
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:181
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:138
std::string getInternalLaneID() const
get ID of internal lnae
Definition: NBEdge.cpp:82
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:172
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:2554
TLSDisabledConnection myDefinition
definition of disable connection
Definition: NBEdge.h:1425
NBEdge & operator=(const NBEdge &s)
invalidated assignment operator
A list of positions.
SUMOReal myEndAngle
Definition: NBEdge.h:1321
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:826
tls_disable_finder & operator=(const tls_disable_finder &s)
invalidated assignment operator
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:2216
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1606
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:2230
bool hatBikelane() const
check if current edge hat a bikelane
Definition: NBEdge.cpp:2858
static int computePrioritySum(const std::vector< int > &priorities)
computes the sum of the given list's entries (sic!)
Definition: NBEdge.cpp:2151
static const SUMOReal UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:249
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:2756
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:810
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1181
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:1343
void setAsMacroscopicConnector()
Definition: NBEdge.h:885
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:2336
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's lane and an approached one.
Definition: NBEdge.cpp:802
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:482
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:395
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:498
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2189
SUMOReal contPos
custom position for internal junction on this connection
Definition: NBEdge.h:193
SUMOReal myLaneWidth
This width of this edge's lanes.
Definition: NBEdge.h:1361
int myPriority
The priority of the edge.
Definition: NBEdge.h:1326
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:2768
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
std::string origID
origin ID
Definition: NBEdge.h:199
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:1653
Connection(int fromLane_, NBEdge *toEdge_, int toLane_)
Constructor.
Definition: NBEdge.cpp:87
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)
Invalidated assignment operator.
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1307
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1199
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1448
std::string getLaneIDInsecure(int lane) const
get Lane ID (Insecure)
Definition: NBEdge.cpp:2505
Class to sort edges by their angle.
Definition: NBEdge.h:1579
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1236
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:1461
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1334
void setLoadedLength(SUMOReal val)
set loaded lenght
Definition: NBEdge.cpp:2741
void execute(const int lane, const int virtEdge)
executes a bresenham - step
Definition: NBEdge.cpp:128
connections_fromlane_finder(int lane2find)
Definition: NBEdge.h:1555
The connection was given by the user.
Definition: NBEdge.h:115
An upper class for objects with additional parameters.
Definition: Parameterised.h:47
SUMOReal getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.h:540
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:1063
connections_toedgelane_finder & operator=(const connections_toedgelane_finder &s)
invalidated assignment operator
SUMOReal getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:530
connections_conflict_finder & operator=(const connections_conflict_finder &s)
invalidated assignment operator
bool myAmInnerEdge
Information whether this is a junction-inner edge.
Definition: NBEdge.h:1372
bool hatSidewalk() const
check if current edge hat a sideWalk
Definition: NBEdge.cpp:2836
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:1705
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1429
int myLane2Find
index of lane to find
Definition: NBEdge.h:1564
SUMOReal myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1369
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape) const
Definition: NBEdge.cpp:612
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:229
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:55
bool myCheckRight
check if is right
Definition: NBEdge.h:1543
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2726
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:263
SUMOReal getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:2798
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:2868
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:1476
int myFromLane
index of from lane
Definition: NBEdge.h:1504
void addBikeLane(SUMOReal width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:2846
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:416
#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:1021
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:596
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
add some straight connections
Definition: NBEdge.cpp:1981
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
Definition: NBEdge.cpp:2326
PositionVector viaShape
shape of via
Definition: NBEdge.h:220
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:150
SUMOReal getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:2236
PositionVector myToBorder
Definition: NBEdge.h:1399
static const SUMOReal UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:252
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:41
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:260
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1590
SUMOReal myLength
The length of the edge.
Definition: NBEdge.h:1316
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:2712
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:577
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:1337
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:892
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1462
void reduceGeometry(const SUMOReal minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:726
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1439
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:972
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1507
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:897
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:2902
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1041
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1474
std::string myType
The type of the edge.
Definition: NBEdge.h:1310
SUMOReal mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
Definition: NBEdge.h:1394
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
void append(NBEdge *continuation)
append another edge
Definition: NBEdge.cpp:2451
connections_finder & operator=(const connections_finder &s)
invalidated assignment operator
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1123
NBNode * tryGetNodeAtPosition(SUMOReal pos, SUMOReal tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:2202
The connection was computed.
Definition: NBEdge.h:113
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.h:646
SUMOReal myStartAngle
The angles of the edge.
Definition: NBEdge.h:1320
SUMOReal getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:456
Represents a single node (junction) during network building.
Definition: NBNode.h:74
PositionVector computeLaneShape(int lane, SUMOReal offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:1531
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to, int indexOfStraightest)
constructor
Definition: NBEdge.cpp:159
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:2747
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:2479
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:1123
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1631
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:2666
void appendTurnaround(bool noTLSControlled, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
Definition: NBEdge.cpp:2161
Direction
enum of possible directions
Definition: NBEdge.h:1204
#define SUMOReal
Definition: config.h:214
bool isNearEnough2BeJoined2(NBEdge *e, SUMOReal threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:2511
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:2614
std::string getLaneID(int lane) const
get Lane ID (Secure)
Definition: NBEdge.cpp:2499
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2588
void insertConnection(NBEdge::Connection connection)
insert a previously created NBEdge::connection
Definition: NBEdge.cpp:906
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:671
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:2925
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)
invalidated assignment operator
SUMOReal getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:1587
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:1543
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:489
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:2961
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:425
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:1660
int myFromLane
index of from lane
Definition: NBEdge.h:1537
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:211
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:665
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1496
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
divide selected lanes on edges
Definition: NBEdge.cpp:1871
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:2785
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:1388
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:518
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:803
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1313
bool expandableBy(NBEdge *possContinuation) const
Check if Node is expandable.
Definition: NBEdge.cpp:2372
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:2490
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:938
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:843
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:223
~MainDirections()
destructor
Definition: NBEdge.cpp:207
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:659
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:2936
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1540
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1558
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:2601
SUMOReal width
This lane's width.
Definition: NBEdge.h:144
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1192
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1161
static const SUMOReal ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:258
SUMOReal getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:463
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
Definition: NBEdge.cpp:1449
SUMOReal visibility
custom foe visiblity for connection
Definition: NBEdge.h:196
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:409
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.
Definition: NBEdge.cpp:681