Eclipse SUMO - Simulation of Urban MObility
NBEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // The representation of a single edge during network building
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <map>
26 #include <vector>
27 #include <string>
28 #include <set>
29 #include <cassert>
30 #include <utils/common/Named.h>
34 #include <utils/geom/Bresenham.h>
38 #include "NBCont.h"
39 #include "NBHelpers.h"
40 #include "NBSign.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class NBNode;
47 class NBConnection;
48 class NBNodeCont;
49 class NBEdgeCont;
50 class OutputDevice;
51 class GNELane;
52 class NBVehicle;
53 
54 
55 // ===========================================================================
56 // class definitions
57 // ===========================================================================
62 class NBRouterEdge {
63 public:
64  virtual const std::string& getID() const = 0;
65  virtual double getSpeed() const = 0;
66  virtual double getLength() const = 0;
67  virtual const NBRouterEdge* getBidiEdge() const = 0;
68  virtual int getNumericalID() const = 0;
70  virtual bool isInternal() const {
71  return false;
72  }
73  inline bool prohibits(const NBVehicle* const /*veh*/) const {
74  return false;
75  }
76  inline bool restricts(const NBVehicle* const /*veh*/) const {
77  return false;
78  }
79 
80 
81  static inline double getTravelTimeStatic(const NBRouterEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
82  return edge->getLength() / edge->getSpeed();
83  }
84 };
85 
86 
91 class NBEdge : public Named, public Parameterised, public NBRouterEdge {
92  friend class NBEdgeCont;
93 
95  friend class GNELane;
96  friend class GNEEdge;
97  friend class GNEJunction;
98 
99 public:
100 
108  enum class EdgeBuildingStep {
112  INIT,
114  EDGE2EDGES,
116  LANES2EDGES,
123  };
124 
125 
129  enum class Lane2LaneInfoType {
131  COMPUTED,
133  USER,
135  VALIDATED
136  };
137 
138 
142  struct Lane final : public Parameterised {
144  Lane(NBEdge* e, const std::string& _origID);
145 
148 
150  double speed;
151 
154 
157 
159  double endOffset;
160 
163  std::map<int, double> stopOffsets;
164 
166  double width;
167 
169  std::string oppositeID;
170 
172  bool accelRamp;
173 
175  // @note (see NIImporter_DlrNavteq::ConnectedLanesHandler)
177 
180 
182  std::string type;
183  };
184 
188  struct Connection final : public Parameterised, public NBRouterEdge {
194  Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
195 
197  Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
198  KeepClear keepClear_ = KEEPCLEAR_UNSPECIFIED,
199  double contPos_ = UNSPECIFIED_CONTPOS,
200  double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
201  double speed_ = UNSPECIFIED_SPEED,
202  double length_ = myDefaultConnectionLength,
203  bool haveVia_ = false,
204  bool uncontrolled_ = false,
205  const PositionVector& customShape_ = PositionVector::EMPTY,
207 
209  int fromLane;
210 
213 
215  int toLane;
216 
218  std::string tlID;
219 
222 
225 
228 
231 
233  double contPos;
234 
236  double visibility;
237 
239  double speed;
240 
242  double customLength;
243 
246 
249 
251  std::string id;
252 
255 
257  double vmax;
258 
260  bool haveVia;
261 
263  std::string viaID;
264 
267 
269  double viaLength;
270 
272  std::vector<int> foeInternalLinks;
273 
275  std::vector<std::string> foeIncomingLanes;
276 
279 
282 
284  std::string getInternalLaneID() const;
285 
287  std::string getDescription(const NBEdge* parent) const;
288 
290  double length;
291 
295  const std::string& getID() const {
296  return id;
297  }
298  double getSpeed() const {
299  return vmax;
300  }
301  double getLength() const {
302  return shape.length() + viaShape.length();
303  }
304  int getNumericalID() const {
305  throw ProcessError("NBEdge::Connection does not implement getNumericalID()");
306  }
307  const Connection* getBidiEdge() const {
308  return nullptr;
309  }
310  bool isInternal() const {
311  return true;
312  }
314  UNUSED_PARAMETER(vClass);
315  return myViaSuccessors;
316  }
318  };
319 
322 
324  static const double UNSPECIFIED_WIDTH;
325 
327  static const double UNSPECIFIED_OFFSET;
328 
330  static const double UNSPECIFIED_SPEED;
331 
333  static const double UNSPECIFIED_CONTPOS;
334 
336  static const double UNSPECIFIED_VISIBILITY_DISTANCE;
337 
339  static const double UNSPECIFIED_LOADED_LENGTH;
340 
342  static const double UNSPECIFIED_SIGNAL_OFFSET;
343 
345  static const double ANGLE_LOOKAHEAD;
346 
349 
352 
357  ROUNDABOUT = 1000
358  };
359 
360  static void setDefaultConnectionLength(double length) {
361  myDefaultConnectionLength = length;
362  }
363 
364 public:
383  NBEdge(const std::string& id,
384  NBNode* from, NBNode* to, std::string type,
385  double speed, int nolanes, int priority,
386  double width, double endOffset,
387  const std::string& streetName = "",
389 
390 
412  NBEdge(const std::string& id,
413  NBNode* from, NBNode* to, std::string type,
414  double speed, int nolanes, int priority,
415  double width, double endOffset,
416  PositionVector geom,
417  const std::string& streetName = "",
418  const std::string& origID = "",
420  bool tryIgnoreNodePositions = false);
421 
433  NBEdge(const std::string& id,
434  NBNode* from, NBNode* to,
435  const NBEdge* tpl,
436  const PositionVector& geom = PositionVector(),
437  int numLanes = -1);
438 
439 
441  ~NBEdge();
442 
443 
459  void reinit(NBNode* from, NBNode* to, const std::string& type,
460  double speed, int nolanes, int priority,
461  PositionVector geom, double width, double endOffset,
462  const std::string& streetName,
464  bool tryIgnoreNodePositions = false);
465 
470  void reinitNodes(NBNode* from, NBNode* to);
471 
474 
478  void reshiftPosition(double xoff, double yoff);
479 
481  void mirrorX();
483 
485 
486 
490  int getNumLanes() const {
491  return (int)myLanes.size();
492  }
493 
497  int getPriority() const {
498  return myPriority;
499  }
500 
502  void setPriority(int priority) {
503  myPriority = priority;
504  }
505 
509  inline NBNode* getFromNode() const {
510  return myFrom;
511  }
512 
516  inline NBNode* getToNode() const {
517  return myTo;
518  }
519 
525  inline double getStartAngle() const {
526  return myStartAngle;
527  }
528 
534  inline double getEndAngle() const {
535  return myEndAngle;
536  }
537 
542  double getShapeStartAngle() const;
543 
544 
550  double getShapeEndAngle() const;
551 
556  inline double getTotalAngle() const {
557  return myTotalAngle;
558  }
559 
563  double getLength() const {
564  return myLength;
565  }
566 
567 
572  double getLoadedLength() const {
573  return myLoadedLength > 0 ? myLoadedLength : myLength;
574  }
575 
577  double getFinalLength() const;
578 
582  bool hasLoadedLength() const {
583  return myLoadedLength > 0;
584  }
585 
589  double getSpeed() const {
590  return mySpeed;
591  }
592 
599  return myStep;
600  }
601 
605  double getLaneWidth() const {
606  return myLaneWidth;
607  }
608 
612  double getLaneWidth(int lane) const;
613 
615  double getTotalWidth() const;
616 
618  const std::string& getStreetName() const {
619  return myStreetName;
620  }
621 
623  void setStreetName(const std::string& name) {
624  myStreetName = name;
625  }
626 
630  double getEndOffset() const {
631  return myEndOffset;
632  }
633 
634  double getDistance() const {
635  return myDistance;
636  }
637 
641  const std::map<int, double>& getStopOffsets() const {
642  return myStopOffsets;
643  }
644 
648  double getEndOffset(int lane) const;
649 
653  const std::map<int, double>& getStopOffsets(int lane) const;
654 
656  double getSignalOffset() const;
657 
659  const Position& getSignalPosition() const {
660  return mySignalPosition;
661  }
662 
664  const NBNode* getSignalNode() const {
665  return mySignalNode;
666  }
667 
669  void setSignalPosition(const Position& pos, const NBNode* signalNode) {
670  mySignalPosition = pos;
671  mySignalNode = signalNode;
672  }
673 
677  const std::vector<NBEdge::Lane>& getLanes() const {
678  return myLanes;
679  }
681 
686  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
687 
689  int getSpecialLane(SVCPermissions permissions) const;
690 
694  int getFirstAllowedLaneIndex(int direction) const;
695 
697  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
698 
700  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
701 
703  int getNumLanesThatAllow(SVCPermissions permissions) const;
704 
706  double getCrossingAngle(NBNode* node);
707 
709  std::string getSidewalkID();
710 
712 
713 
716  const PositionVector& getGeometry() const {
717  return myGeom;
718  }
719 
721  const PositionVector getInnerGeometry() const;
722 
724  bool hasDefaultGeometry() const;
725 
731  bool hasDefaultGeometryEndpoints() const;
732 
738  bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
739 
740  Position getEndpointAtNode(const NBNode* node) const;
741 
752  void setGeometry(const PositionVector& g, bool inner = false);
753 
763  void addGeometryPoint(int index, const Position& p);
764 
766  void extendGeometryAtNode(const NBNode* node, double maxExtent);
767 
769  void shortenGeometryAtNode(const NBNode* node, double reduction);
770 
772  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
773 
775  Position geometryPositionAtOffset(double offset) const;
776 
786  void computeEdgeShape(double smoothElevationThreshold = -1);
787 
791  const PositionVector& getLaneShape(int i) const;
792 
798 
804  return myLaneSpreadFunction;
805  }
806 
810  void reduceGeometry(const double minDist);
811 
817  void checkGeometry(const double maxAngle, const double minRadius, bool fix, bool silent);
819 
822 
836  bool addEdge2EdgeConnection(NBEdge* dest, bool overrideRemoval = false);
837 
858  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
859  int toLane, Lane2LaneInfoType type,
860  bool mayUseSameDestination = false,
861  bool mayDefinitelyPass = false,
862  KeepClear keepClear = KEEPCLEAR_UNSPECIFIED,
863  double contPos = UNSPECIFIED_CONTPOS,
864  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
865  double speed = UNSPECIFIED_SPEED,
866  double length = myDefaultConnectionLength,
867  const PositionVector& customShape = PositionVector::EMPTY,
868  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
870  bool postProcess = false);
871 
889  bool addLane2LaneConnections(int fromLane,
890  NBEdge* dest, int toLane, int no,
891  Lane2LaneInfoType type, bool invalidatePrevious = false,
892  bool mayDefinitelyPass = false);
893 
904  bool setConnection(int lane, NBEdge* destEdge,
905  int destLane,
906  Lane2LaneInfoType type,
907  bool mayUseSameDestination = false,
908  bool mayDefinitelyPass = false,
909  KeepClear keepClear = KEEPCLEAR_UNSPECIFIED,
910  double contPos = UNSPECIFIED_CONTPOS,
911  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
912  double speed = UNSPECIFIED_SPEED,
913  double length = myDefaultConnectionLength,
914  const PositionVector& customShape = PositionVector::EMPTY,
915  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
916  SVCPermissions permissions = SVC_UNSPECIFIED,
917  bool postProcess = false);
918 
929  std::vector<Connection> getConnectionsFromLane(int lane, NBEdge* to = nullptr, int toLane = -1) const;
930 
935  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
936 
941  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
942 
951  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
952 
959  bool isConnectedTo(const NBEdge* e, const bool ignoreTurnaround = false) const;
960 
964  const std::vector<Connection>& getConnections() const {
965  return myConnections;
966  }
967 
971  std::vector<Connection>& getConnections() {
972  return myConnections;
973  }
974 
979 
984 
989 
993  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing, bool withBikes = true) const;
994 
997 
1000 
1006  void remapConnections(const EdgeVector& incoming);
1007 
1015  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false, const bool keepPossibleTurns = false);
1016 
1018  bool removeFromConnections(const NBEdge::Connection& connectionToRemove);
1019 
1021  void invalidateConnections(bool reallowSetting = false);
1022 
1024  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
1025 
1027  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
1028 
1030  void copyConnectionsFrom(NBEdge* src);
1031 
1033  void shiftToLanesToEdge(NBEdge* to, int laneOff);
1035 
1041  bool isTurningDirectionAt(const NBEdge* const edge) const;
1042 
1047  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
1048 
1053  myAmMacroscopicConnector = true;
1054  }
1055 
1059  bool isMacroscopicConnector() const {
1060  return myAmMacroscopicConnector;
1061  }
1062 
1064  void setInsideTLS(bool inside) {
1065  myAmInTLS = inside;
1066  }
1067 
1071  bool isInsideTLS() const {
1072  return myAmInTLS;
1073  }
1075 
1081  void setJunctionPriority(const NBNode* const node, int prio);
1082 
1092  int getJunctionPriority(const NBNode* const node) const;
1093 
1095  void setLoadedLength(double val);
1096 
1098  void setAverageLengthWithOpposite(double val);
1099 
1102 
1104  const std::string& getTypeID() const {
1105  return myType;
1106  }
1107 
1109  bool needsLaneSpecificOutput() const;
1110 
1112  bool hasPermissions() const;
1113 
1115  bool hasLaneSpecificPermissions() const;
1116 
1118  bool hasLaneSpecificSpeed() const;
1119 
1121  bool hasLaneSpecificWidth() const;
1122 
1124  bool hasLaneSpecificType() const;
1125 
1127  bool hasLaneSpecificEndOffset() const;
1128 
1130  bool hasLaneSpecificStopOffsets() const;
1131 
1133  bool hasAccelLane() const;
1134 
1136  bool hasCustomLaneShape() const;
1137 
1139  bool hasLaneParams() const;
1140 
1142  bool computeEdge2Edges(bool noLeftMovers);
1143 
1145  bool computeLanes2Edges();
1146 
1148  bool recheckLanes();
1149 
1158  void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions);
1159 
1163  NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1164 
1166  double getMaxLaneOffset();
1167 
1169  bool lanesWereAssigned() const;
1170 
1172  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1173 
1175  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1176 
1179 
1182 
1184  PositionVector getCWBoundaryLine(const NBNode& n) const;
1185 
1187  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1188 
1190  bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1191 
1193  void append(NBEdge* continuation);
1194 
1196  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1197 
1199  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1200 
1201  /* @brief return the turn destination if it exists
1202  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1203  * exists
1204  */
1205  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1206 
1208  std::string getLaneID(int lane) const;
1209 
1211  double getLaneSpeed(int lane) const;
1212 
1214  bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1215 
1223  double getAngleAtNode(const NBNode* const node) const;
1224 
1233  double getAngleAtNodeToCenter(const NBNode* const node) const;
1234 
1236  void incLaneNo(int by);
1237 
1239  void decLaneNo(int by);
1240 
1242  void deleteLane(int index, bool recompute, bool shiftIndices);
1243 
1245  void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices);
1246 
1248  void markAsInLane2LaneState();
1249 
1251  void addSidewalk(double width);
1252 
1254  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1255 
1257  void addBikeLane(double width);
1258 
1260  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1261 
1263  void addRestrictedLane(double width, SUMOVehicleClass vclass);
1264 
1266  void setPermissions(SVCPermissions permissions, int lane = -1);
1267 
1269  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1270 
1272  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1273 
1275  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1276 
1278  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1279 
1281  void setLaneWidth(int lane, double width);
1282 
1284  void setLaneType(int lane, const std::string& type);
1285 
1287  void setEndOffset(int lane, double offset);
1288 
1290  void setSpeed(int lane, double speed);
1291 
1294  bool setStopOffsets(int lane, std::map<int, double> offsets, bool overwrite = false);
1295 
1297  void setAcceleration(int lane, bool accelRamp);
1298 
1300  void markOffRamp(bool isOffRamp) {
1302  }
1303 
1304  bool isOffRamp() const {
1305  return myIsOffRamp;
1306  }
1307 
1309  void setLaneShape(int lane, const PositionVector& shape);
1310 
1312  SVCPermissions getPermissions(int lane = -1) const;
1313 
1315  void setOrigID(const std::string origID);
1316 
1318  void setDistance(double distance) {
1319  myDistance = distance;
1320  }
1321 
1323  void disableConnection4TLS(int fromLane, NBEdge* toEdge, int toLane);
1324 
1325  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1326  Lane& getLaneStruct(int lane) {
1327  assert(lane >= 0);
1328  assert(lane < (int)myLanes.size());
1329  return myLanes[lane];
1330  }
1331 
1332  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1333  const Lane& getLaneStruct(int lane) const {
1334  assert(lane >= 0);
1335  assert(lane < (int)myLanes.size());
1336  return myLanes[lane];
1337  }
1338 
1341  myStep = step;
1342  }
1343 
1344  /* @brief fill connection attributes shape, viaShape, ...
1345  *
1346  * @param[in,out] edgeIndex The number of connections already handled
1347  * @param[in,out] splitIndex The number of via edges already built
1348  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1349  */
1350  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1351 
1353  inline const std::vector<NBSign>& getSigns() const {
1354  return mySigns;
1355  }
1356 
1358  inline void addSign(NBSign sign) {
1359  mySigns.push_back(sign);
1360  }
1361 
1364 
1366  void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1367  const PositionVector& getNodeBorder(const NBNode* node) const;
1368  void resetNodeBorder(const NBNode* node);
1369 
1371  bool isBidiRail(bool ignoreSpread = false) const;
1372 
1374  bool isRailDeadEnd() const;
1375 
1377  void debugPrintConnections(bool outgoing = true, bool incoming = false) const;
1378 
1380  static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width2, const std::string& error = "");
1381 
1385  static PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape);
1386 
1388 
1389 
1390  static inline double getTravelTimeStatic(const NBEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
1391  return edge->getLength() / edge->getSpeed();
1392  }
1393 
1394  static int getLaneIndexFromLaneID(const std::string laneID);
1395 
1397  void setNumericalID(int index) {
1398  myIndex = index;
1399  }
1400 
1405  int getNumericalID() const {
1406  return myIndex;
1407  }
1408 
1409  const NBEdge* getBidiEdge() const {
1410  return isBidiRail() ? myPossibleTurnDestination : nullptr;
1411  }
1412 
1415  const EdgeVector& getSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const;
1416 
1417 
1421 
1423  const std::string& getID() const {
1424  return Named::getID();
1425  }
1426 
1428  bool joinLanes(SVCPermissions perms);
1429 
1431  void resetLaneShapes();
1432 
1435  NBEdge* getStraightContinuation(SVCPermissions permissions) const;
1436 
1439  NBEdge* getStraightPredecessor(SVCPermissions permissions) const;
1440 
1442  static EdgeVector filterByPermissions(const EdgeVector& edges, SVCPermissions permissions);
1443 
1444 private:
1449  private:
1451  std::map<NBEdge*, std::vector<int> > myConnections;
1452 
1455 
1456  public:
1459  : myTransitions(transitions) { }
1460 
1463 
1465  void execute(const int lane, const int virtEdge);
1466 
1468  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1469  return myConnections;
1470  }
1471 
1472  private:
1475 
1478  };
1479 
1480 
1489  public:
1491  enum class Direction {
1492  RIGHTMOST,
1493  LEFTMOST,
1494  FORWARD
1495  };
1496 
1497  public:
1499  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, const std::vector<int>& availableLanes);
1500 
1502  ~MainDirections();
1503 
1505  int getStraightest() const {
1506  return myStraightest;
1507  }
1508 
1510  bool empty() const;
1511 
1513  bool includes(Direction d) const;
1514 
1515  private:
1518 
1520  std::vector<Direction> myDirs;
1521 
1524 
1527  };
1528 
1530  PositionVector computeLaneShape(int lane, double offset) const;
1531 
1533  void computeLaneShapes();
1534 
1535 private:
1552  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1553 
1555  void divideOnEdges(const EdgeVector* outgoing);
1556 
1558  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1559 
1561  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>& priorities);
1562 
1564  const std::vector<int> prepareEdgePriorities(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1565 
1568 
1571  void moveConnectionToLeft(int lane);
1572 
1576  void moveConnectionToRight(int lane);
1577 
1579  bool canMoveConnection(const Connection& con, int newFromLane) const;
1581 
1583  void computeAngle();
1584 
1586  bool bothLeftTurns(const NBNode& n, LinkDirection dir, const NBEdge* otherFrom, const NBEdge::Connection& otherCon) const;
1587  bool haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon,
1588  int numPoints, double width2, int shapeFlag = 0) const;
1589 
1591  bool hasRestrictedLane(SUMOVehicleClass vclass) const;
1592 
1594  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1595 
1597  void assignInternalLaneLength(std::vector<Connection>::iterator i, int numLanes, double lengthSum);
1598 
1599 private:
1604 
1606  std::string myType;
1607 
1610 
1612  double myLength;
1613 
1617  double myEndAngle;
1620 
1623 
1625  double mySpeed;
1626 
1628  double myDistance;
1629 
1633  std::vector<Connection> myConnections;
1634 
1636  std::vector<Connection> myConnectionsToDelete;
1637 
1640 
1643 
1646 
1649 
1652 
1655 
1657  double myEndOffset;
1658 
1663  std::map<int, double> myStopOffsets;
1664 
1666  double myLaneWidth;
1667 
1671  std::vector<Lane> myLanes;
1672 
1675 
1678 
1681 
1683  std::string myStreetName;
1684 
1686  std::vector<NBSign> mySigns;
1687 
1691 
1697 
1700 
1702  int myIndex;
1703 
1704  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1706 
1707  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1709 
1710  // @brief default length for overriding connection lengths
1712 
1713 public:
1714 
1717  public:
1719  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1720  myHasFromLane(hasFromLane),
1721  myEdge2Find(edge2find) { }
1722 
1724  bool operator()(const Connection& c) const {
1725  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1726  }
1727 
1728  private:
1730  const bool myHasFromLane;
1731 
1733  const NBEdge* const myEdge2Find;
1734 
1735  private:
1738  };
1739 
1742  public:
1744  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1745  myEdge2Find(edge2find),
1746  myLane2Find(lane2find),
1747  myFromLane2Find(fromLane2find) { }
1748 
1750  bool operator()(const Connection& c) const {
1751  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1752  }
1753 
1754  private:
1757 
1760 
1763 
1764  private:
1767 
1768  };
1769 
1772  public:
1774  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1775  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1776 
1778  bool operator()(const Connection& c) const {
1779  return ((c.fromLane == myFromLane || myFromLane == -1)
1781  && (c.toLane == myLane2Find || myLane2Find == -1));
1782  }
1783 
1784  private:
1787 
1790 
1793 
1796 
1797  private:
1800 
1801  };
1802 
1805  public:
1807  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1808  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1809 
1811  bool operator()(const Connection& c) const {
1812  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1813  && c.fromLane >= 0 // already assigned
1814  && c.toEdge == myEdge2Find);
1815  }
1816 
1817  private:
1820 
1823 
1826 
1827  private:
1830 
1831  };
1832 
1835  public:
1837  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1838 
1840  bool operator()(const Connection& c) const {
1841  return c.fromLane == myLane2Find;
1842  }
1843 
1844  private:
1847 
1848  private:
1851 
1852  };
1853 
1855  static bool connections_sorter(const Connection& c1, const Connection& c2);
1856 
1862  public:
1865 
1866  public:
1868  int operator()(const Connection& c1, const Connection& c2) const;
1869 
1870  private:
1873  };
1874 
1875 private:
1877  NBEdge(const NBEdge& s);
1878 
1881 
1883  NBEdge();
1884 
1885 };
std::vector< std::pair< const NBRouterEdge *, const NBRouterEdge * > > ConstRouterEdgePairVector
Definition: NBCont.h:45
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
KeepClear
keepClear status of connections
Definition: NBCont.h:57
@ KEEPCLEAR_UNSPECIFIED
Definition: NBCont.h:60
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:29
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1488
bool empty() const
returns the information whether no following street has a higher priority
Definition: NBEdge.cpp:247
MainDirections & operator=(const MainDirections &)
Invalidated assignment operator.
bool includes(Direction d) const
returns the information whether the street in the given direction has a higher priority
Definition: NBEdge.cpp:253
MainDirections(const MainDirections &)
Invalidated copy constructor.
int getStraightest() const
returns the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1505
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to, const std::vector< int > &availableLanes)
constructor
Definition: NBEdge.cpp:190
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1520
~MainDirections()
destructor
Definition: NBEdge.cpp:243
int myStraightest
the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1517
Direction
enum of possible directions
Definition: NBEdge.h:1491
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1448
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)
Invalidated assignment operator.
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1462
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1458
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1454
ToEdgeConnectionsAdder(const ToEdgeConnectionsAdder &)
Invalidated copy constructor.
void execute(const int lane, const int virtEdge)
executes a bresenham - step
Definition: NBEdge.cpp:159
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1468
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
Definition: NBEdge.h:1451
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1822
connections_conflict_finder & operator=(const connections_conflict_finder &s)
invalidated assignment operator
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1811
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1807
bool myCheckRight
check if is right
Definition: NBEdge.h:1825
int myFromLane
index of from lane
Definition: NBEdge.h:1819
int myLane2Find
lane to find
Definition: NBEdge.h:1792
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1778
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1774
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1789
int myFromLane
index of from lane
Definition: NBEdge.h:1786
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1795
connections_finder & operator=(const connections_finder &s)
invalidated assignment operator
int myLane2Find
index of lane to find
Definition: NBEdge.h:1846
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1840
connections_fromlane_finder(int lane2find)
@briefconstructor
Definition: NBEdge.h:1837
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)
invalidated assignment operator
Class to sort edges by their angle.
Definition: NBEdge.h:1861
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1872
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
Definition: NBEdge.cpp:262
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1864
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1719
connections_toedge_finder & operator=(const connections_toedge_finder &s)
invalidated assignment operator
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1730
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1724
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1733
connections_toedgelane_finder & operator=(const connections_toedgelane_finder &s)
invalidated assignment operator
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1750
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1744
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1762
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1756
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
The representation of a single edge during network building.
Definition: NBEdge.h:91
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:623
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:913
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:552
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:3641
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1982
std::map< int, double > myStopOffsets
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
Definition: NBEdge.h:1663
bool addEdge2EdgeConnection(NBEdge *dest, bool overrideRemoval=false)
Adds a connection to another edge.
Definition: NBEdge.cpp:985
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:563
double myLaneWidth
This width of this edge's lanes.
Definition: NBEdge.h:1666
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3655
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1558
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1636
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1214
double myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1657
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1648
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:3627
bool isInsideTLS() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:1071
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:354
@ ROUNDABOUT
Definition: NBEdge.h:357
@ PRIORITY_ROAD
Definition: NBEdge.h:356
@ MINOR_ROAD
Definition: NBEdge.h:355
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition: NBEdge.h:572
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:3776
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:3829
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition: NBEdge.cpp:3181
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:454
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3597
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition: NBEdge.cpp:428
double mySpeed
The maximal speed.
Definition: NBEdge.h:1625
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:605
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:3141
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1633
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:1180
NBEdge()
constructor for dummy edge
Definition: NBEdge.cpp:374
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:2581
ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:1708
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:3161
void setOrigID(const std::string origID)
set origID for all lanes
Definition: NBEdge.cpp:3975
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:3402
static EdgeVector filterByPermissions(const EdgeVector &edges, SVCPermissions permissions)
return only those edges that permit at least one of the give permissions
Definition: NBEdge.cpp:4075
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:618
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
Definition: NBEdge.cpp:3359
void markOffRamp(bool isOffRamp)
marks this edge has being an offRamp or leading to one (used for connection computation)
Definition: NBEdge.h:1300
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:2196
void setAverageLengthWithOpposite(double val)
patch average lane length in regard to the opposite edge
Definition: NBEdge.cpp:3675
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3465
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:2155
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:348
void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished and a turning direction exists (myT...
Definition: NBEdge.cpp:2933
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:3690
std::string myType
The type of the edge.
Definition: NBEdge.h:1606
const Position & getSignalPosition() const
Returns the position of a traffic signal on this edge.
Definition: NBEdge.h:659
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:2171
double myTotalAngle
Definition: NBEdge.h:1618
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.h:803
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:581
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:713
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
Definition: NBEdge.h:351
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:3990
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:3681
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:2302
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:598
void setInsideTLS(bool inside)
Marks this edge being within an intersection.
Definition: NBEdge.h:1064
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1654
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1530
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:3835
Position getEndpointAtNode(const NBNode *node) const
Definition: NBEdge.cpp:599
NBEdge * getStraightContinuation(SVCPermissions permissions) const
return the straightest follower edge for the given permissions or nullptr (never returns turn-arounds...
Definition: NBEdge.cpp:4086
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:3478
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:582
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:3823
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
divide selected lanes on edges
Definition: NBEdge.cpp:2653
int getNumericalID() const
Returns the index (numeric id) of the edge.
Definition: NBEdge.h:1405
void setDistance(double distance)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.h:1318
const NBNode * getSignalNode() const
Returns the node that (possibly) represents a traffic signal controlling at the end of this edge.
Definition: NBEdge.h:664
static double getTravelTimeStatic(const NBEdge *const edge, const NBVehicle *const, double)
Definition: NBEdge.h:1390
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1353
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
Definition: NBEdge.cpp:2240
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:655
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:3713
const std::string & getID() const
Definition: NBEdge.h:1423
EdgeVector mySuccessors
Definition: NBEdge.h:1705
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:677
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:3908
void checkGeometry(const double maxAngle, const double minRadius, bool fix, bool silent)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:939
static double myDefaultConnectionLength
Definition: NBEdge.h:1711
bool bothLeftTurns(const NBNode &n, LinkDirection dir, const NBEdge *otherFrom, const NBEdge::Connection &otherCon) const
determine conflict between opposite left turns
Definition: NBEdge.cpp:1901
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:3351
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1603
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:516
void setLaneType(int lane, const std::string &type)
set lane specific type (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3506
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:2338
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1333
EdgeBuildingStep
Current state of the edge within the building process.
Definition: NBEdge.h:108
@ INIT_REJECT_CONNECTIONS
The edge has been loaded and connections shall not be added.
@ EDGE2EDGES
The relationships between edges are computed/loaded.
@ LANES2LANES_RECHECK
Lanes to lanes - relationships are computed; should be recheked.
@ LANES2LANES_DONE
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
@ LANES2EDGES
Lanes to edges - relationships are computed/loaded.
@ LANES2LANES_USER
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
@ INIT
The edge has been loaded, nothing is computed yet.
NBEdge * getStraightPredecessor(SVCPermissions permissions) const
return the straightest predecessor edge for the given permissions or nullptr (never returns turn-arou...
Definition: NBEdge.cpp:4101
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1302
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:589
~NBEdge()
Destructor.
Definition: NBEdge.cpp:527
NBNode * myTo
Definition: NBEdge.h:1609
double myEndAngle
Definition: NBEdge.h:1617
int getFirstAllowedLaneIndex(int direction) const
return the first lane that permits at least 1 vClass or the last lane if search direction of there is...
Definition: NBEdge.cpp:3739
double getDistance() const
Definition: NBEdge.h:634
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:339
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3491
void resetLaneShapes()
reset lane shapes to what they would be before cutting with the junction shapes
Definition: NBEdge.cpp:1987
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:3070
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:3612
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:3019
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:907
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:3133
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:3006
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > &priorities)
add some straight connections
Definition: NBEdge.cpp:2758
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:2182
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:2286
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:2057
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1152
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:342
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:3817
void reinit(NBNode *from, NBNode *to, const std::string &type, double speed, int nolanes, int priority, PositionVector geom, double width, double endOffset, const std::string &streetName, LaneSpreadFunction spread=LaneSpreadFunction::RIGHT, bool tryIgnoreNodePositions=false)
Resets initial values.
Definition: NBEdge.cpp:380
bool setStopOffsets(int lane, std::map< int, double > offsets, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3568
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:3325
NBEdge(const NBEdge &s)
invalidated copy constructor
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1671
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:490
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:716
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:2254
PositionVector myToBorder
Definition: NBEdge.h:1695
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:618
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:333
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:345
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:923
static NBEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
Definition: NBEdge.h:321
bool joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
Definition: NBEdge.cpp:4055
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:702
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:3445
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:3059
void addRestrictedLane(double width, SUMOVehicleClass vclass)
add a lane of the given width, restricted to the given class and shift existing connections
Definition: NBEdge.cpp:3851
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false, const bool keepPossibleTurns=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:1318
double myLength
The length of the edge.
Definition: NBEdge.h:1612
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
@brif get first non-pedestrian lane
Definition: NBEdge.cpp:3792
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1399
const std::vector< int > prepareEdgePriorities(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
recomputes the edge priorities and manipulates them for a distribution of lanes on edges which is mor...
Definition: NBEdge.cpp:2840
int myIndex
the index of the edge in the list of all edges. Set by NBEdgeCont and requires re-set whenever the li...
Definition: NBEdge.h:1702
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:3528
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:739
Position geometryPositionAtOffset(double offset) const
return position taking into account loaded length
Definition: NBEdge.cpp:3944
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:336
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1521
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3452
bool isConnectedTo(const NBEdge *e, const bool ignoreTurnaround=false) const
Returns the information whethe a connection to the given edge has been added (or computed)
Definition: NBEdge.cpp:1201
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1358
bool haveIntersection(const NBNode &n, const PositionVector &shape, const NBEdge *otherFrom, const NBEdge::Connection &otherCon, int numPoints, double width2, int shapeFlag=0) const
Definition: NBEdge.cpp:1911
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:3053
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Definition: NBEdge.cpp:3413
const std::map< int, double > & getStopOffsets() const
Returns the stopOffset to the end of the edge.
Definition: NBEdge.h:641
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1686
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1642
const PositionVector & getNodeBorder(const NBNode *node) const
Definition: NBEdge.cpp:691
int getNumLanesThatAllow(SVCPermissions permissions) const
get lane indices that allow the given permissions
Definition: NBEdge.cpp:3765
const NBNode * mySignalNode
Definition: NBEdge.h:1690
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:2207
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
Definition: NBEdge.h:1397
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1545
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:3753
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:532
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:3033
std::string getLaneID(int lane) const
get lane ID
Definition: NBEdge.cpp:3345
bool myIsOffRamp
whether this edge is an Off-Ramp or leads to one
Definition: NBEdge.h:1699
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1066
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:330
Lane2LaneInfoType
Modes of setting connections between lanes.
Definition: NBEdge.h:129
@ USER
The connection was given by the user.
@ VALIDATED
The connection was computed and validated.
@ COMPUTED
The connection was computed.
std::vector< Connection > & getConnections()
Returns the connections.
Definition: NBEdge.h:971
static PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape)
Definition: NBEdge.cpp:841
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
Definition: NBEdge.cpp:3801
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing, bool withBikes=true) const
Returns the list of lanes that may be used to reach the given edge.
Definition: NBEdge.cpp:1276
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:1992
const NBEdge * getBidiEdge() const
Definition: NBEdge.h:1409
double getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
Definition: NBEdge.h:525
double getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
Definition: NBEdge.cpp:1958
int getSpecialLane(SVCPermissions permissions) const
return index of the first lane that allows the given permissions
Definition: NBEdge.cpp:3729
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:2229
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1920
double myDistance
The mileage/kilometrage at the start of this edge in a linear coordination system.
Definition: NBEdge.h:1628
void assignInternalLaneLength(std::vector< Connection >::iterator i, int numLanes, double lengthSum)
assign length to all lanes of an internal edge
Definition: NBEdge.cpp:1845
bool isOffRamp() const
Definition: NBEdge.h:1304
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1680
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1251
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:4008
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:3619
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1674
static void setDefaultConnectionLength(double length)
Definition: NBEdge.h:360
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1290
NBEdge & operator=(const NBEdge &s)
invalidated assignment operator
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1616
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:3336
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:3919
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
Definition: NBEdge.cpp:1946
bool hasLaneSpecificType() const
whether lanes differ in type
Definition: NBEdge.cpp:2218
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1694
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.cpp:3701
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:575
void setPriority(int priority)
Sets the priority of the edge.
Definition: NBEdge.h:502
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:556
bool myAmInTLS
Information whether this is lies within a joined tls.
Definition: NBEdge.h:1677
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:1973
bool hasDefaultGeometryEndpointAtNode(const NBNode *node) const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:588
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1639
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:497
void computeEdgeShape(double smoothElevationThreshold=-1)
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
Definition: NBEdge.cpp:800
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:324
bool hasRestrictedLane(SUMOVehicleClass vclass) const
returns whether any lane already allows the given vclass exclusively
Definition: NBEdge.cpp:3840
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:964
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1514
double getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
Definition: NBEdge.h:534
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
Definition: NBEdge.cpp:4031
Position mySignalPosition
the position of a traffic light signal on this edge
Definition: NBEdge.h:1689
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1411
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:1195
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:1104
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:3047
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:3885
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
Definition: NBEdge.h:1340
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:630
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
Definition: NBEdge.cpp:724
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3552
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:327
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1296
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again
Definition: NBEdge.cpp:2373
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1645
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:1049
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:2045
static int getLaneIndexFromLaneID(const std::string laneID)
Definition: NBEdge.cpp:4050
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection between the specified this edge's lane and an approached one.
Definition: NBEdge.cpp:1019
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:1059
void setAsMacroscopicConnector()
Definition: NBEdge.h:1052
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition: NBEdge.cpp:2265
bool hasLaneParams() const
whether one of the lanes has parameters set
Definition: NBEdge.cpp:2276
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:901
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:2163
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1326
void setLoadedLength(double val)
set loaded length
Definition: NBEdge.cpp:3670
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1651
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:569
void setSignalPosition(const Position &pos, const NBNode *signalNode)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:669
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:3433
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:1166
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1609
void append(NBEdge *continuation)
append another edge
Definition: NBEdge.cpp:3278
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1930
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:3954
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:641
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition: NBEdge.cpp:604
int myPriority
The priority of the edge.
Definition: NBEdge.h:1622
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1683
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:509
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1263
static double firstIntersection(const PositionVector &v1, const PositionVector &v2, double width2, const std::string &error="")
compute the first intersection point between the given lane geometries considering their rspective wi...
Definition: NBEdge.cpp:1869
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:58
Represents a single node (junction) during network building.
Definition: NBNode.h:66
Superclass for NBEdge and NBEdge::Connection to initialize Router.
Definition: NBEdge.h:62
virtual double getLength() const =0
static double getTravelTimeStatic(const NBRouterEdge *const edge, const NBVehicle *const, double)
Definition: NBEdge.h:81
virtual const NBRouterEdge * getBidiEdge() const =0
bool restricts(const NBVehicle *const) const
Definition: NBEdge.h:76
virtual int getNumericalID() const =0
virtual bool isInternal() const
Definition: NBEdge.h:70
bool prohibits(const NBVehicle *const) const
Definition: NBEdge.h:73
virtual const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const =0
virtual const std::string & getID() const =0
virtual double getSpeed() const =0
A class representing a single street sign.
Definition: NBSign.h:41
A vehicle as used by router.
Definition: NBVehicle.h:42
Base class for objects which have an id.
Definition: Named.h:53
const std::string & getID() const
Returns the id.
Definition: Named.h:73
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
An upper class for objects with additional parameters.
Definition: Parameterised.h:39
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
A list of positions.
double length() const
Returns the length.
static const PositionVector EMPTY
empty Vector
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:188
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:209
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:263
int toLane
The lane the connections yields in.
Definition: NBEdge.h:215
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:272
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
Definition: NBEdge.h:248
int getNumericalID() const
Definition: NBEdge.h:304
double speed
custom speed for connection
Definition: NBEdge.h:239
const std::string & getID() const
Definition: NBEdge.h:295
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:212
KeepClear keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:230
double getLength() const
Definition: NBEdge.h:301
bool isInternal() const
Definition: NBEdge.h:310
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Definition: NBEdge.h:313
double getSpeed() const
Definition: NBEdge.h:298
Connection(int fromLane_, NBEdge *toEdge_, int toLane_)
Constructor.
Definition: NBEdge.cpp:97
double customLength
custom length for connection
Definition: NBEdge.h:242
const Connection * getBidiEdge() const
Definition: NBEdge.h:307
double vmax
maximum velocity
Definition: NBEdge.h:257
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:281
PositionVector customShape
custom shape for connection
Definition: NBEdge.h:245
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:227
PositionVector viaShape
shape of via
Definition: NBEdge.h:266
std::string getDescription(const NBEdge *parent) const
get string describing this connection
Definition: NBEdge.cpp:92
double contPos
custom position for internal junction on this connection
Definition: NBEdge.h:233
std::string getInternalLaneID() const
get ID of internal lane
Definition: NBEdge.cpp:86
int internalLaneIndex
The lane index of this internal lane within the internal edge.
Definition: NBEdge.h:278
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:218
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:236
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
Definition: NBEdge.h:224
double length
computed length (average of all internal lane shape lengths that share an internal edge)
Definition: NBEdge.h:290
PositionVector shape
shape of Connection
Definition: NBEdge.h:254
std::string id
id of Connection
Definition: NBEdge.h:251
std::vector< std::string > foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:275
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:260
int tlLinkIndex
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:221
double viaLength
the length of the via shape (maybe customized)
Definition: NBEdge.h:269
static ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:294
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:142
double width
This lane's width.
Definition: NBEdge.h:166
std::map< int, double > stopOffsets
stopOffsets.second - The stop offset for vehicles stopping at the lane's end. Applies if vClass is in...
Definition: NBEdge.h:163
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:179
double endOffset
This lane's offset to the intersection begin.
Definition: NBEdge.h:159
std::string type
the type of this lane
Definition: NBEdge.h:182
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:156
double speed
The speed allowed on this lane.
Definition: NBEdge.h:150
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:169
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:153
bool connectionsDone
Whether connection information for this lane is already completed.
Definition: NBEdge.h:176
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:140
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:172
PositionVector shape
The lane's shape.
Definition: NBEdge.h:147