SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBNode.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The representation of a single node
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef NBNode_h
24 #define NBNode_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <vector>
37 #include <deque>
38 #include <utility>
39 #include <string>
40 #include <set>
41 #include <utils/common/StdDefs.h>
42 #include <utils/common/Named.h>
43 #include <utils/geom/Bresenham.h>
45 #include <utils/geom/Position.h>
46 #include <utils/geom/Line.h>
49 #include "NBEdge.h"
50 #include "NBConnection.h"
51 #include "NBConnectionDefs.h"
52 #include "NBContHelper.h"
53 
54 
55 // ===========================================================================
56 // class declarations
57 // ===========================================================================
58 class NBRequest;
59 class NBDistrict;
60 class OptionsCont;
62 class NBTypeCont;
64 class NBDistrictCont;
65 class OutputDevice;
66 
67 
68 // ===========================================================================
69 // class definitions
70 // ===========================================================================
75 class NBNode : public Named {
76  friend class NBNodeCont;
77  friend class GNEJunction; // < used for visualization (NETEDIT)
78  friend class NBNodesEdgesSorter; // < sorts the edges
79  friend class NBNodeTypeComputer; // < computes type
80  friend class NBEdgePriorityComputer; // < computes priorities of edges per intersection
81 
82 public:
83  typedef std::map<std::string, PositionVector> CustomShapeMap;
84 
97  private:
100 
103 
105  std::vector<unsigned int> myAvailableLanes;
106 
107  public:
112  ApproachingDivider(EdgeVector* approaching, NBEdge* currentOutgoing);
113 
116 
117  unsigned int numAvailableLanes() const {
118  return (unsigned int)myAvailableLanes.size();
119  }
120 
122  void execute(const unsigned int src, const unsigned int dest);
123 
126  std::deque<int>* spread(const std::vector<int>& approachingLanes, int dest) const;
127 
128  };
129 
133  struct Crossing {
134  Crossing(const NBNode* _node, const EdgeVector& _edges, SUMOReal _width, bool _priority) :
135  node(_node), edges(_edges), width(_width), priority(_priority), tlLinkNo(-1)
136  {}
138  const NBNode* node;
146  std::string id;
148  std::string prevWalkingArea;
150  std::string nextWalkingArea;
152  bool priority;
154  int tlLinkNo;
155  };
156 
157 
161  struct WalkingArea {
162  WalkingArea(const std::string& _id, SUMOReal _width) :
163  id(_id),
164  width(_width),
165  nextCrossing("")
166  {}
168  std::string id;
176  std::string nextCrossing;
178  std::vector<std::string> nextSidewalks;
180  std::vector<std::string> prevSidewalks;
181  };
182 
184  static const int FORWARD;
185  static const int BACKWARD;
188 
190  static const SUMOReal DEFAULT_RADIUS;
191 
194 
195 public:
197  static const int MAX_CONNECTIONS;
198 
204  NBNode(const std::string& id, const Position& position, SumoXMLNodeType type);
205 
206 
212  NBNode(const std::string& id, const Position& position, NBDistrict* district = 0);
213 
214 
216  ~NBNode();
217 
218 
225  void reinit(const Position& position, SumoXMLNodeType type,
226  bool updateEdgeGeometries = false);
227 
228 
231 
235  const Position& getPosition() const {
236  return myPosition;
237  }
238 
239 
241  Position getCenter() const;
242 
243 
247  const EdgeVector& getIncomingEdges() const {
248  return myIncomingEdges;
249  }
250 
251 
255  const EdgeVector& getOutgoingEdges() const {
256  return myOutgoingEdges;
257  }
258 
259 
263  const EdgeVector& getEdges() const {
264  return myAllEdges;
265  }
266 
267 
273  return myType;
274  }
275 
279  SUMOReal getRadius() const {
280  return myRadius;
281  }
282 
285  bool getKeepClear() const {
286  return myKeepClear;
287  }
289 
290 
291 
294 
299 
302 
305  void removeTrafficLights();
306 
307 
311  bool isTLControlled() const {
312  return myTrafficLights.size() != 0;
313  }
314 
315 
319  bool isJoinedTLSControlled() const;
320 
321 
325  const std::set<NBTrafficLightDefinition*>& getControllingTLS() const {
326  return myTrafficLights;
327  }
328 
329 
332 
334  void shiftTLConnectionLaneIndex(NBEdge* edge, int offset);
336 
337 
338 
341 
353 
354 
355 
358 
363  void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
364 
366  void mirrorX();
368 
369 
370 
372  void addIncomingEdge(NBEdge* edge);
373 
375  void addOutgoingEdge(NBEdge* edge);
376 
377 
378 
379 
381  void computeLanes2Lanes();
382 
384  void computeLogic(const NBEdgeCont& ec, OptionsCont& oc);
385 
388  bool writeLogic(OutputDevice& into, const bool checkLaneFoes) const;
389 
392  Position getEmptyDir() const;
393 
394 
399  bool hasIncoming(const NBEdge* const e) const;
400 
401 
406  bool hasOutgoing(const NBEdge* const e) const;
407 
408 
409  NBEdge* getOppositeIncoming(NBEdge* e) const;
412 
413  void removeDoubleEdges();
414  NBEdge* getConnectionTo(NBNode* n) const;
415 
416 
417  void addSortedLinkFoes(const NBConnection& mayDrive,
418  const NBConnection& mustStop);
419 
420  NBEdge* getPossiblySplittedIncoming(const std::string& edgeid);
421  NBEdge* getPossiblySplittedOutgoing(const std::string& edgeid);
422 
425  void removeEdge(NBEdge* edge, bool removeFromConnections = true);
426 
436  bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const;
437 
438 
446  bool mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane, bool includePedCrossings) const;
447 
454  bool mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const Crossing& crossing) const;
455 
458  static bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
459  const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane, bool lefthand = false);
460 
469  bool forbids(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo,
470  const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo,
471  bool regardNonSignalisedLowerPriority) const;
472 
473 
481  bool foes(const NBEdge* const from1, const NBEdge* const to1,
482  const NBEdge* const from2, const NBEdge* const to2) const;
483 
484 
491  LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing, bool leftHand = false) const;
492 
493  LinkState getLinkState(const NBEdge* incoming, NBEdge* outgoing,
494  int fromLane, bool mayDefinitelyPass, const std::string& tlID) const;
495 
499  void computeNodeShape(SUMOReal mismatchThreshold);
500 
502  const PositionVector& getShape() const;
503 
505  void setCustomShape(const PositionVector& shape);
506 
508  void setCustomLaneShape(const std::string& laneID, const PositionVector& shape);
509 
512  return myCustomLaneShapes;
513  }
514 
516  void setRadius(SUMOReal radius) {
517  myRadius = radius;
518  }
519 
521  void setKeepClear(bool keepClear) {
522  myKeepClear = keepClear;
523  }
524 
526  bool hasCustomShape() const {
527  return myHaveCustomPoly;
528  }
529 
530  bool checkIsRemovable() const;
531 
532 
533  std::vector<std::pair<NBEdge*, NBEdge*> > getEdgesToJoin() const;
534 
535 
536  friend class NBNodeShapeComputer;
537 
538  bool isNearDistrict() const;
539  bool isDistrict() const;
540 
542  bool needsCont(const NBEdge* fromE, const NBEdge* otherFromE,
543  const NBEdge::Connection& c, const NBEdge::Connection& otherC) const;
544 
551  PositionVector computeInternalLaneShape(NBEdge* fromE, const NBEdge::Connection& con, int numPoints = 5) const;
552 
553 
564  const PositionVector& begShape,
565  const PositionVector& endShape,
566  int numPoints,
567  bool isTurnaround,
568  SUMOReal extrapolateBeg,
569  SUMOReal extrapolateEnd) const;
570 
571 
574  void replaceIncoming(NBEdge* which, NBEdge* by, unsigned int laneOff);
575 
578  void replaceIncoming(const EdgeVector& which, NBEdge* by);
579 
582  void replaceOutgoing(NBEdge* which, NBEdge* by, unsigned int laneOff);
583 
586  void replaceOutgoing(const EdgeVector& which, NBEdge* by);
587 
589  int guessCrossings();
590 
591  /* @brief check whether a crossing should be build for the candiate edges and build 0 to n crossings
592  * @param[in] candidates The candidate vector of edges to be crossed
593  * @return The number of crossings built
594  * */
595  int checkCrossing(EdgeVector candidates);
596 
598  void buildInnerEdges();
599 
600  /* @brief build pedestrian crossings
601  * @return The next index for creating internal lanes
602  * */
603  unsigned int buildCrossings();
604 
605  /* @brief build pedestrian walking areas and set connections from/to walkingAreas
606  * @param[in] cornerDetail The detail level when generating the inner curve
607  * */
608  void buildWalkingAreas(int cornerDetail);
609 
610  /* @brief build crossings, and walkingareas. Also removes invalid loaded
611  * crossings*/
613 
615  EdgeVector edgesBetween(const NBEdge* e1, const NBEdge* e2) const;
616 
618  bool crossingBetween(const NBEdge* e1, const NBEdge* e2) const;
619 
621  return myBlockedConnections;
622  }
623 
626  bool geometryLike() const;
627 
629  void setRoundabout();
630 
632  void addCrossing(EdgeVector edges, SUMOReal width, bool priority, bool fromSumoNet = false);
633 
635  void removeCrossing(const EdgeVector& edges);
636 
638  myDiscardAllCrossings = true;
639  }
640 
643  }
644 
646  inline const std::vector<Crossing>& getCrossings() const {
647  return myCrossings;
648  }
649 
651  inline const std::vector<WalkingArea>& getWalkingAreas() const {
652  return myWalkingAreas;
653  }
654 
656  const Crossing& getCrossing(const std::string& id) const;
657 
659  void setCrossingTLIndices(unsigned int startIndex);
660 
662  int numNormalConnections() const;
663 
666  void avoidOverlap();
667 
668 
674  public:
676  explicit nodes_by_id_sorter() { }
677 
680  int operator()(NBNode* n1, NBNode* n2) const {
681  return n1->getID() < n2->getID();
682  }
683 
684  };
685 
686 
691  public:
693  int operator()(NBEdge* e1, NBEdge* e2) const {
694  UNUSED_PARAMETER(e2);
695  return e1->getFromNode() == myNode;
696  }
697 
698  private:
701 
702  };
703 
705  static std::string getNodeIDFromInternalLane(const std::string id);
706 
707 private:
708  bool isSimpleContinuation() const;
709 
712 
715  EdgeVector* getEdgesThatApproach(NBEdge* currentOutgoing);
716 
717 
718 
719 
721  unsigned int whichLaneOff, unsigned int byLaneOff);
722 
723 
725  NBEdge* removed, const EdgeVector& incoming, const EdgeVector& outgoing);
726 
727 
729  bool forbidsPedestriansAfter(std::vector<std::pair<NBEdge*, bool> > normalizedLanes, int startIndex);
730 
731 
734 
735 private:
738 
741 
744 
747 
749  std::vector<Crossing> myCrossings;
750 
752  std::vector<WalkingArea> myWalkingAreas;
753 
756 
759 
762 
765 
768 
770 
771  std::set<NBTrafficLightDefinition*> myTrafficLights;
772 
775 
778 
780 
783 
786 
787 private:
789  NBNode(const NBNode& s);
790 
792  NBNode& operator=(const NBNode& s);
793 
794 
795 };
796 
797 
798 #endif
799 
800 /****************************************************************************/
801 
void replaceIncoming(NBEdge *which, NBEdge *by, unsigned int laneOff)
Replaces occurences of the first edge within the list of incoming by the second Connections are remap...
Definition: NBNode.cpp:931
const EdgeVector & getIncomingEdges() const
Returns this node&#39;s incoming edges.
Definition: NBNode.h:247
Position getEmptyDir() const
Returns something like the most unused direction Should only be used to add source or sink nodes...
Definition: NBNode.cpp:1137
bool getKeepClear() const
Returns the keepClear flag.
Definition: NBNode.h:285
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:148
void setRoundabout()
update the type of this node as a roundabout
Definition: NBNode.cpp:2297
std::vector< Crossing > myCrossings
Vector of crossings.
Definition: NBNode.h:749
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
Definition: NBNode.cpp:2352
SUMOReal width
This lane&#39;s width.
Definition: NBNode.h:144
ApproachingDivider(EdgeVector *approaching, NBEdge *currentOutgoing)
Constructor.
Definition: NBNode.cpp:99
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset)
patches loaded signal plans by modifying lane indices
Definition: NBNode.cpp:367
SUMOReal getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:279
std::string id
the (edge)-id of this crossing
Definition: NBNode.h:146
bool isDistrict() const
Definition: NBNode.cpp:1591
PositionVector myPoly
the (outer) shape of the junction
Definition: NBNode.h:764
NBEdge * getOppositeIncoming(NBEdge *e) const
Definition: NBNode.cpp:1050
const NBConnectionProhibits & getProhibitions()
Definition: NBNode.h:620
void execute(const unsigned int src, const unsigned int dest)
Definition: NBNode.cpp:133
SUMOReal myRadius
the turning radius (for all corners) at this node in m.
Definition: NBNode.h:774
SumoXMLNodeType myType
The type of the junction.
Definition: NBNode.h:755
A container for traffic light definitions and built programs.
SUMOReal length
This lane&#39;s width.
Definition: NBNode.h:172
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
Definition: NBNode.cpp:266
SUMOReal width
This lane&#39;s width.
Definition: NBNode.h:170
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:311
~NBNode()
Destructor.
Definition: NBNode.cpp:260
int myCrossingsLoadedFromSumoNet
number of crossings loaded from a sumo net
Definition: NBNode.h:785
This class computes shapes of junctions.
const Crossing & getCrossing(const std::string &id) const
return the crossing with the given id
Definition: NBNode.cpp:2328
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
Definition: NBNode.cpp:1111
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
Definition: NBNode.cpp:418
The representation of a single edge during network building.
Definition: NBEdge.h:71
int numNormalConnections() const
return the number of lane-to-lane connections at this junction (excluding crossings) ...
Definition: NBNode.cpp:2347
Used for sorting the cells by the begin time they describe.
Definition: NBNode.h:673
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
Definition: NBNode.cpp:1044
A container for districts.
const std::vector< Crossing > & getCrossings() const
return this junctions pedestrian crossings
Definition: NBNode.h:646
The base class for traffic light logic definitions.
EdgeVector edgesBetween(const NBEdge *e1, const NBEdge *e2) const
return all edges that lie clockwise between the given edges
Definition: NBNode.cpp:2256
bool mustBrake(const NBEdge *const from, const NBEdge *const to, int fromLane, bool includePedCrossings) const
Returns the information whether the described flow must let any other flow pass.
Definition: NBNode.cpp:1181
bool isJoinedTLSControlled() const
Returns whether this node is controlled by a tls that spans over more than one node.
Definition: NBNode.cpp:332
void removeDoubleEdges()
Definition: NBNode.cpp:999
PositionVector shape
The lane&#39;s shape.
Definition: NBNode.h:142
edge_by_direction_sorter(NBNode *n)
Definition: NBNode.h:692
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:526
void buildWalkingAreas(int cornerDetail)
Definition: NBNode.cpp:1929
static const int MAX_CONNECTIONS
maximum number of connections allowed
Definition: NBNode.h:197
friend class GNEJunction
Definition: NBNode.h:77
std::string id
the (edge)-id of this walkingArea
Definition: NBNode.h:168
EdgeVector getEdgesSortedByAngleAtNodeCenter() const
returns the list of all edges sorted clockwise by getAngleAtNodeToCenter
Definition: NBNode.cpp:2370
bool checkIsRemovable() const
Definition: NBNode.cpp:1452
void mirrorX()
mirror coordinates along the x-axis
Definition: NBNode.cpp:299
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
Definition: NBNode.cpp:316
void setCustomShape(const PositionVector &shape)
set the junction shape
Definition: NBNode.cpp:1532
NBConnectionProhibits myBlockedConnections
Definition: NBNode.h:758
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
Definition: NBNode.cpp:1038
int numCrossingsFromSumoNet() const
Definition: NBNode.h:641
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
Definition: NBNode.cpp:428
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
unsigned int numAvailableLanes() const
Definition: NBNode.h:117
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:1201
bool priority
whether the pedestrians have priority
Definition: NBNode.h:152
NBRequest * myRequest
Definition: NBNode.h:769
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
CustomShapeMap myCustomLaneShapes
Definition: NBNode.h:779
NBDistrict * myDistrict
The district the node is the centre of.
Definition: NBNode.h:761
A class representing a single district.
Definition: NBDistrict.h:72
PositionVector computeInternalLaneShape(NBEdge *fromE, const NBEdge::Connection &con, int numPoints=5) const
Compute the shape for an internal lane.
Definition: NBNode.cpp:576
std::map< std::string, PositionVector > CustomShapeMap
Definition: NBNode.h:83
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges.
Definition: NBNode.h:255
const std::string & getID() const
Returns the id.
Definition: Named.h:60
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
Definition: NBNode.h:746
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:617
void computeLanes2Lanes()
computes the connections of lanes to edges
Definition: NBNode.cpp:753
void invalidateIncomingConnections()
Definition: NBNode.cpp:1165
void removeCrossing(const EdgeVector &edges)
remove a pedestrian crossing from this node (identified by its edges)
Definition: NBNode.cpp:2314
void setPriorityJunctionPriorities()
sets the priorites in case of a priority junction
const Position & getPosition() const
Returns the position of this node.
Definition: NBNode.h:235
std::string prevWalkingArea
the lane-id of the previous walkingArea
Definition: NBNode.h:148
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
Definition: NBNode.cpp:1085
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node.
Definition: NBNode.h:325
bool isSimpleContinuation() const
Definition: NBNode.cpp:438
int checkCrossing(EdgeVector candidates)
Definition: NBNode.cpp:1699
static const int FORWARD
edge directions (for pedestrian related stuff)
Definition: NBNode.h:184
std::vector< unsigned int > myAvailableLanes
The available lanes to which connections shall be built.
Definition: NBNode.h:105
int operator()(NBNode *n1, NBNode *n2) const
Comparing operator.
Definition: NBNode.h:680
void setRadius(SUMOReal radius)
set the turning radius
Definition: NBNode.h:516
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
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:1195
A list of positions.
void buildCrossingsAndWalkingAreas()
Definition: NBNode.cpp:1801
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:272
bool geometryLike() const
whether this is structurally similar to a geometry node
Definition: NBNode.cpp:2272
void invalidateOutgoingConnections()
Definition: NBNode.cpp:1173
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:323
EdgeVector * getEdgesThatApproach(NBEdge *currentOutgoing)
Definition: NBNode.cpp:872
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
Definition: NBNode.h:263
std::set< NBTrafficLightDefinition * > myTrafficLights
Definition: NBNode.h:771
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
void setCustomLaneShape(const std::string &laneID, const PositionVector &shape)
sets a custom shape for an internal lane
Definition: NBNode.cpp:1539
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, SUMOReal extrapolateBeg, SUMOReal extrapolateEnd) const
Compute a smooth curve between the given geometries.
Definition: NBNode.cpp:467
std::string nextCrossing
the lane-id of the next crossing
Definition: NBNode.h:176
void setCrossingTLIndices(unsigned int startIndex)
set tl indices of this nodes crossing starting at the given index
Definition: NBNode.cpp:2339
const CustomShapeMap & getCustomLaneShapes() const
sets a custom shape for an internal lane
Definition: NBNode.h:511
bool myDiscardAllCrossings
whether to discard all pedestrian crossings
Definition: NBNode.h:782
NBNode * myNode
The node to compute the relative angle of.
Definition: NBNode.h:700
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:1365
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1526
NBEdge * getConnectionTo(NBNode *n) const
Definition: NBNode.cpp:1549
EdgeVector myIncomingEdges
Vector of incoming edges.
Definition: NBNode.h:740
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:1248
void setKeepClear(bool keepClear)
set the keepClear flag
Definition: NBNode.h:521
Base class for objects which have an id.
Definition: Named.h:45
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
Definition: NBNode.cpp:1503
int operator()(NBEdge *e1, NBEdge *e2) const
Definition: NBNode.h:693
void avoidOverlap()
fix overlap
Definition: NBNode.cpp:2413
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
Definition: NBNode.cpp:1098
unsigned int removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes edges which are both incoming and outgoing into this node.
Definition: NBNode.cpp:375
EdgeVector myOutgoingEdges
Vector of outgoing edges.
Definition: NBNode.h:743
NBEdge * myCurrentOutgoing
The approached current edge.
Definition: NBNode.h:102
static const int BACKWARD
Definition: NBNode.h:185
nodes_by_id_sorter()
Constructor.
Definition: NBNode.h:676
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
Definition: NBNode.cpp:307
bool isNearDistrict() const
Definition: NBNode.cpp:1560
bool myHaveCustomPoly
whether this nodes shape was set by the user
Definition: NBNode.h:767
void addCrossing(EdgeVector edges, SUMOReal width, bool priority, bool fromSumoNet=false)
add a pedestrian crossing to this node
Definition: NBNode.cpp:2305
Position myPosition
The position the node lies at.
Definition: NBNode.h:737
std::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
void replaceOutgoing(NBEdge *which, NBEdge *by, unsigned int laneOff)
Replaces occurences of the first edge within the list of outgoing by the second Connections are remap...
Definition: NBNode.cpp:895
~ApproachingDivider()
Destructor.
Definition: NBNode.cpp:129
std::vector< WalkingArea > myWalkingAreas
Vector of walking areas.
Definition: NBNode.h:752
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, bool mayDefinitelyPass, const std::string &tlID) const
Definition: NBNode.cpp:1429
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
unsigned int buildCrossings()
Definition: NBNode.cpp:1847
bool myKeepClear
whether the junction area must be kept clear
Definition: NBNode.h:777
Sorts outgoing before incoming edges.
Definition: NBNode.h:690
int tlLinkNo
the traffic light index of this crossing (if controlled)
Definition: NBNode.h:154
void replaceInConnectionProhibitions(NBEdge *which, NBEdge *by, unsigned int whichLaneOff, unsigned int byLaneOff)
Definition: NBNode.cpp:964
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:41
void buildInnerEdges()
build internal lanes, pedestrian crossings and walking areas
Definition: NBNode.cpp:1817
NBNode & operator=(const NBNode &s)
invalidated assignment operator
A definition of a pedestrian walking area.
Definition: NBNode.h:161
EdgeVector * myApproaching
The list of edges that approach the current edge.
Definition: NBNode.h:99
A storage for options typed value containers)
Definition: OptionsCont.h:108
const NBNode * node
The parent node of this crossing.
Definition: NBNode.h:138
static const SUMOReal DEFAULT_CROSSING_WIDTH
default width of pedetrian crossings
Definition: NBNode.h:187
std::deque< int > * spread(const std::vector< int > &approachingLanes, int dest) const
Definition: NBNode.cpp:158
EdgeVector edges
The edges being crossed.
Definition: NBNode.h:140
bool crossingBetween(const NBEdge *e1, const NBEdge *e2) const
return true if the given edges are connected by a crossing
Definition: NBNode.cpp:2239
Represents a single node (junction) during network building.
Definition: NBNode.h:75
static const SUMOReal DEFAULT_RADIUS
the default turning radius at intersections in m
Definition: NBNode.h:190
int guessCrossings()
guess pedestrian crossings and return how many were guessed
Definition: NBNode.cpp:1597
A definition of a pedestrian crossing.
Definition: NBNode.h:133
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
Definition: NBNode.cpp:1068
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:215
Computes lane-2-lane connections.
Definition: NBNode.h:96
static const SUMOReal UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:193
bool writeLogic(OutputDevice &into, const bool checkLaneFoes) const
Definition: NBNode.cpp:711
WalkingArea(const std::string &_id, SUMOReal _width)
Definition: NBNode.h:162
void computeLogic(const NBEdgeCont &ec, OptionsCont &oc)
computes the node&#39;s type, logic and traffic light
Definition: NBNode.cpp:662
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:64
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:1277
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
Definition: NBNode.h:651
void invalidateTLS(NBTrafficLightLogicCont &tlCont)
causes the traffic light to be computed anew
Definition: NBNode.cpp:346
std::string nextWalkingArea
the lane-id of the next walkingArea
Definition: NBNode.h:150
NBNode(const std::string &id, const Position &position, SumoXMLNodeType type)
Constructor.
Definition: NBNode.cpp:231
std::vector< std::string > prevSidewalks
the lane-id of the previous sidewalk lane or &quot;&quot;
Definition: NBNode.h:180
Crossing(const NBNode *_node, const EdgeVector &_edges, SUMOReal _width, bool _priority)
Definition: NBNode.h:134
std::vector< std::string > nextSidewalks
the lane-id of the next sidewalk lane or &quot;&quot;
Definition: NBNode.h:178
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the node.
Definition: NBNode.cpp:292
void computeNodeShape(SUMOReal mismatchThreshold)
Compute the junction shape for this node.
Definition: NBNode.cpp:721
void remapRemoved(NBTrafficLightLogicCont &tc, NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Definition: NBNode.cpp:1284
void discardAllCrossings()
Definition: NBNode.h:637
PositionVector shape
The polygonal shape.
Definition: NBNode.h:174
A storage for available types of edges.
Definition: NBTypeCont.h:62
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 &quot;prohibited&quot; flow must let &quot;prohibitor&quot; flow pass.
Definition: NBNode.cpp:1267
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:1790
static std::string getNodeIDFromInternalLane(const std::string id)
returns the node id for internal lanes, crossings and walkingareas
Definition: NBNode.cpp:2393
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:359