SUMO - Simulation of Urban MObility
NBNode.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
20 // The representation of a single node
21 /****************************************************************************/
22 #ifndef NBNode_h
23 #define NBNode_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
36 #include <deque>
37 #include <utility>
38 #include <string>
39 #include <set>
40 #include <utils/common/StdDefs.h>
41 #include <utils/common/Named.h>
42 #include <utils/geom/Bresenham.h>
43 #include <utils/geom/GeomHelper.h>
45 #include <utils/geom/Position.h>
48 #include "NBEdge.h"
49 #include "NBConnection.h"
50 #include "NBConnectionDefs.h"
51 #include "NBContHelper.h"
52 
53 
54 // ===========================================================================
55 // class declarations
56 // ===========================================================================
57 class NBRequest;
58 class NBDistrict;
59 class OptionsCont;
61 class NBTypeCont;
63 class NBDistrictCont;
64 class OutputDevice;
65 
66 
67 // ===========================================================================
68 // class definitions
69 // ===========================================================================
74 class NBNode : public Named, public Parameterised {
75  friend class NBNodeCont;
76  friend class GNEJunction; // < used for visualization (NETEDIT)
77  friend class NBNodesEdgesSorter; // < sorts the edges
78  friend class NBNodeTypeComputer; // < computes type
79  friend class NBEdgePriorityComputer; // < computes priorities of edges per intersection
80  friend class NBNodeShapeComputer; // < computes node's shape
81 
82 public:
95  private:
98 
101 
103  std::vector<int> myAvailableLanes;
104 
105  public:
110  ApproachingDivider(EdgeVector* approaching, NBEdge* currentOutgoing);
111 
114 
116  int numAvailableLanes() const {
117  return (int)myAvailableLanes.size();
118  }
119 
121  void execute(const int src, const int dest);
122 
124  std::deque<int>* spread(const std::vector<int>& approachingLanes, int dest) const;
125 
126  };
127 
131  struct Crossing {
133  Crossing(const NBNode* _node, const EdgeVector& _edges, double _width, bool _priority, int _customTLIndex, const PositionVector& _customShape);
135  const NBNode* node;
141  double customWidth;
143  double width;
145  std::string id;
147  std::string prevWalkingArea;
149  std::string nextWalkingArea;
151  bool priority;
155  int tlLinkNo;
159  std::string tlID;
161  bool valid;
162  };
163 
164 
168  struct WalkingArea {
170  WalkingArea(const std::string& _id, double _width) :
171  id(_id),
172  width(_width),
173  hasCustomShape(false),
174  minNextCrossingEdges(std::numeric_limits<int>::max()),
175  minPrevCrossingEdges(std::numeric_limits<int>::max()) {
176  }
178  std::string id;
180  double width;
182  double length;
186  std::vector<std::string> nextCrossings;
188  std::vector<std::string> nextSidewalks;
190  std::vector<std::string> prevSidewalks;
197  };
198 
200  std::set<const NBEdge*> edges;
202  };
203 
205  static const int FORWARD;
206  static const int BACKWARD;
207 
209  static const double UNSPECIFIED_RADIUS;
210 
211 public:
217  NBNode(const std::string& id, const Position& position, SumoXMLNodeType type);
218 
224  NBNode(const std::string& id, const Position& position, NBDistrict* district = 0);
225 
227  ~NBNode();
228 
235  void reinit(const Position& position, SumoXMLNodeType type,
236  bool updateEdgeGeometries = false);
237 
241  const Position& getPosition() const {
242  return myPosition;
243  }
244 
246  Position getCenter() const;
247 
249  const EdgeVector& getIncomingEdges() const {
250  return myIncomingEdges;
251  }
252 
254  const EdgeVector& getOutgoingEdges() const {
255  return myOutgoingEdges;
256  }
257 
259  const EdgeVector& getEdges() const {
260  return myAllEdges;
261  }
262 
267  return myType;
268  }
269 
271  double getRadius() const {
272  return myRadius;
273  }
274 
276  bool getKeepClear() const {
277  return myKeepClear;
278  }
280 
283 
287 
290 
292  void removeTrafficLights();
293 
297  bool isTLControlled() const {
298  return myTrafficLights.size() != 0;
299  }
300 
302  const std::set<NBTrafficLightDefinition*>& getControllingTLS() const {
303  return myTrafficLights;
304  }
305 
307  void invalidateTLS(NBTrafficLightLogicCont& tlCont, bool removedConnections, bool addedConnections);
308 
310  void shiftTLConnectionLaneIndex(NBEdge* edge, int offset);
312 
313 
316 
328 
329 
332 
336  void reshiftPosition(double xoff, double yoff);
337 
339  void mirrorX();
341 
343  void addIncomingEdge(NBEdge* edge);
344 
346  void addOutgoingEdge(NBEdge* edge);
347 
349  void computeLanes2Lanes();
350 
352  void computeLogic(const NBEdgeCont& ec, OptionsCont& oc);
353 
355  bool writeLogic(OutputDevice& into, const bool checkLaneFoes) const;
356 
358  Position getEmptyDir() const;
359 
364  bool hasIncoming(const NBEdge* const e) const;
365 
370  bool hasOutgoing(const NBEdge* const e) const;
371 
373  NBEdge* getOppositeIncoming(NBEdge* e) const;
374 
377 
380 
382  void removeDoubleEdges();
383 
385  NBEdge* getConnectionTo(NBNode* n) const;
386 
388  void addSortedLinkFoes(const NBConnection& mayDrive, const NBConnection& mustStop);
389 
391  NBEdge* getPossiblySplittedIncoming(const std::string& edgeid);
392 
394  NBEdge* getPossiblySplittedOutgoing(const std::string& edgeid);
395 
397  void removeEdge(NBEdge* edge, bool removeFromConnections = true);
398 
408  bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const;
409 
418  bool mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane, int toLane, bool includePedCrossings) const;
419 
426  bool mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const Crossing& crossing) const;
427 
429  static bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
430  const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane,
431  bool lefthand = false);
432 
441  bool forbids(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo,
442  const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo,
443  bool regardNonSignalisedLowerPriority) const;
444 
452  bool foes(const NBEdge* const from1, const NBEdge* const to1,
453  const NBEdge* const from2, const NBEdge* const to2) const;
454 
461  LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing, bool leftHand = false) const;
462 
464  LinkState getLinkState(const NBEdge* incoming, NBEdge* outgoing,
465  int fromLane, int toLane, bool mayDefinitelyPass, const std::string& tlID) const;
466 
470  void computeNodeShape(double mismatchThreshold);
471 
473  const PositionVector& getShape() const;
474 
476  void setCustomShape(const PositionVector& shape);
477 
479  void setRadius(double radius) {
480  myRadius = radius;
481  }
482 
484  void setKeepClear(bool keepClear) {
485  myKeepClear = keepClear;
486  }
487 
489  bool hasCustomShape() const {
490  return myHaveCustomPoly;
491  }
492 
494  bool checkIsRemovable() const;
495 
497  bool checkIsRemovableReporting(std::string& reason) const;
498 
500  std::vector<std::pair<NBEdge*, NBEdge*> > getEdgesToJoin() const;
501 
503  bool isNearDistrict() const;
504 
506  bool isDistrict() const;
507 
509  bool needsCont(const NBEdge* fromE, const NBEdge* otherFromE,
510  const NBEdge::Connection& c, const NBEdge::Connection& otherC) const;
511 
519  PositionVector computeInternalLaneShape(NBEdge* fromE, const NBEdge::Connection& con, int numPoints, NBNode* recordError = 0) const;
520 
531  PositionVector computeSmoothShape(const PositionVector& begShape, const PositionVector& endShape, int numPoints,
532  bool isTurnaround, double extrapolateBeg, double extrapolateEnd,
533  NBNode* recordError = 0) const;
535  static PositionVector bezierControlPoints(const PositionVector& begShape, const PositionVector& endShape,
536  bool isTurnaround, double extrapolateBeg, double extrapolateEnd,
537  bool& ok, NBNode* recordError = 0, double straightThresh = DEG2RAD(5));
538 
539 
541  double getDisplacementError() const {
542  return myDisplacementError;
543  }
544 
546  void replaceIncoming(NBEdge* which, NBEdge* by, int laneOff);
547 
549  void replaceIncoming(const EdgeVector& which, NBEdge* by);
550 
552  void replaceOutgoing(NBEdge* which, NBEdge* by, int laneOff);
553 
555  void replaceOutgoing(const EdgeVector& which, NBEdge* by);
556 
558  int guessCrossings();
559 
560  /* @brief check whether a crossing should be build for the candiate edges and build 0 to n crossings
561  * @param[in] candidates The candidate vector of edges to be crossed
562  * @return The number of crossings built
563  * */
564  int checkCrossing(EdgeVector candidates);
565 
568 
570  void buildInnerEdges();
571 
575  int buildCrossings();
576 
580  void buildWalkingAreas(int cornerDetail);
581 
584 
586  EdgeVector edgesBetween(const NBEdge* e1, const NBEdge* e2) const;
587 
589  bool crossingBetween(const NBEdge* e1, const NBEdge* e2) const;
590 
593  return myBlockedConnections;
594  }
595 
597  bool geometryLike() const;
598 
600  void setRoundabout();
601 
603  void addCrossing(EdgeVector edges, double width, bool priority, int tlIndex = -1,
604  const PositionVector& customShape = PositionVector::EMPTY, bool fromSumoNet = false);
605 
607  void addWalkingAreaShape(EdgeVector edges, const PositionVector& shape);
608 
610  void removeCrossing(const EdgeVector& edges);
611 
613  void discardAllCrossings(bool rejectAll);
614 
618  }
619 
621  std::vector<Crossing*> getCrossings() const;
622  inline const std::vector<Crossing*>& getCrossingsIncludingInvalid() const {
623  return myCrossings;
624  }
625 
627  inline const std::vector<WalkingArea>& getWalkingAreas() const {
628  return myWalkingAreas;
629  }
630 
632  Crossing* getCrossing(const std::string& id) const;
633 
635  void setCrossingTLIndices(const std::string& tlID, int startIndex);
636 
638  int numNormalConnections() const;
639 
641  void avoidOverlap();
642 
644  bool rightOnRedConflict(int index, int foeIndex) const;
645 
647  void sortEdges(bool useNodeShape);
648 
650  int getConnectionIndex(const NBEdge* from, const NBEdge::Connection& con) const;
651 
657  public:
659  explicit nodes_by_id_sorter() { }
660 
662  int operator()(NBNode* n1, NBNode* n2) const {
663  return n1->getID() < n2->getID();
664  }
665  };
666 
671  public:
673  explicit edge_by_direction_sorter(NBNode* n) : myNode(n) {}
674 
676  int operator()(NBEdge* e1, NBEdge* e2) const {
677  UNUSED_PARAMETER(e2);
678  return e1->getFromNode() == myNode;
679  }
680 
681  private:
684 
685  };
686 
688  static std::string getNodeIDFromInternalLane(const std::string id);
689 
690 
692  static bool isTrafficLight(SumoXMLNodeType type);
693 
695  bool isSimpleContinuation(bool checkLaneNumbers = true) const;
696 
697 
698 private:
701 
703  EdgeVector* getEdgesThatApproach(NBEdge* currentOutgoing);
704 
706  void replaceInConnectionProhibitions(NBEdge* which, NBEdge* by, int whichLaneOff, int byLaneOff);
707 
709  void remapRemoved(NBTrafficLightLogicCont& tc, NBEdge* removed, const EdgeVector& incoming, const EdgeVector& outgoing);
710 
712  bool forbidsPedestriansAfter(std::vector<std::pair<NBEdge*, bool> > normalizedLanes, int startIndex);
713 
716 
718  static bool isLongEnough(NBEdge* out, double minLength);
719 
722 
723 private:
726 
729 
732 
735 
737  std::vector<Crossing*> myCrossings;
738 
740  std::vector<WalkingArea> myWalkingAreas;
741 
743  std::vector<WalkingAreaCustomShape> myWalkingAreaCustomShapes;
744 
747 
750 
753 
756 
759 
762 
764  std::set<NBTrafficLightDefinition*> myTrafficLights;
765 
767  double myRadius;
768 
771 
774 
777 
780 
781 private:
783  NBNode(const NBNode& s);
784 
786  NBNode& operator=(const NBNode& s);
787 };
788 
789 
790 #endif
791 
792 /****************************************************************************/
793 
bool getKeepClear() const
Returns the keepClear flag.
Definition: NBNode.h:276
static const PositionVector EMPTY
empty Vector
int operator()(NBEdge *e1, NBEdge *e2) const
operator of selection
Definition: NBNode.h:676
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
Definition: NBNode.cpp:2698
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:161
std::vector< WalkingAreaCustomShape > myWalkingAreaCustomShapes
Vector of custom walking areas shapes.
Definition: NBNode.h:743
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
Definition: NBNode.cpp:1606
void setRoundabout()
update the type of this node as a roundabout
Definition: NBNode.cpp:2627
int numNormalConnections() const
return the number of lane-to-lane connections at this junction (excluding crossings) ...
Definition: NBNode.cpp:2683
WalkingArea(const std::string &_id, double _width)
constructor
Definition: NBNode.h:170
bool foes(const NBEdge *const from1, const NBEdge *const to1, const NBEdge *const from2, const NBEdge *const to2) const
Returns the information whether the given flows cross.
Definition: NBNode.cpp:1451
ApproachingDivider(EdgeVector *approaching, NBEdge *currentOutgoing)
Constructor.
Definition: NBNode.cpp:94
int buildCrossings()
build pedestrian crossings
Definition: NBNode.cpp:2091
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset)
patches loaded signal plans by modifying lane indices
Definition: NBNode.cpp:370
std::string id
the (edge)-id of this crossing
Definition: NBNode.h:145
PositionVector myPoly
the (outer) shape of the junction
Definition: NBNode.h:755
void execute(const int src, const int dest)
the bresenham-callback
Definition: NBNode.cpp:128
const NBConnectionProhibits & getProhibitions()
get prohibitions (BLocked connections)
Definition: NBNode.h:592
bool isDistrict() const
check if node is a district
Definition: NBNode.cpp:1786
SumoXMLNodeType myType
The type of the junction.
Definition: NBNode.h:746
A container for traffic light definitions and built programs.
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
Definition: NBNode.cpp:273
int minPrevCrossingEdges
minimum number of edges crossed by incoming crossings
Definition: NBNode.h:196
~NBNode()
Destructor.
Definition: NBNode.cpp:267
PositionVector computeInternalLaneShape(NBEdge *fromE, const NBEdge::Connection &con, int numPoints, NBNode *recordError=0) const
Compute the shape for an internal lane.
Definition: NBNode.cpp:626
int myCrossingsLoadedFromSumoNet
number of crossings loaded from a sumo net
Definition: NBNode.h:776
This class computes shapes of junctions.
std::vector< Crossing * > getCrossings() const
return this junctions pedestrian crossings
Definition: NBNode.cpp:2038
double length
This lane&#39;s width.
Definition: NBNode.h:182
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
Definition: NBNode.cpp:1281
bool mustBrake(const NBEdge *const from, const NBEdge *const to, int fromLane, int toLane, bool includePedCrossings) const
Returns the information whether the described flow must let any other flow pass.
Definition: NBNode.cpp:1355
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
Definition: NBNode.cpp:411
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:489
The representation of a single edge during network building.
Definition: NBEdge.h:70
static const double UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:209
Used for sorting the cells by the begin time they describe.
Definition: NBNode.h:656
A container for districts.
The base class for traffic light logic definitions.
static bool isLongEnough(NBEdge *out, double minLength)
check if is long enough
Definition: NBNode.cpp:1027
void removeDoubleEdges()
remove duble edges
Definition: NBNode.cpp:1170
bool hasCustomShape
whether this walkingArea has a custom shape
Definition: NBNode.h:192
bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turing right on a red light ...
Definition: NBNode.cpp:2801
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
Definition: NBNode.cpp:2660
PositionVector shape
The crossing&#39;s shape.
Definition: NBNode.h:139
edge_by_direction_sorter(NBNode *n)
constructor
Definition: NBNode.h:673
void buildWalkingAreas(int cornerDetail)
build pedestrian walking areas and set connections from/to walkingAreas
Definition: NBNode.cpp:2180
std::string id
the (edge)-id of this walkingArea
Definition: NBNode.h:178
const std::string & getID() const
Returns the id.
Definition: Named.h:65
void mirrorX()
mirror coordinates along the x-axis
Definition: NBNode.cpp:306
int numCrossingsFromSumoNet() const
get num of crossings from sumo net
Definition: NBNode.h:616
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
Definition: NBNode.cpp:331
void setCustomShape(const PositionVector &shape)
set the junction shape
Definition: NBNode.cpp:1732
NBConnectionProhibits myBlockedConnections
The container for connection block dependencies.
Definition: NBNode.h:749
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
Definition: NBNode.cpp:421
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
void replaceOutgoing(NBEdge *which, NBEdge *by, int laneOff)
Replaces occurences of the first edge within the list of outgoing by the second Connections are remap...
Definition: NBNode.cpp:1066
void sortEdges(bool useNodeShape)
sort all edge containers for this node
Definition: NBNode.cpp:2814
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
Definition: NBNode.cpp:2717
static bool rightTurnConflict(const NBEdge *from, const NBEdge *to, int fromLane, const NBEdge *prohibitorFrom, const NBEdge *prohibitorTo, int prohibitorFromLane, bool lefthand=false)
return whether the given laneToLane connection is a right turn which must yield to a bicycle crossing...
Definition: NBNode.cpp:1375
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges (The edges which start at this node)
Definition: NBNode.h:254
bool priority
whether the pedestrians have priority
Definition: NBNode.h:151
NBRequest * myRequest
Node requests.
Definition: NBNode.h:761
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
NBDistrict * myDistrict
The district the node is the centre of.
Definition: NBNode.h:752
A class representing a single district.
Definition: NBDistrict.h:71
NBEdge * getConnectionTo(NBNode *n) const
get connection to certain node
Definition: NBNode.cpp:1744
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
Definition: NBNode.h:734
void invalidateTLS(NBTrafficLightLogicCont &tlCont, bool removedConnections, bool addedConnections)
causes the traffic light to be computed anew
Definition: NBNode.cpp:347
void computeLanes2Lanes()
computes the connections of lanes to edges
Definition: NBNode.cpp:803
void setRadius(double radius)
set the turning radius
Definition: NBNode.h:479
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:297
bool writeLogic(OutputDevice &into, const bool checkLaneFoes) const
writes the XML-representation of the logic as a bitset-logic XML representation
Definition: NBNode.cpp:761
void invalidateIncomingConnections()
invalidate incoming connections
Definition: NBNode.cpp:1339
void removeCrossing(const EdgeVector &edges)
remove a pedestrian crossing from this node (identified by its edges)
Definition: NBNode.cpp:2645
void setPriorityJunctionPriorities()
sets the priorites in case of a priority junction
void computeNodeShape(double mismatchThreshold)
Compute the junction shape for this node.
Definition: NBNode.cpp:771
std::set< const NBEdge * > edges
Definition: NBNode.h:200
std::string prevWalkingArea
the lane-id of the previous walkingArea
Definition: NBNode.h:147
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
get possibly splitted incoming edge
Definition: NBNode.cpp:1255
int checkCrossing(EdgeVector candidates)
Definition: NBNode.cpp:1896
static const int FORWARD
edge directions (for pedestrian related stuff)
Definition: NBNode.h:205
void setCrossingTLIndices(const std::string &tlID, int startIndex)
set tl indices of this nodes crossing starting at the given index
Definition: NBNode.cpp:2671
int minNextCrossingEdges
minimum number of edges crossed by nextCrossings
Definition: NBNode.h:194
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
A list of positions.
void buildCrossingsAndWalkingAreas()
build crossings, and walkingareas. Also removes invalid loaded crossings if wished ...
Definition: NBNode.cpp:2015
bool crossingBetween(const NBEdge *e1, const NBEdge *e2) const
return true if the given edges are connected by a crossing
Definition: NBNode.cpp:2550
void invalidateOutgoingConnections()
invalidate outgoing connections
Definition: NBNode.cpp:1347
void removeJoinedTrafficLights()
remove all traffic light definitions that are part of a joined tls
Definition: NBNode.cpp:702
int operator()(NBNode *n1, NBNode *n2) const
Comparing operator.
Definition: NBNode.h:662
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node) ...
Definition: NBNode.h:259
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
void removeTrafficLights()
Removes all references to traffic lights that control this tls.
Definition: NBNode.cpp:338
EdgeVector * getEdgesThatApproach(NBEdge *currentOutgoing)
returns a list of edges which are connected to the given outgoing edge
Definition: NBNode.cpp:1043
bool geometryLike() const
whether this is structurally similar to a geometry node
Definition: NBNode.cpp:2596
std::set< NBTrafficLightDefinition * > myTrafficLights
traffic lights of node
Definition: NBNode.h:764
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
Definition: NBNode.cpp:1214
bool myDiscardAllCrossings
whether to discard all pedestrian crossings
Definition: NBNode.h:773
NBNode * myNode
The node to compute the relative angle of.
Definition: NBNode.h:683
void discardAllCrossings(bool rejectAll)
discard all current (and optionally future) crossings
Definition: NBNode.cpp:2056
#define DEG2RAD(x)
Definition: GeomHelper.h:44
void replaceInConnectionProhibitions(NBEdge *which, NBEdge *by, int whichLaneOff, int byLaneOff)
replace incoming connections prohibitions
Definition: NBNode.cpp:1135
An upper class for objects with additional parameters.
Definition: Parameterised.h:50
double myRadius
the turning radius (for all corners) at this node in m.
Definition: NBNode.h:767
void addCrossing(EdgeVector edges, double width, bool priority, int tlIndex=-1, const PositionVector &customShape=PositionVector::EMPTY, bool fromSumoNet=false)
add a pedestrian crossing to this node
Definition: NBNode.cpp:2635
EdgeVector myIncomingEdges
Vector of incoming edges.
Definition: NBNode.h:728
void setKeepClear(bool keepClear)
set the keepClear flag
Definition: NBNode.h:484
bool checkIsRemovableReporting(std::string &reason) const
check if node is removable and return reason if not
Definition: NBNode.cpp:1640
Base class for objects which have an id.
Definition: Named.h:45
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
Definition: NBNode.cpp:1208
double getDisplacementError() const
compute the displacement error during s-curve computation
Definition: NBNode.h:541
void avoidOverlap()
fix overlap
Definition: NBNode.cpp:2778
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, NBNode *recordError=0) const
Compute a smooth curve between the given geometries.
Definition: NBNode.cpp:460
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
get possibly splitted outgoing edge
Definition: NBNode.cpp:1268
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream&#39;s direction.
Definition: NBNode.cpp:1539
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1726
EdgeVector myOutgoingEdges
Vector of outgoing edges.
Definition: NBNode.h:731
std::vector< Crossing * > myCrossings
Vector of crossings.
Definition: NBNode.h:737
void addWalkingAreaShape(EdgeVector edges, const PositionVector &shape)
add custom shape for walkingArea
Definition: NBNode.cpp:2587
NBEdge * myCurrentOutgoing
The approached current edge.
Definition: NBNode.h:100
double myDisplacementError
geometry error after computation of internal lane shapes
Definition: NBNode.h:779
static const int BACKWARD
Definition: NBNode.h:206
nodes_by_id_sorter()
Constructor.
Definition: NBNode.h:659
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
Definition: NBNode.cpp:321
double width
This crossing&#39;s width.
Definition: NBNode.h:143
bool myHaveCustomPoly
whether this nodes shape was set by the user
Definition: NBNode.h:758
int customTLIndex
the custom traffic light index of this crossing (if controlled)
Definition: NBNode.h:157
Position myPosition
The position the node lies at.
Definition: NBNode.h:725
bool checkCrossingDuplicated(EdgeVector edges)
return true if already exist a crossing with the same edges as the input
Definition: NBNode.cpp:1987
std::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
int removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes edges which are both incoming and outgoing into this node.
Definition: NBNode.cpp:378
double getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:271
~ApproachingDivider()
Destructor.
Definition: NBNode.cpp:124
std::vector< WalkingArea > myWalkingAreas
Vector of walking areas.
Definition: NBNode.h:740
const EdgeVector & getIncomingEdges() const
Returns this node&#39;s incoming edges (The edges which yield in this node)
Definition: NBNode.h:249
PositionVector customShape
optional customShape for this crossing
Definition: NBNode.h:153
void replaceIncoming(NBEdge *which, NBEdge *by, int laneOff)
Replaces occurences of the first edge within the list of incoming by the second Connections are remap...
Definition: NBNode.cpp:1102
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
bool isNearDistrict() const
if node is near district
Definition: NBNode.cpp:1755
bool myKeepClear
whether the junction area must be kept clear
Definition: NBNode.h:770
std::vector< int > myAvailableLanes
The available lanes to which connections shall be built.
Definition: NBNode.h:103
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node) ...
Definition: NBNode.h:302
Sorts outgoing before incoming edges.
Definition: NBNode.h:670
int tlLinkNo
the traffic light index of this crossing (if controlled)
Definition: NBNode.h:155
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:40
bool forbids(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo, bool regardNonSignalisedLowerPriority) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
Definition: NBNode.cpp:1441
void buildInnerEdges()
build internal lanes, pedestrian crossings and walking areas
Definition: NBNode.cpp:2068
NBNode & operator=(const NBNode &s)
invalidated assignment operator
double customWidth
This crossing&#39;s width.
Definition: NBNode.h:141
A definition of a pedestrian walking area.
Definition: NBNode.h:168
EdgeVector * myApproaching
The list of edges that approach the current edge.
Definition: NBNode.h:97
A storage for options typed value containers)
Definition: OptionsCont.h:98
const NBNode * node
The parent node of this crossing.
Definition: NBNode.h:135
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:266
Position getEmptyDir() const
Returns something like the most unused direction Should only be used to add source or sink nodes...
Definition: NBNode.cpp:1311
bool needsCont(const NBEdge *fromE, const NBEdge *otherFromE, const NBEdge::Connection &c, const NBEdge::Connection &otherC) const
whether an internal junction should be built at from and respect other
Definition: NBNode.cpp:653
int numAvailableLanes() const
@ get number of avaliable lanes
Definition: NBNode.h:116
EdgeVector getEdgesSortedByAngleAtNodeCenter() const
returns the list of all edges sorted clockwise by getAngleAtNodeToCenter
Definition: NBNode.cpp:2735
const Position & getPosition() const
Definition: NBNode.h:241
EdgeVector edges
The edges being crossed.
Definition: NBNode.h:137
Represents a single node (junction) during network building.
Definition: NBNode.h:74
int guessCrossings()
guess pedestrian crossings and return how many were guessed
Definition: NBNode.cpp:1792
A definition of a pedestrian crossing.
Definition: NBNode.h:131
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
Definition: NBNode.h:627
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
add shorted link FOES
Definition: NBNode.cpp:1238
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
Computes lane-2-lane connections.
Definition: NBNode.h:94
bool mustBrakeForCrossing(const NBEdge *const from, const NBEdge *const to, const Crossing &crossing) const
Returns the information whether the described flow must brake for the given crossing.
Definition: NBNode.cpp:1369
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBNode.h:159
NBEdge * getOppositeIncoming(NBEdge *e) const
returns the opposite incoming edge of certain edge
Definition: NBNode.cpp:1220
const std::vector< Crossing * > & getCrossingsIncludingInvalid() const
Definition: NBNode.h:622
std::vector< std::string > nextCrossings
the lane-id of the next crossing(s)
Definition: NBNode.h:186
bool isLeftMover(const NBEdge *const from, const NBEdge *const to) const
Computes whether the given connection is a left mover across the junction.
Definition: NBNode.cpp:1422
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:426
void computeLogic(const NBEdgeCont &ec, OptionsCont &oc)
computes the node&#39;s type, logic and traffic light
Definition: NBNode.cpp:716
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:66
std::string nextWalkingArea
the lane-id of the next walkingArea
Definition: NBNode.h:149
std::deque< int > * spread(const std::vector< int > &approachingLanes, int dest) const
the method that spreads the wished number of lanes from the the lane given by the bresenham-call to b...
Definition: NBNode.cpp:152
bool checkIsRemovable() const
check if node is removable
Definition: NBNode.cpp:1634
NBNode(const std::string &id, const Position &position, SumoXMLNodeType type)
Constructor.
Definition: NBNode.cpp:236
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
get edges to join
Definition: NBNode.cpp:1703
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, bool &ok, NBNode *recordError=0, double straightThresh=DEG2RAD(5))
get bezier control points
Definition: NBNode.cpp:486
std::vector< std::string > prevSidewalks
the lane-id of the previous sidewalk lane or ""
Definition: NBNode.h:190
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
Definition: NBNode.cpp:2793
bool valid
whether this crossing is valid (and can be written to the net.xml). This is needed for netedit becaus...
Definition: NBNode.h:161
std::vector< std::string > nextSidewalks
the lane-id of the next sidewalk lane or ""
Definition: NBNode.h:188
bool isSimpleContinuation(bool checkLaneNumbers=true) const
check if node is a simple continuation
Definition: NBNode.cpp:431
void reshiftPosition(double xoff, double yoff)
Applies an offset to the node.
Definition: NBNode.cpp:299
void remapRemoved(NBTrafficLightLogicCont &tc, NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
remap removed
Definition: NBNode.cpp:1458
PositionVector shape
The polygonal shape.
Definition: NBNode.h:184
A storage for available types of edges.
Definition: NBTypeCont.h:61
double width
This lane&#39;s width.
Definition: NBNode.h:180
bool forbidsPedestriansAfter(std::vector< std::pair< NBEdge *, bool > > normalizedLanes, int startIndex)
return whether there is a non-sidewalk lane after the given index;
Definition: NBNode.cpp:2004
EdgeVector edgesBetween(const NBEdge *e1, const NBEdge *e2) const
return all edges that lie clockwise between the given edges
Definition: NBNode.cpp:2571
static std::string getNodeIDFromInternalLane(const std::string id)
returns the node id for internal lanes, crossings and walkingareas
Definition: NBNode.cpp:2758