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-2016 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>
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 {
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 
81 public:
82  typedef std::map<std::string, PositionVector> CustomShapeMap;
83 
96  private:
99 
102 
104  std::vector<int> myAvailableLanes;
105 
106  public:
111  ApproachingDivider(EdgeVector* approaching, NBEdge* currentOutgoing);
112 
115 
116  int numAvailableLanes() const {
117  return (int)myAvailableLanes.size();
118  }
119 
121  void execute(const int src, const int dest);
122 
125  std::deque<int>* spread(const std::vector<int>& approachingLanes, int dest) const;
126 
127  };
128 
132  struct Crossing {
133  Crossing(const NBNode* _node, const EdgeVector& _edges, SUMOReal _width, bool _priority) :
134  node(_node), edges(_edges), width(_width), priority(_priority), tlLinkNo(-1) {
135  }
137  const NBNode* node;
145  std::string id;
147  std::string prevWalkingArea;
149  std::string nextWalkingArea;
151  bool priority;
153  int tlLinkNo;
154  };
155 
156 
160  struct WalkingArea {
161  WalkingArea(const std::string& _id, SUMOReal _width) :
162  id(_id),
163  width(_width),
164  nextCrossing("") {
165  }
167  std::string id;
175  std::string nextCrossing;
177  std::vector<std::string> nextSidewalks;
179  std::vector<std::string> prevSidewalks;
180  };
181 
183  static const int FORWARD;
184  static const int BACKWARD;
187 
190 
191 public:
197  NBNode(const std::string& id, const Position& position, SumoXMLNodeType type);
198 
199 
205  NBNode(const std::string& id, const Position& position, NBDistrict* district = 0);
206 
207 
209  ~NBNode();
210 
211 
218  void reinit(const Position& position, SumoXMLNodeType type,
219  bool updateEdgeGeometries = false);
220 
221 
224 
228  const Position& getPosition() const {
229  return myPosition;
230  }
231 
232 
234  Position getCenter() const;
235 
236 
240  const EdgeVector& getIncomingEdges() const {
241  return myIncomingEdges;
242  }
243 
244 
248  const EdgeVector& getOutgoingEdges() const {
249  return myOutgoingEdges;
250  }
251 
252 
256  const EdgeVector& getEdges() const {
257  return myAllEdges;
258  }
259 
260 
266  return myType;
267  }
268 
272  SUMOReal getRadius() const {
273  return myRadius;
274  }
275 
278  bool getKeepClear() const {
279  return myKeepClear;
280  }
282 
283 
284 
287 
292 
295 
298  void removeTrafficLights();
299 
300 
304  bool isTLControlled() const {
305  return myTrafficLights.size() != 0;
306  }
307 
308 
312  bool isJoinedTLSControlled() const;
313 
314 
318  const std::set<NBTrafficLightDefinition*>& getControllingTLS() const {
319  return myTrafficLights;
320  }
321 
322 
325 
327  void shiftTLConnectionLaneIndex(NBEdge* edge, int offset);
329 
330 
331 
334 
346 
347 
348 
351 
356  void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
357 
359  void mirrorX();
361 
362 
363 
365  void addIncomingEdge(NBEdge* edge);
366 
368  void addOutgoingEdge(NBEdge* edge);
369 
370 
371 
372 
374  void computeLanes2Lanes();
375 
377  void computeLogic(const NBEdgeCont& ec, OptionsCont& oc);
378 
381  bool writeLogic(OutputDevice& into, const bool checkLaneFoes) const;
382 
385  Position getEmptyDir() const;
386 
387 
392  bool hasIncoming(const NBEdge* const e) const;
393 
394 
399  bool hasOutgoing(const NBEdge* const e) const;
400 
401 
402  NBEdge* getOppositeIncoming(NBEdge* e) const;
405 
406  void removeDoubleEdges();
407  NBEdge* getConnectionTo(NBNode* n) const;
408 
409 
410  void addSortedLinkFoes(const NBConnection& mayDrive,
411  const NBConnection& mustStop);
412 
413  NBEdge* getPossiblySplittedIncoming(const std::string& edgeid);
414  NBEdge* getPossiblySplittedOutgoing(const std::string& edgeid);
415 
418  void removeEdge(NBEdge* edge, bool removeFromConnections = true);
419 
429  bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const;
430 
431 
440  bool mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane, int toLane, bool includePedCrossings) const;
441 
448  bool mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const Crossing& crossing) const;
449 
452  static bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
453  const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane, bool lefthand = false);
454 
463  bool forbids(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo,
464  const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo,
465  bool regardNonSignalisedLowerPriority) const;
466 
467 
475  bool foes(const NBEdge* const from1, const NBEdge* const to1,
476  const NBEdge* const from2, const NBEdge* const to2) const;
477 
478 
485  LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing, bool leftHand = false) const;
486 
487  LinkState getLinkState(const NBEdge* incoming, NBEdge* outgoing,
488  int fromLane, int toLane, bool mayDefinitelyPass, const std::string& tlID) const;
489 
493  void computeNodeShape(SUMOReal mismatchThreshold);
494 
496  const PositionVector& getShape() const;
497 
499  void setCustomShape(const PositionVector& shape);
500 
502  void setCustomLaneShape(const std::string& laneID, const PositionVector& shape);
503 
505  const CustomShapeMap& getCustomLaneShapes() const {
506  return myCustomLaneShapes;
507  }
508 
510  void setRadius(SUMOReal radius) {
511  myRadius = radius;
512  }
513 
515  void setKeepClear(bool keepClear) {
516  myKeepClear = keepClear;
517  }
518 
520  bool hasCustomShape() const {
521  return myHaveCustomPoly;
522  }
523 
524  bool checkIsRemovable() const;
525 
526 
527  std::vector<std::pair<NBEdge*, NBEdge*> > getEdgesToJoin() const;
528 
529 
530  friend class NBNodeShapeComputer;
531 
532  bool isNearDistrict() const;
533  bool isDistrict() const;
534 
536  bool needsCont(const NBEdge* fromE, const NBEdge* otherFromE,
537  const NBEdge::Connection& c, const NBEdge::Connection& otherC) const;
538 
546  PositionVector computeInternalLaneShape(NBEdge* fromE, const NBEdge::Connection& con, int numPoints, NBNode* recordError = 0) const;
547 
548 
560  const PositionVector& begShape,
561  const PositionVector& endShape,
562  int numPoints,
563  bool isTurnaround,
564  SUMOReal extrapolateBeg,
565  SUMOReal extrapolateEnd,
566  NBNode* recordError = 0) const;
567 
569  const PositionVector& begShape,
570  const PositionVector& endShape,
571  bool isTurnaround,
572  SUMOReal extrapolateBeg,
573  SUMOReal extrapolateEnd,
574  bool& ok,
575  NBNode* recordError = 0);
576 
577 
580  return myDisplacementError;
581  }
582 
585  void replaceIncoming(NBEdge* which, NBEdge* by, int laneOff);
586 
589  void replaceIncoming(const EdgeVector& which, NBEdge* by);
590 
593  void replaceOutgoing(NBEdge* which, NBEdge* by, int laneOff);
594 
597  void replaceOutgoing(const EdgeVector& which, NBEdge* by);
598 
600  int guessCrossings();
601 
602  /* @brief check whether a crossing should be build for the candiate edges and build 0 to n crossings
603  * @param[in] candidates The candidate vector of edges to be crossed
604  * @return The number of crossings built
605  * */
606  int checkCrossing(EdgeVector candidates);
607 
609  void buildInnerEdges();
610 
611  /* @brief build pedestrian crossings
612  * @return The next index for creating internal lanes
613  * */
614  int buildCrossings();
615 
616  /* @brief build pedestrian walking areas and set connections from/to walkingAreas
617  * @param[in] cornerDetail The detail level when generating the inner curve
618  * */
619  void buildWalkingAreas(int cornerDetail);
620 
621  /* @brief build crossings, and walkingareas. Also removes invalid loaded
622  * crossings*/
624 
626  EdgeVector edgesBetween(const NBEdge* e1, const NBEdge* e2) const;
627 
629  bool crossingBetween(const NBEdge* e1, const NBEdge* e2) const;
630 
632  return myBlockedConnections;
633  }
634 
637  bool geometryLike() const;
638 
640  void setRoundabout();
641 
643  void addCrossing(EdgeVector edges, SUMOReal width, bool priority, bool fromSumoNet = false);
644 
646  void removeCrossing(const EdgeVector& edges);
647 
649  myDiscardAllCrossings = true;
650  }
651 
654  }
655 
657  inline const std::vector<Crossing>& getCrossings() const {
658  return myCrossings;
659  }
660 
662  inline const std::vector<WalkingArea>& getWalkingAreas() const {
663  return myWalkingAreas;
664  }
665 
667  const Crossing& getCrossing(const std::string& id) const;
668 
670  void setCrossingTLIndices(int startIndex);
671 
673  int numNormalConnections() const;
674 
677  void avoidOverlap();
678 
680  bool rightOnRedConflict(int index, int foeIndex) const;
681 
687  public:
689  explicit nodes_by_id_sorter() { }
690 
693  int operator()(NBNode* n1, NBNode* n2) const {
694  return n1->getID() < n2->getID();
695  }
696 
697  };
698 
699 
704  public:
706  int operator()(NBEdge* e1, NBEdge* e2) const {
707  UNUSED_PARAMETER(e2);
708  return e1->getFromNode() == myNode;
709  }
710 
711  private:
714 
715  };
716 
718  static std::string getNodeIDFromInternalLane(const std::string id);
719 
720 
722  static bool isTrafficLight(SumoXMLNodeType type);
723 
724  bool isSimpleContinuation(bool checkLaneNumbers = true) const;
725 
726 
727 private:
730 
733  EdgeVector* getEdgesThatApproach(NBEdge* currentOutgoing);
734 
735 
736 
737 
739  int whichLaneOff, int byLaneOff);
740 
741 
743  NBEdge* removed, const EdgeVector& incoming, const EdgeVector& outgoing);
744 
745 
747  bool forbidsPedestriansAfter(std::vector<std::pair<NBEdge*, bool> > normalizedLanes, int startIndex);
748 
749 
752 
753  static bool isLongEnough(NBEdge* out, SUMOReal minLength);
754 
755 private:
758 
761 
764 
767 
769  std::vector<Crossing> myCrossings;
770 
772  std::vector<WalkingArea> myWalkingAreas;
773 
776 
779 
782 
785 
788 
790 
791  std::set<NBTrafficLightDefinition*> myTrafficLights;
792 
795 
798 
799  CustomShapeMap myCustomLaneShapes;
800 
803 
806 
809 
810 private:
812  NBNode(const NBNode& s);
813 
815  NBNode& operator=(const NBNode& s);
816 
817 
818 };
819 
820 
821 #endif
822 
823 /****************************************************************************/
824 
SUMOReal getDisplacementError() const
compute the displacement error during s-curve computation
Definition: NBNode.h:579
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
Definition: NBNode.h:240
Position getEmptyDir() const
Returns something like the most unused direction Should only be used to add source or sink nodes...
Definition: NBNode.cpp:1327
bool getKeepClear() const
Returns the keepClear flag.
Definition: NBNode.h:278
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:157
int numAvailableLanes() const
Definition: NBNode.h:116
void setRoundabout()
update the type of this node as a roundabout
Definition: NBNode.cpp:2523
std::vector< Crossing > myCrossings
Vector of crossings.
Definition: NBNode.h:769
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
Definition: NBNode.cpp:2578
SUMOReal width
This lane's width.
Definition: NBNode.h:143
ApproachingDivider(EdgeVector *approaching, NBEdge *currentOutgoing)
Constructor.
Definition: NBNode.cpp:98
int buildCrossings()
Definition: NBNode.cpp:2050
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset)
patches loaded signal plans by modifying lane indices
Definition: NBNode.cpp:375
SUMOReal getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:272
std::string id
the (edge)-id of this crossing
Definition: NBNode.h:145
bool isDistrict() const
Definition: NBNode.cpp:1787
PositionVector myPoly
the (outer) shape of the junction
Definition: NBNode.h:784
void execute(const int src, const int dest)
Definition: NBNode.cpp:132
NBEdge * getOppositeIncoming(NBEdge *e) const
Definition: NBNode.cpp:1236
const NBConnectionProhibits & getProhibitions()
Definition: NBNode.h:631
SUMOReal myRadius
the turning radius (for all corners) at this node in m.
Definition: NBNode.h:794
SumoXMLNodeType myType
The type of the junction.
Definition: NBNode.h:775
A container for traffic light definitions and built programs.
SUMOReal length
This lane's width.
Definition: NBNode.h:171
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
Definition: NBNode.cpp:266
SUMOReal width
This lane's width.
Definition: NBNode.h:169
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:304
~NBNode()
Destructor.
Definition: NBNode.cpp:260
int myCrossingsLoadedFromSumoNet
number of crossings loaded from a sumo net
Definition: NBNode.h:805
This class computes shapes of junctions.
const Crossing & getCrossing(const std::string &id) const
return the crossing with the given id
Definition: NBNode.cpp:2554
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
Definition: NBNode.cpp:1297
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
Definition: NBNode.cpp:426
The representation of a single edge during network building.
Definition: NBEdge.h:71
void setCrossingTLIndices(int startIndex)
set tl indices of this nodes crossing starting at the given index
Definition: NBNode.cpp:2565
int numNormalConnections() const
return the number of lane-to-lane connections at this junction (excluding crossings) ...
Definition: NBNode.cpp:2573
Used for sorting the cells by the begin time they describe.
Definition: NBNode.h:686
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
Definition: NBNode.cpp:1230
A container for districts.
const std::vector< Crossing > & getCrossings() const
return this junctions pedestrian crossings
Definition: NBNode.h:657
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:2482
bool isJoinedTLSControlled() const
Returns whether this node is controlled by a tls that spans over more than one node.
Definition: NBNode.cpp:340
PositionVector computeInternalLaneShape(NBEdge *fromE, const NBEdge::Connection &con, int numPoints, NBNode *recordError=0) const
Compute the shape for an internal lane.
Definition: NBNode.cpp:640
void removeDoubleEdges()
Definition: NBNode.cpp:1186
PositionVector shape
The lane's shape.
Definition: NBNode.h:141
edge_by_direction_sorter(NBNode *n)
Definition: NBNode.h:705
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:520
void buildWalkingAreas(int cornerDetail)
Definition: NBNode.cpp:2132
std::string id
the (edge)-id of this walkingArea
Definition: NBNode.h:167
EdgeVector getEdgesSortedByAngleAtNodeCenter() const
returns the list of all edges sorted clockwise by getAngleAtNodeToCenter
Definition: NBNode.cpp:2596
bool checkIsRemovable() const
Definition: NBNode.cpp:1648
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:324
void setCustomShape(const PositionVector &shape)
set the junction shape
Definition: NBNode.cpp:1728
NBConnectionProhibits myBlockedConnections
Definition: NBNode.h:778
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
Definition: NBNode.cpp:1224
int numCrossingsFromSumoNet() const
Definition: NBNode.h:652
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
Definition: NBNode.cpp:436
#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:1082
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:1391
bool priority
whether the pedestrians have priority
Definition: NBNode.h:151
NBRequest * myRequest
Definition: NBNode.h:789
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
CustomShapeMap myCustomLaneShapes
Definition: NBNode.h:799
NBDistrict * myDistrict
The district the node is the centre of.
Definition: NBNode.h:781
A class representing a single district.
Definition: NBDistrict.h:72
std::map< std::string, PositionVector > CustomShapeMap
Definition: NBNode.h:82
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
Definition: NBNode.h:248
const std::string & getID() const
Returns the id.
Definition: Named.h:66
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
Definition: NBNode.h:766
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:681
void computeLanes2Lanes()
computes the connections of lanes to edges
Definition: NBNode.cpp:822
void invalidateIncomingConnections()
Definition: NBNode.cpp:1355
SUMOReal myDisplacementError
geometry error after computation of internal lane shapes
Definition: NBNode.h:808
void removeCrossing(const EdgeVector &edges)
remove a pedestrian crossing from this node (identified by its edges)
Definition: NBNode.cpp:2540
void setPriorityJunctionPriorities()
sets the priorites in case of a priority junction
const Position & getPosition() const
Returns the position of this node.
Definition: NBNode.h:228
std::string prevWalkingArea
the lane-id of the previous walkingArea
Definition: NBNode.h:147
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
Definition: NBNode.cpp:1271
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node.
Definition: NBNode.h:318
int checkCrossing(EdgeVector candidates)
Definition: NBNode.cpp:1895
static const int FORWARD
edge directions (for pedestrian related stuff)
Definition: NBNode.h:183
int operator()(NBNode *n1, NBNode *n2) const
Comparing operator.
Definition: NBNode.h:693
void setRadius(SUMOReal radius)
set the turning radius
Definition: NBNode.h:510
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:1385
A list of positions.
void buildCrossingsAndWalkingAreas()
Definition: NBNode.cpp:1997
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:265
bool geometryLike() const
whether this is structurally similar to a geometry node
Definition: NBNode.cpp:2498
void invalidateOutgoingConnections()
Definition: NBNode.cpp:1363
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:331
EdgeVector * getEdgesThatApproach(NBEdge *currentOutgoing)
Definition: NBNode.cpp:1059
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
Definition: NBNode.h:256
std::set< NBTrafficLightDefinition * > myTrafficLights
Definition: NBNode.h:791
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:1735
std::string nextCrossing
the lane-id of the next crossing
Definition: NBNode.h:175
const CustomShapeMap & getCustomLaneShapes() const
sets a custom shape for an internal lane
Definition: NBNode.h:505
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
Definition: NBNode.cpp:1619
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:2662
bool myDiscardAllCrossings
whether to discard all pedestrian crossings
Definition: NBNode.h:802
NBNode * myNode
The node to compute the relative angle of.
Definition: NBNode.h:713
void replaceInConnectionProhibitions(NBEdge *which, NBEdge *by, int whichLaneOff, int byLaneOff)
Definition: NBNode.cpp:1151
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
Definition: NBNode.cpp:1555
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1722
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, SUMOReal extrapolateBeg, SUMOReal extrapolateEnd, bool &ok, NBNode *recordError=0)
Definition: NBNode.cpp:501
NBEdge * getConnectionTo(NBNode *n) const
Definition: NBNode.cpp:1745
EdgeVector myIncomingEdges
Vector of incoming edges.
Definition: NBNode.h:760
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:1438
void setKeepClear(bool keepClear)
set the keepClear flag
Definition: NBNode.h:515
Base class for objects which have an id.
Definition: Named.h:46
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
Definition: NBNode.cpp:1699
int operator()(NBEdge *e1, NBEdge *e2) const
Definition: NBNode.h:706
void avoidOverlap()
fix overlap
Definition: NBNode.cpp:2639
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
Definition: NBNode.cpp:1284
EdgeVector myOutgoingEdges
Vector of outgoing edges.
Definition: NBNode.h:763
NBEdge * myCurrentOutgoing
The approached current edge.
Definition: NBNode.h:101
static const int BACKWARD
Definition: NBNode.h:184
nodes_by_id_sorter()
Constructor.
Definition: NBNode.h:689
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
Definition: NBNode.cpp:314
bool isNearDistrict() const
Definition: NBNode.cpp:1756
bool myHaveCustomPoly
whether this nodes shape was set by the user
Definition: NBNode.h:787
void addCrossing(EdgeVector edges, SUMOReal width, bool priority, bool fromSumoNet=false)
add a pedestrian crossing to this node
Definition: NBNode.cpp:2531
Position myPosition
The position the node lies at.
Definition: NBNode.h:757
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:383
~ApproachingDivider()
Destructor.
Definition: NBNode.cpp:128
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, SUMOReal extrapolateBeg, SUMOReal extrapolateEnd, NBNode *recordError=0) const
Compute a smooth curve between the given geometries.
Definition: NBNode.cpp:475
std::vector< WalkingArea > myWalkingAreas
Vector of walking areas.
Definition: NBNode.h:772
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:1118
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
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:1371
bool myKeepClear
whether the junction area must be kept clear
Definition: NBNode.h:797
std::vector< int > myAvailableLanes
The available lanes to which connections shall be built.
Definition: NBNode.h:104
Sorts outgoing before incoming edges.
Definition: NBNode.h:703
int tlLinkNo
the traffic light index of this crossing (if controlled)
Definition: NBNode.h:153
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:41
void buildInnerEdges()
build internal lanes, pedestrian crossings and walking areas
Definition: NBNode.cpp:2018
NBNode & operator=(const NBNode &s)
invalidated assignment operator
A definition of a pedestrian walking area.
Definition: NBNode.h:160
EdgeVector * myApproaching
The list of edges that approach the current edge.
Definition: NBNode.h:98
A storage for options typed value containers)
Definition: OptionsCont.h:99
const NBNode * node
The parent node of this crossing.
Definition: NBNode.h:137
static const SUMOReal DEFAULT_CROSSING_WIDTH
default width of pedetrian crossings
Definition: NBNode.h:186
std::deque< int > * spread(const std::vector< int > &approachingLanes, int dest) const
Definition: NBNode.cpp:156
EdgeVector edges
The edges being crossed.
Definition: NBNode.h:139
bool crossingBetween(const NBEdge *e1, const NBEdge *e2) const
return true if the given edges are connected by a crossing
Definition: NBNode.cpp:2465
Represents a single node (junction) during network building.
Definition: NBNode.h:74
bool isSimpleContinuation(bool checkLaneNumbers=true) const
Definition: NBNode.cpp:446
int guessCrossings()
guess pedestrian crossings and return how many were guessed
Definition: NBNode.cpp:1793
A definition of a pedestrian crossing.
Definition: NBNode.h:132
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
Definition: NBNode.cpp:1254
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:214
Computes lane-2-lane connections.
Definition: NBNode.h:95
static const SUMOReal UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:189
bool writeLogic(OutputDevice &into, const bool checkLaneFoes) const
Definition: NBNode.cpp:780
WalkingArea(const std::string &_id, SUMOReal _width)
Definition: NBNode.h:161
void computeLogic(const NBEdgeCont &ec, OptionsCont &oc)
computes the node's type, logic and traffic light
Definition: NBNode.cpp:731
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
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:1467
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
Definition: NBNode.h:662
void invalidateTLS(NBTrafficLightLogicCont &tlCont)
causes the traffic light to be computed anew
Definition: NBNode.cpp:354
std::string nextWalkingArea
the lane-id of the next walkingArea
Definition: NBNode.h:149
NBNode(const std::string &id, const Position &position, SumoXMLNodeType type)
Constructor.
Definition: NBNode.cpp:229
std::vector< std::string > prevSidewalks
the lane-id of the previous sidewalk lane or ""
Definition: NBNode.h:179
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
Definition: NBNode.cpp:2654
Crossing(const NBNode *_node, const EdgeVector &_edges, SUMOReal _width, bool _priority)
Definition: NBNode.h:133
std::vector< std::string > nextSidewalks
the lane-id of the next sidewalk lane or ""
Definition: NBNode.h:177
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:790
void remapRemoved(NBTrafficLightLogicCont &tc, NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Definition: NBNode.cpp:1474
void discardAllCrossings()
Definition: NBNode.h:648
PositionVector shape
The polygonal shape.
Definition: NBNode.h:173
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 "prohibited" flow must let "prohibitor" flow pass.
Definition: NBNode.cpp:1457
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:1986
static bool isLongEnough(NBEdge *out, SUMOReal minLength)
Definition: NBNode.cpp:1043
static std::string getNodeIDFromInternalLane(const std::string id)
returns the node id for internal lanes, crossings and walkingareas
Definition: NBNode.cpp:2619
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:409