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-2022 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 
160 
163 
165  double endOffset;
166 
170 
172  double width;
173 
175  std::string oppositeID;
176 
178  bool accelRamp;
179 
181  // @note (see NIImporter_DlrNavteq::ConnectedLanesHandler)
183 
186 
188  std::string type;
189 
191  int turnSigns = 0;
192  };
193 
197  struct Connection final : public Parameterised, public NBRouterEdge {
203  Connection(int fromLane_, NBEdge* toEdge_, int toLane_);
204 
206  Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_,
207  KeepClear keepClear_ = KEEPCLEAR_UNSPECIFIED,
208  double contPos_ = UNSPECIFIED_CONTPOS,
209  double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
210  double speed_ = UNSPECIFIED_SPEED,
211  double length_ = myDefaultConnectionLength,
212  bool haveVia_ = false,
213  bool uncontrolled_ = false,
214  const PositionVector& customShape_ = PositionVector::EMPTY,
216  bool indirectLeft = false,
217  const std::string& edgeType = "",
218  SVCPermissions changeLeft_ = SVC_UNSPECIFIED,
219  SVCPermissions changeRight_ = SVC_UNSPECIFIED);
220 
222  int fromLane;
223 
226 
228  int toLane;
229 
231  std::string tlID;
232 
235 
238 
241 
244 
246  double contPos;
247 
249  double visibility;
250 
252  double speed;
253 
255  double customLength;
256 
259 
262 
265 
268 
271 
273  std::string edgeType;
274 
276  std::string id;
277 
280 
282  double vmax;
283 
285  bool haveVia;
286 
288  std::string viaID;
289 
292 
294  double viaLength;
295 
297  std::vector<int> foeInternalLinks;
298 
300  std::vector<std::string> foeIncomingLanes;
301 
304 
307 
309  std::string getInternalLaneID() const;
310 
312  std::string getDescription(const NBEdge* parent) const;
313 
315  double length;
316 
320  const std::string& getID() const {
321  return id;
322  }
323  double getSpeed() const {
324  return vmax;
325  }
326  double getLength() const {
327  return shape.length() + viaShape.length();
328  }
329  int getNumericalID() const {
330  throw ProcessError("NBEdge::Connection does not implement getNumericalID()");
331  }
332  const Connection* getBidiEdge() const {
333  return nullptr;
334  }
335  bool isInternal() const {
336  return true;
337  }
339  UNUSED_PARAMETER(vClass);
340  return myViaSuccessors;
341  }
343  };
344 
347 
349  static const double UNSPECIFIED_WIDTH;
350 
352  static const double UNSPECIFIED_OFFSET;
353 
355  static const double UNSPECIFIED_SPEED;
356 
358  static const double UNSPECIFIED_CONTPOS;
359 
361  static const double UNSPECIFIED_VISIBILITY_DISTANCE;
362 
364  static const double UNSPECIFIED_LOADED_LENGTH;
365 
367  static const double UNSPECIFIED_SIGNAL_OFFSET;
368 
370  static const double ANGLE_LOOKAHEAD;
371 
374 
377 
382  ROUNDABOUT = 1000
383  };
384 
385  static void setDefaultConnectionLength(double length) {
386  myDefaultConnectionLength = length;
387  }
388 
389 public:
408  NBEdge(const std::string& id,
409  NBNode* from, NBNode* to, std::string type,
410  double speed, int nolanes, int priority,
411  double width, double endOffset,
412  LaneSpreadFunction spread,
413  const std::string& streetName = "");
414 
415 
437  NBEdge(const std::string& id,
438  NBNode* from, NBNode* to, std::string type,
439  double speed, int nolanes, int priority,
440  double width, double endOffset,
441  PositionVector geom,
442  LaneSpreadFunction spread,
443  const std::string& streetName = "",
444  const std::string& origID = "",
445  bool tryIgnoreNodePositions = false);
446 
458  NBEdge(const std::string& id,
459  NBNode* from, NBNode* to,
460  const NBEdge* tpl,
461  const PositionVector& geom = PositionVector(),
462  int numLanes = -1);
463 
464 
466  ~NBEdge();
467 
468 
484  void reinit(NBNode* from, NBNode* to, const std::string& type,
485  double speed, int nolanes, int priority,
486  PositionVector geom, double width, double endOffset,
487  const std::string& streetName,
488  LaneSpreadFunction spread,
489  bool tryIgnoreNodePositions = false);
490 
495  void reinitNodes(NBNode* from, NBNode* to);
496 
499 
503  void reshiftPosition(double xoff, double yoff);
504 
506  void mirrorX();
508 
510 
511 
515  int getNumLanes() const {
516  return (int)myLanes.size();
517  }
518 
522  int getPriority() const {
523  return myPriority;
524  }
525 
527  void setPriority(int priority) {
528  myPriority = priority;
529  }
530 
534  inline NBNode* getFromNode() const {
535  return myFrom;
536  }
537 
541  inline NBNode* getToNode() const {
542  return myTo;
543  }
544 
550  inline double getStartAngle() const {
551  return myStartAngle;
552  }
553 
559  inline double getEndAngle() const {
560  return myEndAngle;
561  }
562 
567  double getShapeStartAngle() const;
568 
569 
575  double getShapeEndAngle() const;
576 
581  inline double getTotalAngle() const {
582  return myTotalAngle;
583  }
584 
588  double getLength() const {
589  return myLength;
590  }
591 
592 
597  double getLoadedLength() const {
598  return myLoadedLength > 0 ? myLoadedLength : myLength;
599  }
600 
602  double getFinalLength() const;
603 
607  bool hasLoadedLength() const {
608  return myLoadedLength > 0;
609  }
610 
614  double getSpeed() const {
615  return mySpeed;
616  }
617 
624  return myStep;
625  }
626 
630  double getLaneWidth() const {
631  return myLaneWidth;
632  }
633 
637  double getLaneWidth(int lane) const;
638 
640  double getTotalWidth() const;
641 
643  const std::string& getStreetName() const {
644  return myStreetName;
645  }
646 
648  void setStreetName(const std::string& name) {
649  myStreetName = name;
650  }
651 
653  double getDistance() const {
654  return myDistance;
655  }
656 
660  double getEndOffset() const {
661  return myEndOffset;
662  }
663 
667  double getEndOffset(int lane) const;
668 
672  const StopOffset& getEdgeStopOffset() const;
673 
677  const StopOffset& getLaneStopOffset(int lane) const;
678 
680  double getSignalOffset() const;
681 
683  const Position& getSignalPosition() const {
684  return mySignalPosition;
685  }
686 
688  const NBNode* getSignalNode() const {
689  return mySignalNode;
690  }
691 
693  void setSignalPosition(const Position& pos, const NBNode* signalNode) {
694  mySignalPosition = pos;
695  mySignalNode = signalNode;
696  }
697 
701  const std::vector<NBEdge::Lane>& getLanes() const {
702  return myLanes;
703  }
705 
710  int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const;
711 
716  int getFirstNonPedestrianNonBicycleLaneIndex(int direction, bool exclusive = false) const;
717 
719  int getSpecialLane(SVCPermissions permissions) const;
720 
724  int getFirstAllowedLaneIndex(int direction) const;
725 
727  NBEdge::Lane getFirstNonPedestrianLane(int direction) const;
728 
730  std::set<SVCPermissions> getPermissionVariants(int iStart, int iEnd) const;
731 
733  int getNumLanesThatAllow(SVCPermissions permissions) const;
734 
736  bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const;
737 
739  bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const;
740 
742  double getCrossingAngle(NBNode* node);
743 
745  std::string getSidewalkID();
746 
748 
749 
752  const PositionVector& getGeometry() const {
753  return myGeom;
754  }
755 
757  const PositionVector getInnerGeometry() const;
758 
760  bool hasDefaultGeometry() const;
761 
767  bool hasDefaultGeometryEndpoints() const;
768 
774  bool hasDefaultGeometryEndpointAtNode(const NBNode* node) const;
775 
776  Position getEndpointAtNode(const NBNode* node) const;
777 
788  void setGeometry(const PositionVector& g, bool inner = false);
789 
799  void addGeometryPoint(int index, const Position& p);
800 
802  void extendGeometryAtNode(const NBNode* node, double maxExtent);
803 
805  void shortenGeometryAtNode(const NBNode* node, double reduction);
806 
808  void shiftPositionAtNode(NBNode* node, NBEdge* opposite);
809 
811  Position geometryPositionAtOffset(double offset) const;
812 
822  void computeEdgeShape(double smoothElevationThreshold = -1);
823 
827  const PositionVector& getLaneShape(int i) const;
828 
834 
840 
844  void reduceGeometry(const double minDist);
845 
851  void checkGeometry(const double maxAngle, const double minRadius, bool fix, bool silent);
853 
856 
870  bool addEdge2EdgeConnection(NBEdge* dest, bool overrideRemoval = false);
871 
892  bool addLane2LaneConnection(int fromLane, NBEdge* dest,
893  int toLane, Lane2LaneInfoType type,
894  bool mayUseSameDestination = false,
895  bool mayDefinitelyPass = false,
896  KeepClear keepClear = KEEPCLEAR_UNSPECIFIED,
897  double contPos = UNSPECIFIED_CONTPOS,
898  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
899  double speed = UNSPECIFIED_SPEED,
900  double length = myDefaultConnectionLength,
901  const PositionVector& customShape = PositionVector::EMPTY,
902  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
903  SVCPermissions permissions = SVC_UNSPECIFIED,
904  const bool indirectLeft = false,
905  const std::string& edgeType = "",
906  SVCPermissions changeLeft = SVC_UNSPECIFIED,
907  SVCPermissions changeRight = SVC_UNSPECIFIED,
908  bool postProcess = false);
909 
927  bool addLane2LaneConnections(int fromLane,
928  NBEdge* dest, int toLane, int no,
929  Lane2LaneInfoType type, bool invalidatePrevious = false,
930  bool mayDefinitelyPass = false);
931 
942  bool setConnection(int lane, NBEdge* destEdge,
943  int destLane,
944  Lane2LaneInfoType type,
945  bool mayUseSameDestination = false,
946  bool mayDefinitelyPass = false,
947  KeepClear keepClear = KEEPCLEAR_UNSPECIFIED,
948  double contPos = UNSPECIFIED_CONTPOS,
949  double visibility = UNSPECIFIED_VISIBILITY_DISTANCE,
950  double speed = UNSPECIFIED_SPEED,
951  double length = myDefaultConnectionLength,
952  const PositionVector& customShape = PositionVector::EMPTY,
953  const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED,
954  SVCPermissions permissions = SVC_UNSPECIFIED,
955  bool indirectLeft = false,
956  const std::string& edgeType = "",
957  SVCPermissions changeLeft = SVC_UNSPECIFIED,
958  SVCPermissions changeRight = SVC_UNSPECIFIED,
959  bool postProcess = false);
960 
971  std::vector<Connection> getConnectionsFromLane(int lane, NBEdge* to = nullptr, int toLane = -1) const;
972 
977  Connection getConnection(int fromLane, const NBEdge* to, int toLane) const;
978 
983  Connection& getConnectionRef(int fromLane, const NBEdge* to, int toLane);
984 
993  bool hasConnectionTo(NBEdge* destEdge, int destLane, int fromLane = -1) const;
994 
1001  bool isConnectedTo(const NBEdge* e, const bool ignoreTurnaround = false) const;
1002 
1006  const std::vector<Connection>& getConnections() const {
1007  return myConnections;
1008  }
1009 
1013  std::vector<Connection>& getConnections() {
1014  return myConnections;
1015  }
1016 
1020  const EdgeVector* getConnectedSorted();
1021 
1025  EdgeVector getConnectedEdges() const;
1026 
1030  EdgeVector getIncomingEdges() const;
1031 
1035  std::vector<int> getConnectionLanes(NBEdge* currentOutgoing, bool withBikes = true) const;
1036 
1039 
1042 
1048  void remapConnections(const EdgeVector& incoming);
1049 
1057  void removeFromConnections(NBEdge* toEdge, int fromLane = -1, int toLane = -1, bool tryLater = false, const bool adaptToLaneRemoval = false, const bool keepPossibleTurns = false);
1058 
1060  bool removeFromConnections(const NBEdge::Connection& connectionToRemove);
1061 
1063  void invalidateConnections(bool reallowSetting = false);
1064 
1066  void replaceInConnections(NBEdge* which, NBEdge* by, int laneOff);
1067 
1069  void replaceInConnections(NBEdge* which, const std::vector<NBEdge::Connection>& origConns);
1070 
1072  void copyConnectionsFrom(NBEdge* src);
1073 
1075  void shiftToLanesToEdge(NBEdge* to, int laneOff);
1077 
1083  bool isTurningDirectionAt(const NBEdge* const edge) const;
1084 
1089  void setTurningDestination(NBEdge* e, bool onlyPossible = false);
1090 
1095  myAmMacroscopicConnector = true;
1096  }
1097 
1101  bool isMacroscopicConnector() const {
1102  return myAmMacroscopicConnector;
1103  }
1104 
1106  void setInsideTLS(bool inside) {
1107  myAmInTLS = inside;
1108  }
1109 
1113  bool isInsideTLS() const {
1114  return myAmInTLS;
1115  }
1117 
1123  void setJunctionPriority(const NBNode* const node, int prio);
1124 
1134  int getJunctionPriority(const NBNode* const node) const;
1135 
1137  void setLoadedLength(double val);
1138 
1140  void setAverageLengthWithOpposite(double val);
1141 
1144 
1146  const std::string& getTypeID() const {
1147  return myType;
1148  }
1149 
1151  bool needsLaneSpecificOutput() const;
1152 
1154  bool hasPermissions() const;
1155 
1157  bool hasLaneSpecificPermissions() const;
1158 
1160  bool hasLaneSpecificSpeed() const;
1161 
1163  bool hasLaneSpecificWidth() const;
1164 
1166  bool hasLaneSpecificType() const;
1167 
1169  bool hasLaneSpecificEndOffset() const;
1170 
1172  bool hasLaneSpecificStopOffsets() const;
1173 
1175  bool hasAccelLane() const;
1176 
1178  bool hasCustomLaneShape() const;
1179 
1181  bool hasLaneParams() const;
1182 
1184  bool prohibitsChanging() const;
1185 
1187  bool computeEdge2Edges(bool noLeftMovers);
1188 
1190  bool computeLanes2Edges();
1191 
1193  bool recheckLanes();
1194 
1203  void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions);
1204 
1208  NBNode* tryGetNodeAtPosition(double pos, double tolerance = 5.0) const;
1209 
1211  double getMaxLaneOffset();
1212 
1214  bool lanesWereAssigned() const;
1215 
1217  bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const;
1218 
1220  bool setControllingTLInformation(const NBConnection& c, const std::string& tlID);
1221 
1224 
1226  PositionVector getCWBoundaryLine(const NBNode& n) const;
1227 
1229  PositionVector getCCWBoundaryLine(const NBNode& n) const;
1230 
1232  bool expandableBy(NBEdge* possContinuation, std::string& reason) const;
1233 
1235  void append(NBEdge* continuation);
1236 
1238  bool hasSignalisedConnectionTo(const NBEdge* const e) const;
1239 
1241  void moveOutgoingConnectionsFrom(NBEdge* e, int laneOff);
1242 
1243  /* @brief return the turn destination if it exists
1244  * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection
1245  * exists
1246  */
1247  NBEdge* getTurnDestination(bool possibleDestination = false) const;
1248 
1250  std::string getLaneID(int lane) const;
1251 
1253  double getLaneSpeed(int lane) const;
1254 
1256  bool isNearEnough2BeJoined2(NBEdge* e, double threshold) const;
1257 
1265  double getAngleAtNode(const NBNode* const node) const;
1266 
1275  double getAngleAtNodeToCenter(const NBNode* const node) const;
1276 
1278  void incLaneNo(int by);
1279 
1281  void decLaneNo(int by);
1282 
1284  void deleteLane(int index, bool recompute, bool shiftIndices);
1285 
1287  void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices);
1288 
1290  void markAsInLane2LaneState();
1291 
1293  void addSidewalk(double width);
1294 
1296  void restoreSidewalk(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1297 
1299  void addBikeLane(double width);
1300 
1302  void restoreBikelane(std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1303 
1305  void addRestrictedLane(double width, SUMOVehicleClass vclass);
1306 
1308  void setPermissions(SVCPermissions permissions, int lane = -1);
1309 
1311  void setPreferredVehicleClass(SVCPermissions permissions, int lane = -1);
1312 
1314  void setPermittedChanging(int lane, SVCPermissions changeLeft, SVCPermissions changeRight);
1315 
1317  void allowVehicleClass(int lane, SUMOVehicleClass vclass);
1318 
1320  void disallowVehicleClass(int lane, SUMOVehicleClass vclass);
1321 
1323  void preferVehicleClass(int lane, SUMOVehicleClass vclass);
1324 
1326  void setLaneWidth(int lane, double width);
1327 
1329  void setLaneType(int lane, const std::string& type);
1330 
1332  void setEndOffset(int lane, double offset);
1333 
1335  void setSpeed(int lane, double speed);
1336 
1339  bool setEdgeStopOffset(int lane, const StopOffset& offset, bool overwrite = false);
1340 
1342  void setAcceleration(int lane, bool accelRamp);
1343 
1345  void markOffRamp(bool isOffRamp) {
1347  }
1348 
1349  bool isOffRamp() const {
1350  return myIsOffRamp;
1351  }
1352 
1354  void setLaneShape(int lane, const PositionVector& shape);
1355 
1357  SVCPermissions getPermissions(int lane = -1) const;
1358 
1360  void setOrigID(const std::string origID);
1361 
1363  void setDistance(double distance) {
1364  myDistance = distance;
1365  }
1366 
1367  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1368  Lane& getLaneStruct(int lane) {
1369  assert(lane >= 0);
1370  assert(lane < (int)myLanes.size());
1371  return myLanes[lane];
1372  }
1373 
1374  // @brief returns a reference to the internal structure for the convenience of NETEDIT
1375  const Lane& getLaneStruct(int lane) const {
1376  assert(lane >= 0);
1377  assert(lane < (int)myLanes.size());
1378  return myLanes[lane];
1379  }
1380 
1383  myStep = step;
1384  }
1385 
1386  /* @brief fill connection attributes shape, viaShape, ...
1387  *
1388  * @param[in,out] edgeIndex The number of connections already handled
1389  * @param[in,out] splitIndex The number of via edges already built
1390  * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2
1391  */
1392  void buildInnerEdges(const NBNode& n, int noInternalNoSplits, int& linkIndex, int& splitIndex);
1393 
1395  inline const std::vector<NBSign>& getSigns() const {
1396  return mySigns;
1397  }
1398 
1400  inline void addSign(NBSign sign) {
1401  mySigns.push_back(sign);
1402  }
1403 
1406 
1408  void setNodeBorder(const NBNode* node, const Position& p, const Position& p2, bool rectangularCut);
1409  const PositionVector& getNodeBorder(const NBNode* node) const;
1410  void resetNodeBorder(const NBNode* node);
1411 
1413  bool isBidiRail(bool ignoreSpread = false) const;
1414 
1416  bool isRailDeadEnd() const;
1417 
1419  void debugPrintConnections(bool outgoing = true, bool incoming = false) const;
1420 
1422  static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width1, double width2, const std::string& error = "", bool secondIntersection = false);
1423 
1427  static PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, PositionVector nodeShape);
1428 
1430 
1431 
1432  static inline double getTravelTimeStatic(const NBEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) {
1433  return edge->getLength() / edge->getSpeed();
1434  }
1435 
1436  static int getLaneIndexFromLaneID(const std::string laneID);
1437 
1439  void setNumericalID(int index) {
1440  myIndex = index;
1441  }
1442 
1447  int getNumericalID() const {
1448  return myIndex;
1449  }
1450 
1451  const NBEdge* getBidiEdge() const {
1452  return isBidiRail() ? myPossibleTurnDestination : nullptr;
1453  }
1454 
1457  const EdgeVector& getSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const;
1458 
1459 
1463 
1465  const std::string& getID() const {
1466  return Named::getID();
1467  }
1468 
1470  bool joinLanes(SVCPermissions perms);
1471 
1473  void resetLaneShapes();
1474 
1477 
1480  NBEdge* getStraightContinuation(SVCPermissions permissions) const;
1481 
1484  NBEdge* getStraightPredecessor(SVCPermissions permissions) const;
1485 
1487  NBEdge* guessOpposite(bool reguess = false);
1488 
1489 
1490  const std::string& getTurnSignTarget() const {
1491  return myTurnSignTarget;
1492  }
1493 
1494  void setTurnSignTarget(const std::string& target) {
1495  myTurnSignTarget = target;
1496  }
1497 
1499  static EdgeVector filterByPermissions(const EdgeVector& edges, SVCPermissions permissions);
1500 
1501 private:
1506  private:
1508  std::map<NBEdge*, std::vector<int> > myConnections;
1509 
1512 
1513  public:
1516  : myTransitions(transitions) { }
1517 
1520 
1522  void execute(const int lane, const int virtEdge);
1523 
1525  const std::map<NBEdge*, std::vector<int> >& getBuiltConnections() const {
1526  return myConnections;
1527  }
1528 
1529  private:
1532 
1535  };
1536 
1537 
1546  public:
1548  enum class Direction {
1549  RIGHTMOST,
1550  LEFTMOST,
1551  FORWARD
1552  };
1553 
1554  public:
1556  MainDirections(const EdgeVector& outgoing, NBEdge* parent, NBNode* to, const std::vector<int>& availableLanes);
1557 
1559  ~MainDirections();
1560 
1562  int getStraightest() const {
1563  return myStraightest;
1564  }
1565 
1567  bool empty() const;
1568 
1570  bool includes(Direction d) const;
1571 
1572  private:
1575 
1577  std::vector<Direction> myDirs;
1578 
1580  MainDirections(const MainDirections&) = delete;
1581 
1584  };
1585 
1587  PositionVector computeLaneShape(int lane, double offset) const;
1588 
1590  void computeLaneShapes();
1591 
1592 private:
1609  void init(int noLanes, bool tryIgnoreNodePositions, const std::string& origID);
1610 
1612  void divideOnEdges(const EdgeVector* outgoing);
1613 
1615  void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1616 
1618  void addStraightConnections(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<int>& priorities);
1619 
1621  const std::vector<int> prepareEdgePriorities(const EdgeVector* outgoing, const std::vector<int>& availableLanes);
1622 
1625 
1628  void moveConnectionToLeft(int lane);
1629 
1633  void moveConnectionToRight(int lane);
1634 
1636  bool canMoveConnection(const Connection& con, int newFromLane) const;
1638 
1640  void computeAngle();
1641 
1643  bool bothLeftTurns(LinkDirection dir, const NBEdge* otherFrom, LinkDirection dir2) const;
1644  bool haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon,
1645  int numPoints, double width1, double width2, int shapeFlag = 0) const;
1646 
1648  bool hasRestrictedLane(SUMOVehicleClass vclass) const;
1649 
1651  void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector<NBEdge::Lane> oldLanes, PositionVector oldGeometry, std::vector<NBEdge::Connection> oldConnections);
1652 
1654  void assignInternalLaneLength(std::vector<Connection>::iterator i, int numLanes, double lengthSum, bool averageLength);
1655 
1657  std::vector<LinkDirection> decodeTurnSigns(int turnSigns);
1658 
1660  bool applyTurnSigns();
1661 
1662 private:
1667 
1669  std::string myType;
1670 
1673 
1675  std::string myTurnSignTarget;
1676 
1678  double myLength;
1679 
1683  double myEndAngle;
1686 
1689 
1691  double mySpeed;
1692 
1694  double myDistance;
1695 
1699  std::vector<Connection> myConnections;
1700 
1702  std::vector<Connection> myConnectionsToDelete;
1703 
1706 
1709 
1712 
1715 
1718 
1721 
1723  double myEndOffset;
1724 
1730 
1732  double myLaneWidth;
1733 
1737  std::vector<Lane> myLanes;
1738 
1741 
1744 
1747 
1749  std::string myStreetName;
1750 
1752  std::vector<NBSign> mySigns;
1753 
1757 
1763 
1766 
1768  int myIndex;
1769 
1770  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1772 
1773  // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes
1775 
1776  // @brief default length for overriding connection lengths
1778 
1779 public:
1780 
1783  public:
1785  connections_toedge_finder(const NBEdge* const edge2find, bool hasFromLane = false) :
1786  myHasFromLane(hasFromLane),
1787  myEdge2Find(edge2find) { }
1788 
1790  bool operator()(const Connection& c) const {
1791  return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
1792  }
1793 
1794  private:
1796  const bool myHasFromLane;
1797 
1799  const NBEdge* const myEdge2Find;
1800 
1801  private:
1804  };
1805 
1808  public:
1810  connections_toedgelane_finder(NBEdge* const edge2find, int lane2find, int fromLane2find) :
1811  myEdge2Find(edge2find),
1812  myLane2Find(lane2find),
1813  myFromLane2Find(fromLane2find) { }
1814 
1816  bool operator()(const Connection& c) const {
1817  return c.toEdge == myEdge2Find && c.toLane == myLane2Find && (myFromLane2Find < 0 || c.fromLane == myFromLane2Find);
1818  }
1819 
1820  private:
1823 
1826 
1829 
1830  private:
1833  };
1834 
1837  public:
1839  connections_finder(int fromLane, NBEdge* const edge2find, int lane2find, bool invertEdge2find = false) :
1840  myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find), myInvertEdge2find(invertEdge2find) { }
1841 
1843  bool operator()(const Connection& c) const {
1844  return ((c.fromLane == myFromLane || myFromLane == -1)
1846  && (c.toLane == myLane2Find || myLane2Find == -1));
1847  }
1848 
1849  private:
1852 
1855 
1858 
1861 
1862  private:
1865  };
1866 
1869  public:
1871  connections_conflict_finder(int fromLane, NBEdge* const edge2find, bool checkRight) :
1872  myFromLane(fromLane), myEdge2Find(edge2find), myCheckRight(checkRight) { }
1873 
1875  bool operator()(const Connection& c) const {
1876  return (((myCheckRight && c.fromLane < myFromLane) || (!myCheckRight && c.fromLane > myFromLane))
1877  && c.fromLane >= 0 // already assigned
1878  && c.toEdge == myEdge2Find);
1879  }
1880 
1881  private:
1884 
1887 
1890 
1891  private:
1894  };
1895 
1898  public:
1900  connections_fromlane_finder(int lane2find) : myLane2Find(lane2find) { }
1901 
1903  bool operator()(const Connection& c) const {
1904  return c.fromLane == myLane2Find;
1905  }
1906 
1907  private:
1910 
1911  private:
1914  };
1915 
1917  static bool connections_sorter(const Connection& c1, const Connection& c2);
1918 
1924  public:
1927 
1928  public:
1930  int operator()(const Connection& c1, const Connection& c2) const;
1931 
1932  private:
1935  };
1936 
1937 private:
1939  NBEdge(const NBEdge& s) = delete;
1940 
1942  NBEdge& operator=(const NBEdge& s) = delete;
1943 
1945  NBEdge();
1946 };
std::vector< std::pair< const NBRouterEdge *, const NBRouterEdge * > > ConstRouterEdgePairVector
Definition: NBCont.h:46
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:35
KeepClear
keepClear status of connections
Definition: NBCont.h:58
@ KEEPCLEAR_UNSPECIFIED
Definition: NBCont.h:61
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:30
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
Definition: NBEdge.h:1545
bool empty() const
returns the information whether no following street has a higher priority
Definition: NBEdge.cpp:258
MainDirections(const MainDirections &)=delete
Invalidated copy constructor.
bool includes(Direction d) const
returns the information whether the street in the given direction has a higher priority
Definition: NBEdge.cpp:264
int getStraightest() const
returns the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1562
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to, const std::vector< int > &availableLanes)
constructor
Definition: NBEdge.cpp:201
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
Definition: NBEdge.h:1577
~MainDirections()
destructor
Definition: NBEdge.cpp:254
int myStraightest
the index of the straightmost among the given outgoing edges
Definition: NBEdge.h:1574
Direction
enum of possible directions
Definition: NBEdge.h:1548
MainDirections & operator=(const MainDirections &)=delete
Invalidated assignment operator.
A class that being a bresenham-callback assigns the incoming lanes to the edges.
Definition: NBEdge.h:1505
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)=delete
Invalidated assignment operator.
ToEdgeConnectionsAdder(const ToEdgeConnectionsAdder &)=delete
Invalidated copy constructor.
~ToEdgeConnectionsAdder()
destructor
Definition: NBEdge.h:1519
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
Definition: NBEdge.h:1515
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
Definition: NBEdge.h:1511
void execute(const int lane, const int virtEdge)
executes a bresenham - step
Definition: NBEdge.cpp:170
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
Definition: NBEdge.h:1525
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
Definition: NBEdge.h:1508
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1886
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1875
connections_conflict_finder & operator=(const connections_conflict_finder &s)=delete
invalidated assignment operator
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
Definition: NBEdge.h:1871
bool myCheckRight
check if is right
Definition: NBEdge.h:1889
int myFromLane
index of from lane
Definition: NBEdge.h:1883
int myLane2Find
lane to find
Definition: NBEdge.h:1857
connections_finder & operator=(const connections_finder &s)=delete
invalidated assignment operator
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1843
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
Definition: NBEdge.h:1839
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1854
int myFromLane
index of from lane
Definition: NBEdge.h:1851
bool myInvertEdge2find
invert edge to find
Definition: NBEdge.h:1860
int myLane2Find
index of lane to find
Definition: NBEdge.h:1909
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1903
connections_fromlane_finder(int lane2find)
@briefconstructor
Definition: NBEdge.h:1900
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)=delete
invalidated assignment operator
Class to sort edges by their angle.
Definition: NBEdge.h:1923
NBEdge * myEdge
the edge to compute the relative angle of
Definition: NBEdge.h:1934
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
Definition: NBEdge.cpp:273
connections_relative_edgelane_sorter(NBEdge *e)
constructor
Definition: NBEdge.h:1926
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
Definition: NBEdge.h:1785
connections_toedge_finder & operator=(const connections_toedge_finder &s)=delete
invalidated assignment operator
const bool myHasFromLane
check if has from lane
Definition: NBEdge.h:1796
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1790
const NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1799
bool operator()(const Connection &c) const
operator ()
Definition: NBEdge.h:1816
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Definition: NBEdge.h:1810
connections_toedgelane_finder & operator=(const connections_toedgelane_finder &s)=delete
invalidated assignment operator
int myFromLane2Find
from lane to find
Definition: NBEdge.h:1828
NBEdge *const myEdge2Find
edge to find
Definition: NBEdge.h:1822
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:648
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
Definition: NBEdge.cpp:948
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:578
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:3999
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:2089
bool addEdge2EdgeConnection(NBEdge *dest, bool overrideRemoval=false)
Adds a connection to another edge.
Definition: NBEdge.cpp:1026
NBEdge * guessOpposite(bool reguess=false)
set oppositeID and return opposite edge if found
Definition: NBEdge.cpp:4517
void setPermittedChanging(int lane, SVCPermissions changeLeft, SVCPermissions changeRight)
set allowed classes for changing to the left and right from the given lane
Definition: NBEdge.cpp:4013
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:588
double myLaneWidth
This width of this edge's lanes.
Definition: NBEdge.h:1732
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:4022
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
Definition: NBEdge.cpp:1612
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
Definition: NBEdge.h:1702
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
Definition: NBEdge.cpp:1268
double myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
Definition: NBEdge.h:1723
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
Definition: NBEdge.h:1714
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:3985
bool isInsideTLS() const
Returns whether this edge was marked as being within an intersection.
Definition: NBEdge.h:1113
StopOffset myEdgeStopOffset
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
Definition: NBEdge.h:1729
JunctionPriority
junction priority values set by setJunctionPriority
Definition: NBEdge.h:379
@ ROUNDABOUT
Definition: NBEdge.h:382
@ PRIORITY_ROAD
Definition: NBEdge.h:381
@ MINOR_ROAD
Definition: NBEdge.h:380
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition: NBEdge.h:597
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
Definition: NBEdge.cpp:4174
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
Definition: NBEdge.cpp:4227
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
Definition: NBEdge.cpp:3527
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
Definition: NBEdge.cpp:480
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3953
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Definition: NBEdge.cpp:454
double mySpeed
The maximal speed.
Definition: NBEdge.h:1691
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:630
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
Definition: NBEdge.cpp:3491
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1699
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:1234
NBEdge()
constructor for dummy edge
Definition: NBEdge.cpp:383
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
Definition: NBEdge.cpp:2917
ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:1774
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:3509
void setOrigID(const std::string origID)
set origID for all lanes
Definition: NBEdge.cpp:4375
void incLaneNo(int by)
increment lane
Definition: NBEdge.cpp:3750
static EdgeVector filterByPermissions(const EdgeVector &edges, SVCPermissions permissions)
return only those edges that permit at least one of the give permissions
Definition: NBEdge.cpp:4475
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:643
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
Definition: NBEdge.cpp:3707
void markOffRamp(bool isOffRamp)
marks this edge has being an offRamp or leading to one (used for connection computation)
Definition: NBEdge.h:1345
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:2325
void setAverageLengthWithOpposite(double val)
patch average lane length in regard to the opposite edge
Definition: NBEdge.cpp:4042
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3813
double getShapeStartAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.cpp:2284
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
Definition: NBEdge.h:373
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:3276
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
Definition: NBEdge.cpp:4057
std::string myType
The type of the edge.
Definition: NBEdge.h:1669
const Position & getSignalPosition() const
Returns the position of a traffic signal on this edge.
Definition: NBEdge.h:683
bool hasPermissions() const
whether at least one lane has restrictions
Definition: NBEdge.cpp:2300
double myTotalAngle
Definition: NBEdge.h:1684
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.cpp:942
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Definition: NBEdge.cpp:610
std::string myTurnSignTarget
node for which turnSign information applies
Definition: NBEdge.h:1675
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:742
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
Definition: NBEdge.h:376
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:4390
std::vector< LinkDirection > decodeTurnSigns(int turnSigns)
decode bitset
Definition: NBEdge.cpp:2516
void dismissVehicleClassInformation()
dimiss vehicle class information
Definition: NBEdge.cpp:4048
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
Definition: NBEdge.cpp:2441
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:623
void setInsideTLS(bool inside)
Marks this edge being within an intersection.
Definition: NBEdge.h:1106
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
Definition: NBEdge.h:1720
void moveConnectionToLeft(int lane)
Definition: NBEdge.cpp:1584
void updateChangeRestrictions(SVCPermissions ignoring)
modify all existing restrictions on lane changing
Definition: NBEdge.cpp:2100
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Definition: NBEdge.cpp:4233
Position getEndpointAtNode(const NBNode *node) const
Definition: NBEdge.cpp:628
NBEdge * getStraightContinuation(SVCPermissions permissions) const
return the straightest follower edge for the given permissions or nullptr (never returns turn-arounds...
Definition: NBEdge.cpp:4486
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
Definition: NBEdge.cpp:3826
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:607
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
Definition: NBEdge.cpp:4221
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
divide selected lanes on edges
Definition: NBEdge.cpp:2996
int getNumericalID() const
Returns the index (numeric id) of the edge.
Definition: NBEdge.h:1447
void setTurnSignTarget(const std::string &target)
Definition: NBEdge.h:1494
void setDistance(double distance)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.h:1363
const NBNode * getSignalNode() const
Returns the node that (possibly) represents a traffic signal controlling at the end of this edge.
Definition: NBEdge.h:688
static double getTravelTimeStatic(const NBEdge *const edge, const NBVehicle *const, double)
Definition: NBEdge.h:1432
bool setEdgeStopOffset(int lane, const StopOffset &offset, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3923
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1395
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
Definition: NBEdge.cpp:2369
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
Definition: NBEdge.cpp:684
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:4082
const std::string & getID() const
Definition: NBEdge.h:1465
EdgeVector mySuccessors
Definition: NBEdge.h:1771
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:701
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
Definition: NBEdge.cpp:4308
void checkGeometry(const double maxAngle, const double minRadius, bool fix, bool silent)
Check the angles of successive geometry segments.
Definition: NBEdge.cpp:980
static double myDefaultConnectionLength
Definition: NBEdge.h:1777
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Definition: NBEdge.cpp:3699
EdgeBuildingStep myStep
The building step.
Definition: NBEdge.h:1666
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:541
void setLaneType(int lane, const std::string &type)
set lane specific type (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3854
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
Definition: NBEdge.cpp:2481
const Lane & getLaneStruct(int lane) const
Definition: NBEdge.h:1375
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:4501
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
Definition: NBEdge.cpp:1356
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:614
~NBEdge()
Destructor.
Definition: NBEdge.cpp:553
NBNode * myTo
Definition: NBEdge.h:1672
double myEndAngle
Definition: NBEdge.h:1683
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:4125
bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition: NBEdge.cpp:4168
double getDistance() const
get distance
Definition: NBEdge.h:653
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:364
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3839
void resetLaneShapes()
reset lane shapes to what they would be before cutting with the junction shapes
Definition: NBEdge.cpp:2094
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:3420
bool bothLeftTurns(LinkDirection dir, const NBEdge *otherFrom, LinkDirection dir2) const
determine conflict between opposite left turns
Definition: NBEdge.cpp:2008
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:3969
const StopOffset & getEdgeStopOffset() const
Returns the stopOffset to the end of the edge.
Definition: NBEdge.cpp:3891
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
Definition: NBEdge.cpp:3369
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:936
void clearControllingTLInformation()
clears tlID for all connections
Definition: NBEdge.cpp:3483
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 indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1112
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:3356
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > &priorities)
add some straight connections
Definition: NBEdge.cpp:3101
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:2311
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:2424
void computeAngle()
computes the angle of this edge and stores it in myAngle
Definition: NBEdge.cpp:2186
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, bool tryIgnoreNodePositions=false)
Resets initial values.
Definition: NBEdge.cpp:406
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1206
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Definition: NBEdge.h:367
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:4215
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
Definition: NBEdge.cpp:3673
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1737
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:515
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:752
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
Definition: NBEdge.cpp:2382
static double firstIntersection(const PositionVector &v1, const PositionVector &v2, double width1, double width2, const std::string &error="", bool secondIntersection=false)
compute the first intersection point between the given lane geometries considering their rspective wi...
Definition: NBEdge.cpp:1944
PositionVector myToBorder
Definition: NBEdge.h:1761
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 permissions=SVC_UNSPECIFIED, const bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection between the specified this edge's lane and an approached one.
Definition: NBEdge.cpp:1060
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:647
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:358
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
Definition: NBEdge.h:370
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
Definition: NBEdge.cpp:958
static NBEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
Definition: NBEdge.h:346
bool joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
Definition: NBEdge.cpp:4455
void resetNodeBorder(const NBNode *node)
Definition: NBEdge.cpp:731
void markAsInLane2LaneState()
mark edge as in lane to state lane
Definition: NBEdge.cpp:3793
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:3409
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:4249
NBEdge & operator=(const NBEdge &s)=delete
invalidated assignment operator
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:1372
double myLength
The length of the edge.
Definition: NBEdge.h:1678
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
@brif get first non-pedestrian lane
Definition: NBEdge.cpp:4190
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1453
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:3183
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:1768
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:3876
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Definition: NBEdge.cpp:768
Position geometryPositionAtOffset(double offset) const
return position taking into account loaded length
Definition: NBEdge.cpp:4344
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:361
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
Definition: NBEdge.cpp:1575
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3800
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:1255
void addSign(NBSign sign)
add Sign
Definition: NBEdge.h:1400
void assignInternalLaneLength(std::vector< Connection >::iterator i, int numLanes, double lengthSum, bool averageLength)
assign length to all lanes of an internal edge
Definition: NBEdge.cpp:1916
double getMaxLaneOffset()
get max lane offset
Definition: NBEdge.cpp:3403
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Definition: NBEdge.cpp:3761
std::vector< NBSign > mySigns
the street signs along this edge
Definition: NBEdge.h:1752
const std::string & getTurnSignTarget() const
Definition: NBEdge.h:1490
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
Definition: NBEdge.h:1708
const PositionVector & getNodeBorder(const NBNode *node) const
Definition: NBEdge.cpp:720
int getNumLanesThatAllow(SVCPermissions permissions) const
get lane indices that allow the given permissions
Definition: NBEdge.cpp:4151
const NBNode * mySignalNode
Definition: NBEdge.h:1756
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:2336
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
Definition: NBEdge.h:1439
void moveConnectionToRight(int lane)
Definition: NBEdge.cpp:1599
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Definition: NBEdge.cpp:4139
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
Definition: NBEdge.cpp:558
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
Definition: NBEdge.cpp:3383
std::string getLaneID(int lane) const
get lane ID
Definition: NBEdge.cpp:3693
bool myIsOffRamp
whether this edge is an Off-Ramp or leads to one
Definition: NBEdge.h:1765
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:355
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:1013
static PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape)
Definition: NBEdge.cpp:870
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
Definition: NBEdge.cpp:4199
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:1330
void computeLaneShapes()
compute lane shapes
Definition: NBEdge.cpp:2121
const NBEdge * getBidiEdge() const
Definition: NBEdge.h:1451
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:550
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:2065
int getSpecialLane(SVCPermissions permissions) const
return index of the first lane that allows the given permissions
Definition: NBEdge.cpp:4115
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:2358
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:2027
double myDistance
The mileage/kilometrage at the start of this edge in a linear coordination system.
Definition: NBEdge.h:1694
bool isOffRamp() const
Definition: NBEdge.h:1349
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
Definition: NBEdge.h:1746
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1305
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
Definition: NBEdge.cpp:4408
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:3977
double myLoadedLength
An optional length to use (-1 if not valid)
Definition: NBEdge.h:1740
static void setDefaultConnectionLength(double length)
Definition: NBEdge.h:385
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
Definition: NBEdge.cpp:1344
bool applyTurnSigns()
apply loaded turn sign information
Definition: NBEdge.cpp:2528
bool haveIntersection(const NBNode &n, const PositionVector &shape, const NBEdge *otherFrom, const NBEdge::Connection &otherCon, int numPoints, double width1, double width2, int shapeFlag=0) const
Definition: NBEdge.cpp:2017
NBEdge(const NBEdge &s)=delete
invalidated copy constructor
double myStartAngle
The angles of the edge.
Definition: NBEdge.h:1682
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:3684
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
Definition: NBEdge.cpp:4319
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
Definition: NBEdge.cpp:2053
bool hasLaneSpecificType() const
whether lanes differ in type
Definition: NBEdge.cpp:2347
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
Definition: NBEdge.h:1760
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
Definition: NBEdge.cpp:4069
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:604
void setPriority(int priority)
Sets the priority of the edge.
Definition: NBEdge.h:527
double getTotalAngle() const
Returns the angle at the start of the edge.
Definition: NBEdge.h:581
bool myAmInTLS
Information whether this is lies within a joined tls.
Definition: NBEdge.h:1743
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
Definition: NBEdge.cpp:2080
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:617
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
Definition: NBEdge.h:1705
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:522
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:829
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:349
bool hasRestrictedLane(SUMOVehicleClass vclass) const
returns whether any lane already allows the given vclass exclusively
Definition: NBEdge.cpp:4238
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:1006
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
Definition: NBEdge.cpp:1568
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:559
const StopOffset & getLaneStopOffset(int lane) const
Returns the stop offset to the specified lane's end.
Definition: NBEdge.cpp:3897
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
Definition: NBEdge.cpp:4431
Position mySignalPosition
the position of a traffic light signal on this edge
Definition: NBEdge.h:1755
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
Definition: NBEdge.cpp:1465
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:1249
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:1146
bool lanesWereAssigned() const
Check if lanes were assigned.
Definition: NBEdge.cpp:3397
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
Definition: NBEdge.cpp:4285
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:1382
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:660
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
Definition: NBEdge.cpp:753
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3907
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:352
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1350
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again
Definition: NBEdge.cpp:2685
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
Definition: NBEdge.h:1711
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:1095
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
Definition: NBEdge.cpp:2174
bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
Definition: NBEdge.cpp:4162
static int getLaneIndexFromLaneID(const std::string laneID)
Definition: NBEdge.cpp:4450
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:1101
void setAsMacroscopicConnector()
Definition: NBEdge.h:1094
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
Definition: NBEdge.cpp:2393
bool hasLaneParams() const
whether one of the lanes has parameters set
Definition: NBEdge.cpp:2404
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:930
double getShapeEndAngle() const
Returns the angle at the end of the edge.
Definition: NBEdge.cpp:2292
bool prohibitsChanging() const
whether one of the lanes prohibits lane changing
Definition: NBEdge.cpp:2414
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1368
void setLoadedLength(double val)
set loaded length
Definition: NBEdge.cpp:4037
PositionVector myGeom
The geometry for the edge.
Definition: NBEdge.h:1717
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:598
void setSignalPosition(const Position &pos, const NBNode *signalNode)
sets the offset of a traffic signal from the end of this edge
Definition: NBEdge.h:693
void decLaneNo(int by)
decrement lane
Definition: NBEdge.cpp:3781
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:1220
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1672
void append(NBEdge *continuation)
append another edge
Definition: NBEdge.cpp:3624
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:2037
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:4354
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
Definition: NBEdge.cpp:670
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition: NBEdge.cpp:633
int myPriority
The priority of the edge.
Definition: NBEdge.h:1688
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
Definition: NBEdge.h:1749
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:534
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
Definition: NBEdge.cpp:1317
int getFirstNonPedestrianNonBicycleLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN, SVC_BICYCLE and 0
Definition: NBEdge.cpp:4098
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:54
const std::string & getID() const
Returns the id.
Definition: Named.h:74
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
A list of positions.
double length() const
Returns the length.
static const PositionVector EMPTY
empty Vector
stop offset
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:197
bool indirectLeft
Whether this connection is an indirect left turn.
Definition: NBEdge.h:270
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:222
std::string viaID
if Connection have a via, ID of it
Definition: NBEdge.h:288
int toLane
The lane the connections yields in.
Definition: NBEdge.h:228
std::vector< int > foeInternalLinks
FOE Internal links.
Definition: NBEdge.h:297
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
Definition: NBEdge.h:261
int getNumericalID() const
Definition: NBEdge.h:329
double speed
custom speed for connection
Definition: NBEdge.h:252
const std::string & getID() const
Definition: NBEdge.h:320
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:225
KeepClear keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:243
double getLength() const
Definition: NBEdge.h:326
bool isInternal() const
Definition: NBEdge.h:335
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Definition: NBEdge.h:338
double getSpeed() const
Definition: NBEdge.h:323
Connection(int fromLane_, NBEdge *toEdge_, int toLane_)
Constructor.
Definition: NBEdge.cpp:97
double customLength
custom length for connection
Definition: NBEdge.h:255
const Connection * getBidiEdge() const
Definition: NBEdge.h:332
std::string edgeType
optional type of Connection
Definition: NBEdge.h:273
double vmax
maximum velocity
Definition: NBEdge.h:282
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:306
PositionVector customShape
custom shape for connection
Definition: NBEdge.h:258
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:240
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this connections internal lane(s)
Definition: NBEdge.h:264
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this connections internal lane(s)
Definition: NBEdge.h:267
PositionVector viaShape
shape of via
Definition: NBEdge.h:291
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:246
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:303
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBEdge.h:231
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:249
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
Definition: NBEdge.h:237
double length
computed length (average of all internal lane shape lengths that share an internal edge)
Definition: NBEdge.h:315
PositionVector shape
shape of Connection
Definition: NBEdge.h:279
std::string id
id of Connection
Definition: NBEdge.h:276
std::vector< std::string > foeIncomingLanes
FOE Incomings lanes.
Definition: NBEdge.h:300
bool haveVia
check if Connection have a Via
Definition: NBEdge.h:285
int tlLinkIndex
The index of this connection within the controlling traffic light.
Definition: NBEdge.h:234
double viaLength
the length of the via shape (maybe customized)
Definition: NBEdge.h:294
static ConstRouterEdgePairVector myViaSuccessors
Definition: NBEdge.h:319
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:142
double width
This lane's width.
Definition: NBEdge.h:172
StopOffset laneStopOffset
stopOffsets.second - The stop offset for vehicles stopping at the lane's end. Applies if vClass is in...
Definition: NBEdge.h:169
int turnSigns
turning signs printed on the road, bitset of LinkDirection (imported from OSM)
Definition: NBEdge.h:191
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:185
double endOffset
This lane's offset to the intersection begin.
Definition: NBEdge.h:165
std::string type
the type of this lane
Definition: NBEdge.h:188
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:175
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this lane.
Definition: NBEdge.h:162
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this lane.
Definition: NBEdge.h:159
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:182
Lane(NBEdge *e, const std::string &_origID)
constructor
Definition: NBEdge.cpp:149
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:178
PositionVector shape
The lane's shape.
Definition: NBEdge.h:147