SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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,
113  NBEdge* currentOutgoing, const bool buildCrossingsAndWalkingAreas);
114 
117 
118  unsigned int numAvailableLanes() const {
119  return (unsigned int)myAvailableLanes.size();
120  }
121 
123  void execute(const unsigned int src, const unsigned int dest);
124 
127  std::deque<int>* spread(const std::vector<int>& approachingLanes, int dest) const;
128 
129  };
130 
134  struct Crossing {
135  Crossing(const NBNode* _node, const EdgeVector& _edges, SUMOReal _width, bool _priority) :
136  node(_node), edges(_edges), width(_width), priority(_priority), tlLinkNo(-1)
137  {}
139  const NBNode* node;
147  std::string id;
149  std::string prevWalkingArea;
151  std::string nextWalkingArea;
153  bool priority;
155  int tlLinkNo;
156  };
157 
158 
162  struct WalkingArea {
163  WalkingArea(const std::string& _id, SUMOReal _width) :
164  id(_id),
165  width(_width),
166  nextCrossing(""),
167  tlID("")
168  {}
170  std::string id;
178  std::string nextCrossing;
180  std::string tlID;
182  std::vector<std::string> nextSidewalks;
184  std::vector<std::string> prevSidewalks;
185  };
186 
188  static const int FORWARD;
189  static const int BACKWARD;
192 
194  static const SUMOReal DEFAULT_RADIUS;
195 
198 
199 public:
201  static const int MAX_CONNECTIONS;
202 
208  NBNode(const std::string& id, const Position& position, SumoXMLNodeType type);
209 
210 
216  NBNode(const std::string& id, const Position& position, NBDistrict* district = 0);
217 
218 
220  ~NBNode();
221 
222 
229  void reinit(const Position& position, SumoXMLNodeType type,
230  bool updateEdgeGeometries = false);
231 
232 
235 
239  const Position& getPosition() const {
240  return myPosition;
241  }
242 
243 
245  Position getCenter() const;
246 
247 
251  const EdgeVector& getIncomingEdges() const {
252  return myIncomingEdges;
253  }
254 
255 
259  const EdgeVector& getOutgoingEdges() const {
260  return myOutgoingEdges;
261  }
262 
263 
267  const EdgeVector& getEdges() const {
268  return myAllEdges;
269  }
270 
271 
277  return myType;
278  }
279 
283  SUMOReal getRadius() const {
284  return myRadius;
285  }
287 
288 
289 
292 
297 
300 
303  void removeTrafficLights();
304 
305 
309  bool isTLControlled() const {
310  return myTrafficLights.size() != 0;
311  }
312 
313 
317  bool isJoinedTLSControlled() const;
318 
319 
323  const std::set<NBTrafficLightDefinition*>& getControllingTLS() const {
324  return myTrafficLights;
325  }
326 
327 
330 
332  void shiftTLConnectionLaneIndex(NBEdge* edge, int offset);
334 
335 
336 
339 
351 
352 
353 
356 
361  void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
363 
364 
365 
367  void addIncomingEdge(NBEdge* edge);
368 
370  void addOutgoingEdge(NBEdge* edge);
371 
372 
373 
374 
376  void computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas);
377 
379  void computeLogic(const NBEdgeCont& ec, OptionsCont& oc);
380 
383  bool writeLogic(OutputDevice& into, const bool checkLaneFoes) const;
384 
387  Position getEmptyDir() const;
388 
389 
394  bool hasIncoming(const NBEdge* const e) const;
395 
396 
401  bool hasOutgoing(const NBEdge* const e) const;
402 
403 
404  NBEdge* getOppositeIncoming(NBEdge* e) const;
407 
408  void removeDoubleEdges();
409  NBEdge* getConnectionTo(NBNode* n) const;
410 
411 
412  void addSortedLinkFoes(const NBConnection& mayDrive,
413  const NBConnection& mustStop);
414 
415  NBEdge* getPossiblySplittedIncoming(const std::string& edgeid);
416  NBEdge* getPossiblySplittedOutgoing(const std::string& edgeid);
417 
420  void removeEdge(NBEdge* edge, bool removeFromConnections = true);
421 
431  bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const;
432 
433 
441  bool mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane, bool includePedCrossings) const;
442 
449  bool mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const Crossing& crossing) const;
450 
453  bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
454  const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const;
455 
464  bool forbids(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo,
465  const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo,
466  bool regardNonSignalisedLowerPriority) const;
467 
468 
476  bool foes(const NBEdge* const from1, const NBEdge* const to1,
477  const NBEdge* const from2, const NBEdge* const to2) const;
478 
479 
485  LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing) const;
486 
487  LinkState getLinkState(const NBEdge* incoming, NBEdge* outgoing,
488  int fromLane, bool mayDefinitelyPass, const std::string& tlID) const;
489 
494  void computeNodeShape(bool leftHand, SUMOReal mismatchThreshold);
495 
497  const PositionVector& getShape() const;
498 
500  void setCustomShape(const PositionVector& shape);
501 
503  void setCustomLaneShape(const std::string& laneID, const PositionVector& shape);
504 
506  const CustomShapeMap& getCustomLaneShapes() const {
507  return myCustomLaneShapes;
508  }
509 
511  void setRadius(SUMOReal radius) {
512  myRadius = radius;
513  }
514 
516  bool hasCustomShape() const {
517  return myHaveCustomPoly;
518  }
519 
520  bool checkIsRemovable() const;
521 
522 
523  std::vector<std::pair<NBEdge*, NBEdge*> > getEdgesToJoin() const;
524 
525 
526  friend class NBNodeShapeComputer;
527 
528  bool isNearDistrict() const;
529  bool isDistrict() const;
530 
532  bool needsCont(const NBEdge* fromE, const NBEdge* otherFromE,
533  const NBEdge::Connection& c, const NBEdge::Connection& otherC) const;
534 
541  PositionVector computeInternalLaneShape(NBEdge* fromE, const NBEdge::Connection& con, int numPoints = 5) const;
542 
543 
554  const PositionVector& begShape,
555  const PositionVector& endShape,
556  int numPoints,
557  bool isTurnaround,
558  SUMOReal extrapolateBeg,
559  SUMOReal extrapolateEnd) const;
560 
561 
564  void replaceIncoming(NBEdge* which, NBEdge* by, unsigned int laneOff);
565 
568  void replaceIncoming(const EdgeVector& which, NBEdge* by);
569 
572  void replaceOutgoing(NBEdge* which, NBEdge* by, unsigned int laneOff);
573 
576  void replaceOutgoing(const EdgeVector& which, NBEdge* by);
577 
579  int guessCrossings();
580 
581  /* @brief check whether a crossing should be build for the candiate edges and build 0 to n crossings
582  * @param[in] candidates The candidate vector of edges to be crossed
583  * @return The number of crossings built
584  * */
585  int checkCrossing(EdgeVector candidates);
586 
588  void buildInnerEdges(bool buildCrossingsAndWalkingAreas);
589 
590  /* @brief build pedestrian crossings
591  * @return The next index for creating internal lanes
592  * */
593  unsigned int buildCrossings();
594 
595  /* @brief build pedestrian walking areas and set connections from/to walkingAreas
596  * @param[in] cornerDetail The detail level when generating the inner curve
597  * */
598  void buildWalkingAreas(int cornerDetail);
599 
601  EdgeVector edgesBetween(const NBEdge* e1, const NBEdge* e2) const;
602 
604  bool crossingBetween(const NBEdge* e1, const NBEdge* e2) const;
605 
607  return myBlockedConnections;
608  }
609 
612  bool geometryLike() const;
613 
615  void setRoundabout();
616 
618  void addCrossing(EdgeVector edges, SUMOReal width, bool priority);
619 
621  void removeCrossing(const EdgeVector& edges);
622 
624  inline const std::vector<Crossing>& getCrossings() const {
625  return myCrossings;
626  }
627 
629  inline const std::vector<WalkingArea>& getWalkingAreas() const {
630  return myWalkingAreas;
631  }
632 
634  const Crossing& getCrossing(const std::string& id) const;
635 
637  void setCrossingTLIndices(unsigned int startIndex);
638 
640  int numNormalConnections() const;
641 
644  void avoidOverlap();
645 
646 
652  public:
654  explicit nodes_by_id_sorter() { }
655 
658  int operator()(NBNode* n1, NBNode* n2) const {
659  return n1->getID() < n2->getID();
660  }
661 
662  };
663 
664 
669  public:
671  int operator()(NBEdge* e1, NBEdge* e2) const {
672  UNUSED_PARAMETER(e2);
673  return e1->getFromNode() == myNode;
674  }
675 
676  private:
679 
680  };
681 
683  static std::string getNodeIDFromInternalLane(const std::string id);
684 
685 private:
686  bool isSimpleContinuation() const;
687 
690 
693  EdgeVector* getEdgesThatApproach(NBEdge* currentOutgoing);
694 
695 
696 
697 
699  unsigned int whichLaneOff, unsigned int byLaneOff);
700 
701 
703  NBEdge* removed, const EdgeVector& incoming, const EdgeVector& outgoing);
704 
705 
707  bool forbidsPedestriansAfter(std::vector<std::pair<NBEdge*, bool> > normalizedLanes, int startIndex);
708 
709 
712 
713 private:
716 
719 
722 
725 
727  std::vector<Crossing> myCrossings;
728 
730  std::vector<WalkingArea> myWalkingAreas;
731 
734 
737 
740 
743 
746 
748 
749  std::set<NBTrafficLightDefinition*> myTrafficLights;
750 
753 
754  CustomShapeMap myCustomLaneShapes;
755 
756 private:
758  NBNode(const NBNode& s);
759 
761  NBNode& operator=(const NBNode& s);
762 
763 
764 };
765 
766 
767 #endif
768 
769 /****************************************************************************/
770 
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:917
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
Definition: NBNode.h:251
Position getEmptyDir() const
Returns something like the most unused direction Should only be used to add source or sink nodes...
Definition: NBNode.cpp:1123
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:2190
std::vector< Crossing > myCrossings
Vector of crossings.
Definition: NBNode.h:727
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
Definition: NBNode.cpp:2242
SUMOReal width
This lane's width.
Definition: NBNode.h:145
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset)
patches loaded signal plans by modifying lane indices
Definition: NBNode.cpp:355
SUMOReal getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:283
std::string id
the (edge)-id of this crossing
Definition: NBNode.h:147
bool isDistrict() const
Definition: NBNode.cpp:1526
PositionVector myPoly
the (outer) shape of the junction
Definition: NBNode.h:742
NBEdge * getOppositeIncoming(NBEdge *e) const
Definition: NBNode.cpp:1036
const NBConnectionProhibits & getProhibitions()
Definition: NBNode.h:606
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:752
SumoXMLNodeType myType
The type of the junction.
Definition: NBNode.h:733
A container for traffic light definitions and built programs.
SUMOReal length
This lane's width.
Definition: NBNode.h:174
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
Definition: NBNode.cpp:261
SUMOReal width
This lane's width.
Definition: NBNode.h:172
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:309
~NBNode()
Destructor.
Definition: NBNode.cpp:255
This class computes shapes of junctions.
const Crossing & getCrossing(const std::string &id) const
return the crossing with the given id
Definition: NBNode.cpp:2218
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
Definition: NBNode.cpp:1097
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
Definition: NBNode.cpp:406
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:2237
ApproachingDivider(EdgeVector *approaching, NBEdge *currentOutgoing, const bool buildCrossingsAndWalkingAreas)
Constructor.
Definition: NBNode.cpp:99
void addCrossing(EdgeVector edges, SUMOReal width, bool priority)
add a pedestrian crossing to this node
Definition: NBNode.cpp:2198
Used for sorting the cells by the begin time they describe.
Definition: NBNode.h:651
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
Definition: NBNode.cpp:1030
A container for districts.
const std::vector< Crossing > & getCrossings() const
return this junctions pedestrian crossings
Definition: NBNode.h:624
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:2149
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:1167
bool isJoinedTLSControlled() const
Returns whether this node is controlled by a tls that spans over more than one node.
Definition: NBNode.cpp:320
void removeDoubleEdges()
Definition: NBNode.cpp:985
PositionVector shape
The lane's shape.
Definition: NBNode.h:143
edge_by_direction_sorter(NBNode *n)
Definition: NBNode.h:670
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:516
void buildWalkingAreas(int cornerDetail)
Definition: NBNode.cpp:1816
static const int MAX_CONNECTIONS
maximum number of connections allowed
Definition: NBNode.h:201
friend class GNEJunction
Definition: NBNode.h:77
std::string id
the (edge)-id of this walkingArea
Definition: NBNode.h:170
EdgeVector getEdgesSortedByAngleAtNodeCenter() const
returns the list of all edges sorted clockwise by getAngleAtNodeToCenter
Definition: NBNode.cpp:2260
bool checkIsRemovable() const
Definition: NBNode.cpp:1380
void computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas)
computes the connections of lanes to edges
Definition: NBNode.cpp:743
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
Definition: NBNode.cpp:304
void setCustomShape(const PositionVector &shape)
set the junction shape
Definition: NBNode.cpp:1467
NBConnectionProhibits myBlockedConnections
Definition: NBNode.h:736
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
Definition: NBNode.cpp:1024
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
Definition: NBNode.cpp:416
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
unsigned int numAvailableLanes() const
Definition: NBNode.h:118
bool priority
whether the pedestrians have priority
Definition: NBNode.h:153
NBRequest * myRequest
Definition: NBNode.h:747
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
CustomShapeMap myCustomLaneShapes
Definition: NBNode.h:754
NBDistrict * myDistrict
The district the node is the centre of.
Definition: NBNode.h:739
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:571
std::map< std::string, PositionVector > CustomShapeMap
Definition: NBNode.h:83
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
Definition: NBNode.h:259
const std::string & getID() const
Returns the id.
Definition: Named.h:60
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
Definition: NBNode.h:724
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:612
void invalidateIncomingConnections()
Definition: NBNode.cpp:1151
void removeCrossing(const EdgeVector &edges)
remove a pedestrian crossing from this node (identified by its edges)
Definition: NBNode.cpp:2204
void setPriorityJunctionPriorities()
sets the priorites in case of a priority junction
const Position & getPosition() const
Returns the position of this node.
Definition: NBNode.h:239
std::string prevWalkingArea
the lane-id of the previous walkingArea
Definition: NBNode.h:149
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
Definition: NBNode.cpp:1071
void computeNodeShape(bool leftHand, SUMOReal mismatchThreshold)
Compute the junction shape for this node.
Definition: NBNode.cpp:711
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node.
Definition: NBNode.h:323
bool isSimpleContinuation() const
Definition: NBNode.cpp:426
int checkCrossing(EdgeVector candidates)
Definition: NBNode.cpp:1604
static const int FORWARD
edge directions (for pedestrian related stuff)
Definition: NBNode.h:188
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:658
void setRadius(SUMOReal radius)
set the turning radius
Definition: NBNode.h:511
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:1181
A list of positions.
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:276
bool geometryLike() const
whether this is structurally similar to a geometry node
Definition: NBNode.cpp:2165
void invalidateOutgoingConnections()
Definition: NBNode.cpp:1159
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:311
EdgeVector * getEdgesThatApproach(NBEdge *currentOutgoing)
Definition: NBNode.cpp:858
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
Definition: NBNode.h:267
std::set< NBTrafficLightDefinition * > myTrafficLights
Definition: NBNode.h:749
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:1474
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:455
std::string nextCrossing
the lane-id of the next crossing
Definition: NBNode.h:178
void setCrossingTLIndices(unsigned int startIndex)
set tl indices of this nodes crossing starting at the given index
Definition: NBNode.cpp:2229
const CustomShapeMap & getCustomLaneShapes() const
sets a custom shape for an internal lane
Definition: NBNode.h:506
NBNode * myNode
The node to compute the relative angle of.
Definition: NBNode.h:678
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1461
NBEdge * getConnectionTo(NBNode *n) const
Definition: NBNode.cpp:1484
EdgeVector myIncomingEdges
Vector of incoming edges.
Definition: NBNode.h:718
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:1194
Base class for objects which have an id.
Definition: Named.h:45
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
Definition: NBNode.cpp:1437
int operator()(NBEdge *e1, NBEdge *e2) const
Definition: NBNode.h:671
void avoidOverlap()
fix overlap
Definition: NBNode.cpp:2303
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
Definition: NBNode.cpp:1084
unsigned int removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes edges which are both incoming and outgoing into this node.
Definition: NBNode.cpp:363
EdgeVector myOutgoingEdges
Vector of outgoing edges.
Definition: NBNode.h:721
NBEdge * myCurrentOutgoing
The approached current edge.
Definition: NBNode.h:102
bool rightTurnConflict(const NBEdge *from, const NBEdge *to, int fromLane, const NBEdge *prohibitorFrom, const NBEdge *prohibitorTo, int prohibitorFromLane) const
return whether the given laneToLane connection is a right turn which must yield to a bicycle crossing...
Definition: NBNode.cpp:1187
static const int BACKWARD
Definition: NBNode.h:189
nodes_by_id_sorter()
Constructor.
Definition: NBNode.h:654
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
Definition: NBNode.cpp:295
bool isNearDistrict() const
Definition: NBNode.cpp:1495
bool myHaveCustomPoly
whether this nodes shape was set by the user
Definition: NBNode.h:745
Position myPosition
The position the node lies at.
Definition: NBNode.h:715
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:881
~ApproachingDivider()
Destructor.
Definition: NBNode.cpp:129
std::vector< WalkingArea > myWalkingAreas
Vector of walking areas.
Definition: NBNode.h:730
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, bool mayDefinitelyPass, const std::string &tlID) const
Definition: NBNode.cpp:1357
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
unsigned int buildCrossings()
Definition: NBNode.cpp:1749
Sorts outgoing before incoming edges.
Definition: NBNode.h:668
int tlLinkNo
the traffic light index of this crossing (if controlled)
Definition: NBNode.h:155
void replaceInConnectionProhibitions(NBEdge *which, NBEdge *by, unsigned int whichLaneOff, unsigned int byLaneOff)
Definition: NBNode.cpp:950
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:41
std::string tlID
the traffic light id of the next crossing or ""
Definition: NBNode.h:180
NBNode & operator=(const NBNode &s)
invalidated assignment operator
A definition of a pedestrian walking area.
Definition: NBNode.h:162
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:139
static const SUMOReal DEFAULT_CROSSING_WIDTH
default width of pedetrian crossings
Definition: NBNode.h:191
std::deque< int > * spread(const std::vector< int > &approachingLanes, int dest) const
Definition: NBNode.cpp:159
EdgeVector edges
The edges being crossed.
Definition: NBNode.h:141
bool crossingBetween(const NBEdge *e1, const NBEdge *e2) const
return true if the given edges are connected by a crossing
Definition: NBNode.cpp:2132
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:194
int guessCrossings()
guess pedestrian crossings and return how many were guessed
Definition: NBNode.cpp:1532
A definition of a pedestrian crossing.
Definition: NBNode.h:134
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
Definition: NBNode.cpp:1054
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:218
Computes lane-2-lane connections.
Definition: NBNode.h:96
static const SUMOReal UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:197
bool writeLogic(OutputDevice &into, const bool checkLaneFoes) const
Definition: NBNode.cpp:701
WalkingArea(const std::string &_id, SUMOReal _width)
Definition: NBNode.h:163
void computeLogic(const NBEdgeCont &ec, OptionsCont &oc)
computes the node's type, logic and traffic light
Definition: NBNode.cpp:657
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:1223
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
Definition: NBNode.h:629
void buildInnerEdges(bool buildCrossingsAndWalkingAreas)
build internal lanes, pedestrian crossings and walking areas
Definition: NBNode.cpp:1706
void invalidateTLS(NBTrafficLightLogicCont &tlCont)
causes the traffic light to be computed anew
Definition: NBNode.cpp:334
std::string nextWalkingArea
the lane-id of the next walkingArea
Definition: NBNode.h:151
NBNode(const std::string &id, const Position &position, SumoXMLNodeType type)
Constructor.
Definition: NBNode.cpp:232
std::vector< std::string > prevSidewalks
the lane-id of the previous sidewalk lane or ""
Definition: NBNode.h:184
Crossing(const NBNode *_node, const EdgeVector &_edges, SUMOReal _width, bool _priority)
Definition: NBNode.h:135
std::vector< std::string > nextSidewalks
the lane-id of the next sidewalk lane or ""
Definition: NBNode.h:182
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the node.
Definition: NBNode.cpp:287
void remapRemoved(NBTrafficLightLogicCont &tc, NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Definition: NBNode.cpp:1230
PositionVector shape
The polygonal shape.
Definition: NBNode.h:176
A storage for available types of edges.
Definition: NBTypeCont.h:56
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:1213
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:1695
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing) const
Returns the representation of the described stream's direction.
Definition: NBNode.cpp:1311
static std::string getNodeIDFromInternalLane(const std::string id)
returns the node id for internal lanes, crossings and walkingareas
Definition: NBNode.cpp:2283
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:363