SUMO - Simulation of Urban MObility
NBAlgorithms.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Algorithms for network computation
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <sstream>
26 #include <iostream>
27 #include <cassert>
28 #include <algorithm>
30 #include <utils/common/ToString.h>
31 #include "NBEdge.h"
32 #include "NBNodeCont.h"
33 #include "NBTypeCont.h"
34 #include "NBNode.h"
35 #include "NBAlgorithms.h"
36 
37 
38 // ===========================================================================
39 // method definitions
40 // ===========================================================================
41 // ---------------------------------------------------------------------------
42 // NBTurningDirectionsComputer
43 // ---------------------------------------------------------------------------
44 void
46  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
47  computeTurnDirectionsForNode(i->second, warn);
48  }
49 }
50 
51 void
53  const std::vector<NBEdge*>& incoming = node->getIncomingEdges();
54  const std::vector<NBEdge*>& outgoing = node->getOutgoingEdges();
55  // reset turning directions since this may be called multiple times
56  for (std::vector<NBEdge*>::const_iterator k = incoming.begin(); k != incoming.end(); ++k) {
57  (*k)->setTurningDestination(0);
58  }
59  std::vector<Combination> combinations;
60  for (std::vector<NBEdge*>::const_iterator j = outgoing.begin(); j != outgoing.end(); ++j) {
61  NBEdge* outedge = *j;
62  for (std::vector<NBEdge*>::const_iterator k = incoming.begin(); k != incoming.end(); ++k) {
63  NBEdge* e = *k;
64  // @todo: check whether NBHelpers::relAngle is properly defined and whether it should really be used, here
65  const double signedAngle = NBHelpers::normRelAngle(e->getAngleAtNode(node), outedge->getAngleAtNode(node));
66  if (signedAngle > 0 && signedAngle < 177 && e->getGeometry().back().distanceTo2D(outedge->getGeometry().front()) < POSITION_EPS) {
67  // backwards curving edges can only be turnaround when there are
68  // non-default endpoints
69  continue;
70  }
71  double angle = fabs(signedAngle);
72  // std::cout << "incoming=" << e->getID() << " outgoing=" << outedge->getID() << " relAngle=" << NBHelpers::relAngle(e->getAngleAtNode(node), outedge->getAngleAtNode(node)) << "\n";
73  if (e->getFromNode() == outedge->getToNode() && angle > 120) {
74  // they connect the same nodes; should be the turnaround direction
75  // we'll assign a maximum number
76  //
77  // @todo: indeed, we have observed some pathological intersections
78  // see "294831560" in OSM/adlershof. Here, several edges are connecting
79  // same nodes. We have to do the angle check before...
80  //
81  // @todo: and well, there are some other as well, see plain import
82  // of delphi_muenchen (elmar), intersection "59534191". Not that it would
83  // be realistic in any means; we will warn, here.
84  angle += 360;
85  }
86  if (angle < 160) {
87  continue;
88  }
89  Combination c;
90  c.from = e;
91  c.to = outedge;
92  c.angle = angle;
93  combinations.push_back(c);
94  }
95  }
96  // sort combinations so that the ones with the highest angle are at the begin
97  std::sort(combinations.begin(), combinations.end(), combination_by_angle_sorter());
98  std::set<NBEdge*> seen;
99  for (std::vector<Combination>::const_iterator j = combinations.begin(); j != combinations.end(); ++j) {
100  if (seen.find((*j).from) != seen.end() || seen.find((*j).to) != seen.end()) {
101  // do not regard already set edges
102  if ((*j).angle > 360 && warn) {
103  WRITE_WARNING("Ambiguity in turnarounds computation at junction '" + node->getID() + "'.");
104  warn = false;
105  }
106  continue;
107  }
108  // mark as seen
109  seen.insert((*j).from);
110  seen.insert((*j).to);
111  // set turnaround information
112  bool onlyPossible = (*j).from->getConnections().size() != 0 && !(*j).from->isConnectedTo((*j).to);
113  //std::cout << " setTurningDestination from=" << (*j).from->getID() << " to=" << (*j).to->getID() << " onlyPossible=" << onlyPossible << "\n";
114  (*j).from->setTurningDestination((*j).to, onlyPossible);
115  }
116 }
117 
118 
119 // ---------------------------------------------------------------------------
120 // NBNodesEdgesSorter
121 // ---------------------------------------------------------------------------
122 void
124  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
125  i->second->sortEdges(useNodeShape);
126  }
127 }
128 
129 
130 void
132  const std::vector<NBEdge*>::iterator& i1,
133  const std::vector<NBEdge*>::iterator& i2) {
134  NBEdge* e1 = *i1;
135  NBEdge* e2 = *i2;
136  // @todo: The difference between "isTurningDirectionAt" and "isTurnaround"
137  // is not nice. Maybe we could get rid of it if we would always mark edges
138  // as turnarounds, even if they do not have to be added, as mentioned in
139  // notes on NBTurningDirectionsComputer::computeTurnDirectionsForNode
140  if (e2->getToNode() == n && e2->isTurningDirectionAt(e1)) {
141  std::swap(*i1, *i2);
142  }
143 }
144 
145 
146 // ---------------------------------------------------------------------------
147 // NBNodeTypeComputer
148 // ---------------------------------------------------------------------------
149 void
151  validateRailCrossings(nc);
152  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
153  NBNode* n = (*i).second;
154  // the type may already be set from the data
155  if (n->myType != NODETYPE_UNKNOWN && n->myType != NODETYPE_DEAD_END) {
156  continue;
157  }
158  // check whether the node is a waterway node. Set to unregulated by default
159  bool waterway = true;
160  for (EdgeVector::const_iterator i = n->getEdges().begin(); i != n->getEdges().end(); ++i) {
161  if (!isWaterway((*i)->getPermissions())) {
162  waterway = false;
163  break;
164  }
165  }
166  if (waterway && (n->myType == NODETYPE_UNKNOWN || n->myType == NODETYPE_DEAD_END)) {
168  continue;
169  }
170 
171  // check whether the junction is not a real junction
172  if (n->myIncomingEdges.size() == 1) {
174  continue;
175  }
176  // @todo "isSimpleContinuation" should be revalidated
177  if (n->isSimpleContinuation()) {
179  continue;
180  }
181  // determine the type
183  for (EdgeVector::const_iterator i = n->myIncomingEdges.begin(); i != n->myIncomingEdges.end(); i++) {
184  for (EdgeVector::const_iterator j = i + 1; j != n->myIncomingEdges.end(); j++) {
185  // @todo "getOppositeIncoming" should probably be refactored into something the edge knows
186  if (n->getOppositeIncoming(*j) == *i && n->myIncomingEdges.size() > 2) {
187  continue;
188  }
189  // @todo check against a legal document
190  // @todo figure out when NODETYPE_PRIORITY_STOP is appropriate
191  const double s1 = (*i)->getSpeed() * (double) 3.6;
192  const double s2 = (*j)->getSpeed() * (double) 3.6;
193  const int p1 = (*i)->getPriority();
194  const int p2 = (*j)->getPriority();
195  if (fabs(s1 - s2) > (double) 9.5 || MAX2(s1, s2) >= (double) 49. || p1 != p2) {
196  type = NODETYPE_PRIORITY;
197  break;
198  }
199  }
200  }
201  // save type
202  n->myType = type;
203  }
204 }
205 
206 
207 void
209  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
210  NBNode* n = (*i).second;
211  if (n->myType == NODETYPE_RAIL_CROSSING) {
212  // check if it really is a rail crossing
213  int numRailway = 0;
214  int numNonRailway = 0;
215  int numNonRailwayNonPed = 0;
216  for (NBEdge* e : n->getIncomingEdges()) {
217  if ((e->getPermissions() & ~SVC_RAIL_CLASSES) != 0) {
218  numNonRailway++;
219  if (e->getPermissions() != SVC_PEDESTRIAN) {
220  numNonRailwayNonPed++;
221  }
222  } else if ((e->getPermissions() & SVC_RAIL_CLASSES) != 0) {
223  numRailway++;
224  }
225  }
226  for (NBEdge* e : n->getOutgoingEdges()) {
227  if (e->getPermissions() == SVC_PEDESTRIAN) {
228  numNonRailway++;
229  }
230  }
231  if (numNonRailway == 0 || numRailway == 0) {
232  // not a crossing (maybe unregulated or rail_signal)
234  } else if (numNonRailwayNonPed > 2) {
235  // does not look like a rail crossing (roads in conflict). maybe a traffic light?
237  }
238  }
239  }
240 }
241 
242 
243 bool
245  int numRailway = 0;
246  int numNonRailway = 0;
247  for (NBEdge* e : n->getIncomingEdges()) {
248  if ((e->getPermissions() & ~SVC_RAIL_CLASSES) != 0) {
249  numNonRailway++;
250  } else if ((e->getPermissions() & SVC_RAIL_CLASSES) != 0) {
251  numRailway++;
252  }
253  }
254  return numRailway > 0 && numNonRailway == 0;
255 }
256 
257 // ---------------------------------------------------------------------------
258 // NBEdgePriorityComputer
259 // ---------------------------------------------------------------------------
260 void
262  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
263  computeEdgePrioritiesSingleNode((*i).second);
264  }
265 }
266 
267 
268 void
270  // preset all junction's edge priorities to zero
271  for (EdgeVector::iterator j = node->myAllEdges.begin(); j != node->myAllEdges.end(); ++j) {
272  (*j)->setJunctionPriority(node, NBEdge::MINOR_ROAD);
273  }
274  node->markBentPriority(false);
275  // check if the junction is not a real junction
276  if (node->myIncomingEdges.size() == 1 && node->myOutgoingEdges.size() == 1) {
277  return;
278  }
279  // compute the priorities on junction when needed
280  if (node->getType() != NODETYPE_RIGHT_BEFORE_LEFT) {
281  setPriorityJunctionPriorities(*node);
282  }
283 }
284 
285 
286 void
288  if (n.myIncomingEdges.size() == 0 || n.myOutgoingEdges.size() == 0) {
289  return;
290  }
291  EdgeVector incoming = n.myIncomingEdges;
292  EdgeVector outgoing = n.myOutgoingEdges;
293  // what we do want to have is to extract the pair of roads that are
294  // the major roads for this junction
295  // let's get the list of incoming edges with the highest priority
296  std::sort(incoming.begin(), incoming.end(), NBContHelper::edge_by_priority_sorter());
297  EdgeVector bestIncoming;
298  NBEdge* best = incoming[0];
299  while (incoming.size() > 0 && samePriority(best, incoming[0])) {
300  bestIncoming.push_back(*incoming.begin());
301  incoming.erase(incoming.begin());
302  }
303  // now, let's get the list of best outgoing
304  assert(outgoing.size() != 0);
305  sort(outgoing.begin(), outgoing.end(), NBContHelper::edge_by_priority_sorter());
306  EdgeVector bestOutgoing;
307  best = outgoing[0];
308  while (outgoing.size() > 0 && samePriority(best, outgoing[0])) { //->getPriority()==best->getPriority()) {
309  bestOutgoing.push_back(*outgoing.begin());
310  outgoing.erase(outgoing.begin());
311  }
312  // special case: user input makes mainDirection unambiguous
313  const bool mainDirectionExplicit = (
314  bestIncoming.size() == 1 && n.myIncomingEdges.size() <= 2
315  && (incoming.size() == 0 || bestIncoming[0]->getPriority() > incoming[0]->getPriority())
316  && bestOutgoing.size() == 1 && n.myOutgoingEdges.size() <= 2
317  && (outgoing.size() == 0 || bestOutgoing[0]->getPriority() > outgoing[0]->getPriority())
318  && !bestIncoming[0]->isTurningDirectionAt(bestOutgoing[0]));
319  // now, let's compute for each of the best incoming edges
320  // the incoming which is most opposite
321  // the outgoing which is most opposite
322  EdgeVector::iterator i;
323  std::map<NBEdge*, NBEdge*> counterIncomingEdges;
324  std::map<NBEdge*, NBEdge*> counterOutgoingEdges;
325  incoming = n.myIncomingEdges;
326  outgoing = n.myOutgoingEdges;
327  for (i = bestIncoming.begin(); i != bestIncoming.end(); ++i) {
328  std::sort(incoming.begin(), incoming.end(), NBContHelper::edge_opposite_direction_sorter(*i, &n, true));
329  counterIncomingEdges[*i] = *incoming.begin();
330  std::sort(outgoing.begin(), outgoing.end(), NBContHelper::edge_opposite_direction_sorter(*i, &n, true));
331  counterOutgoingEdges[*i] = *outgoing.begin();
332  }
333  //std::cout << "n=" << n.getID() << " best=" << best->getID() << " bestIncoming=" << toString(bestIncoming) << "\n incoming=" << toString(incoming) << "\n outgoing=" << toString(outgoing) << "\n mainExplicit=" << mainDirectionExplicit << " counterBest=" << counterIncomingEdges.find(bestIncoming[0])->second->getID() << "\n";
334  // ok, let's try
335  // 1) there is one best incoming road
336  if (bestIncoming.size() == 1) {
337  // let's mark this road as the best
338  NBEdge* best1 = extractAndMarkFirst(n, bestIncoming);
339  if (!mainDirectionExplicit && counterIncomingEdges.find(best1) != counterIncomingEdges.end()) {
340  // ok, look, what we want is the opposit of the straight continuation edge
341  // but, what if such an edge does not exist? By now, we'll determine it
342  // geometrically
343  NBEdge* s = counterIncomingEdges.find(best1)->second;
344  const double minAngleDiff = GeomHelper::getMinAngleDiff(best1->getAngleAtNode(&n), s->getAngleAtNode(&n));
345  if (minAngleDiff > 180 - 45
346  || (minAngleDiff > 75 && s->getPriority() == best1->getPriority() && hasDifferentPriorities(incoming, best1))) {
348  }
349  }
350  markBestParallel(n, best1, 0);
351  assert(bestOutgoing.size() != 0);
352  // mark the best outgoing as the continuation
353  sort(bestOutgoing.begin(), bestOutgoing.end(), NBContHelper::edge_similar_direction_sorter(best1));
354  // assign extra priority if the priorities are unambiguous (regardless of geometry)
355  NBEdge* bestOut = extractAndMarkFirst(n, bestOutgoing);
356  if (!mainDirectionExplicit && counterOutgoingEdges.find(bestOut) != counterOutgoingEdges.end()) {
357  NBEdge* s = counterOutgoingEdges.find(bestOut)->second;
358  if (GeomHelper::getMinAngleDiff(bestOut->getAngleAtNode(&n), s->getAngleAtNode(&n)) > 180 - 45) {
359  s->setJunctionPriority(&n, 1);
360  }
361  }
362  n.markBentPriority(n.getDirection(best1, bestOut) != LINKDIR_STRAIGHT);
363  return;
364  }
365 
366  // ok, what we want to do in this case is to determine which incoming
367  // has the best continuation...
368  // This means, when several incoming roads have the same priority,
369  // we want a (any) straight connection to be more priorised than a turning
370  double bestAngle = 0;
371  NBEdge* bestFirst = 0;
372  NBEdge* bestSecond = 0;
373  bool hadBest = false;
374  for (i = bestIncoming.begin(); i != bestIncoming.end(); ++i) {
375  EdgeVector::iterator j;
376  NBEdge* t1 = *i;
377  double angle1 = t1->getAngleAtNode(&n) + 180;
378  if (angle1 >= 360) {
379  angle1 -= 360;
380  }
381  for (j = i + 1; j != bestIncoming.end(); ++j) {
382  NBEdge* t2 = *j;
383  double angle2 = t2->getAngleAtNode(&n) + 180;
384  if (angle2 >= 360) {
385  angle2 -= 360;
386  }
387  double angle = GeomHelper::getMinAngleDiff(angle1, angle2);
388  if (!hadBest || angle > bestAngle) {
389  bestAngle = angle;
390  bestFirst = *i;
391  bestSecond = *j;
392  hadBest = true;
393  }
394  }
395  }
396  bestFirst->setJunctionPriority(&n, 1);
397  sort(bestOutgoing.begin(), bestOutgoing.end(), NBContHelper::edge_similar_direction_sorter(bestFirst));
398  if (bestOutgoing.size() != 0) {
399  extractAndMarkFirst(n, bestOutgoing);
400  }
401  bestSecond->setJunctionPriority(&n, 1);
402  sort(bestOutgoing.begin(), bestOutgoing.end(), NBContHelper::edge_similar_direction_sorter(bestSecond));
403  if (bestOutgoing.size() != 0) {
404  extractAndMarkFirst(n, bestOutgoing);
405  }
406  n.markBentPriority(GeomHelper::getMinAngleDiff(bestFirst->getAngleAtNode(&n), bestSecond->getAngleAtNode(&n)) < 135);
407  markBestParallel(n, bestFirst, bestSecond);
408 }
409 
410 void
411 NBEdgePriorityComputer::markBestParallel(const NBNode& n, NBEdge* bestFirst, NBEdge* bestSecond) {
412  // edges running parallel to the main direction should also be prioritised
413  const double a1 = bestFirst->getAngleAtNode(&n);
414  const double a2 = bestSecond == 0 ? a1 : bestSecond->getAngleAtNode(&n);
415  SVCPermissions p1 = bestFirst->getPermissions();
416  SVCPermissions p2 = bestSecond == 0 ? p1 : bestSecond->getPermissions();
417  for (NBEdge* e : n.getIncomingEdges()) {
418  // @note: this rule might also apply if there are common permissions but
419  // then we would not further rules to resolve the priority between the best edge and its parallel edge
420  SVCPermissions perm = e->getPermissions();
421  if (((GeomHelper::getMinAngleDiff(e->getAngleAtNode(&n), a1) < 10
422  || GeomHelper::getMinAngleDiff(e->getAngleAtNode(&n), a2) < 10))
423  && (p1 & perm) == 0 && (p2 & perm) == 0) {
424  e->setJunctionPriority(&n, 1);
425  }
426  }
427 }
428 
429 
430 NBEdge*
431 NBEdgePriorityComputer::extractAndMarkFirst(NBNode& n, std::vector<NBEdge*>& s, int prio) {
432  if (s.size() == 0) {
433  return 0;
434  }
435  NBEdge* ret = s.front();
436  s.erase(s.begin());
437  ret->setJunctionPriority(&n, prio);
438  return ret;
439 }
440 
441 
442 bool
443 NBEdgePriorityComputer::samePriority(const NBEdge* const e1, const NBEdge* const e2) {
444  if (e1 == e2) {
445  return true;
446  }
447  if (e1->getPriority() != e2->getPriority()) {
448  return false;
449  }
450  if ((int) e1->getSpeed() != (int) e2->getSpeed()) {
451  return false;
452  }
453  return (int) e1->getNumLanes() == (int) e2->getNumLanes();
454 }
455 
456 
457 bool
459  if (edges.size() < 2) {
460  return false;
461  }
462  int prio = edges[0] == excluded ? edges[1]->getPriority() : edges[0]->getPriority();
463  for (auto e : edges) {
464  if (e != excluded && e->getPriority() != prio) {
465  return true;
466  }
467  }
468  return false;
469 }
470 
471 
473  // reorder based on getAngleAtNodeToCenter
474  myOrdering = ordering;
475  sort(myOrdering.begin(), myOrdering.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(node));
476  // let the first edge remain the first
477  rotate(myOrdering.begin(), std::find(myOrdering.begin(), myOrdering.end(), ordering.front()), myOrdering.end());
478 }
479 
480 
481 /****************************************************************************/
482 
static double getMinAngleDiff(double angle1, double angle2)
Returns the minimum distance (clockwise/counter-clockwise) between both angles.
Definition: GeomHelper.cpp:161
is a pedestrian
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
Definition: NBNodeCont.h:116
static void validateRailCrossings(NBNodeCont &nc)
Checks rail_crossing for validity.
static void markBestParallel(const NBNode &n, NBEdge *bestFirst, NBEdge *bestSecond)
set priority for edges that are parallel to the best edges
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Definition: NBNodeCont.h:121
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
Definition: NBHelpers.cpp:60
SumoXMLNodeType myType
The type of the junction.
Definition: NBNode.h:787
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:422
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
The representation of a single edge during network building.
Definition: NBEdge.h:65
Class to sort edges by their angle in relation to the given edge.
Definition: NBContHelper.h:171
void markBentPriority(bool isBent)
mark whether a priority road turns at this node
Definition: NBNode.h:721
T MAX2(T a, T b)
Definition: StdDefs.h:68
const std::string & getID() const
Returns the id.
Definition: Named.h:69
static void sortNodesEdges(NBNodeCont &nc, bool useNodeShape=false)
Sorts a node&#39;s edges clockwise regarding driving direction.
Stores the information about the angle between an incoming ("from") and an outgoing ("to") edge...
Definition: NBAlgorithms.h:68
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:242
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges (The edges which start at this node)
Definition: NBNode.h:254
The link is a straight direction.
static bool hasDifferentPriorities(const EdgeVector &edges, const NBEdge *excluded)
return whether the priorite attribute can be used to distinguish the edges
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
Definition: NBNode.h:775
static void swapWhenReversed(const NBNode *const n, const std::vector< NBEdge *>::iterator &i1, const std::vector< NBEdge *>::iterator &i2)
Assures correct order for same-angle opposite-direction edges.
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:415
classes which drive on tracks
static void computeEdgePriorities(NBNodeCont &nc)
Computes edge priorities within a node.
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
static bool isRailwayNode(NBNode *n)
whether the given node only has rail edges
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node) ...
Definition: NBNode.h:259
#define POSITION_EPS
Definition: config.h:172
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge&#39;s geometry at the given node.
Definition: NBEdge.cpp:1749
crossing_by_junction_angle_sorter(const NBNode *node, const EdgeVector &ordering)
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3279
EdgeVector myIncomingEdges
Vector of incoming edges.
Definition: NBNode.h:769
static void computeTurnDirectionsForNode(NBNode *node, bool warn)
Computes turnaround destinations for all incoming edges of the given nodes (if any) ...
static bool samePriority(const NBEdge *const e1, const NBEdge *const e2)
Returns whether both edges have the same priority.
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:1696
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:509
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:617
EdgeVector myOutgoingEdges
Vector of outgoing edges.
Definition: NBNode.h:772
static void computeEdgePrioritiesSingleNode(NBNode *node)
Computes edge priorities within a single node.
const EdgeVector & getIncomingEdges() const
Returns this node&#39;s incoming edges (The edges which yield in this node)
Definition: NBNode.h:249
static void computeNodeTypes(NBNodeCont &nc)
Computes node types.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
Definition: NBEdge.cpp:1739
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:266
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2632
Represents a single node (junction) during network building.
Definition: NBNode.h:68
static void computeTurnDirections(NBNodeCont &nc, bool warn=true)
Computes turnaround destinations for all edges (if exist)
static NBEdge * extractAndMarkFirst(NBNode &n, std::vector< NBEdge *> &s, int prio=1)
Sets the priorites in case of a priority junction.
NBEdge * getOppositeIncoming(NBEdge *e) const
returns the opposite incoming edge of certain edge
Definition: NBNode.cpp:1331
Sorts "Combination"s by decreasing angle.
Definition: NBAlgorithms.h:78
static void setPriorityJunctionPriorities(NBNode &n)
Sets the priorites in case of a priority junction.
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:429
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:436
bool isSimpleContinuation(bool checkLaneNumbers=true) const
check if node is a simple continuation
Definition: NBNode.cpp:445