SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBEdgeCont.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // Storage for edges, including some functionality operating on multiple edges
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2014 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 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <string>
36 #include <cassert>
37 #include <algorithm>
38 #include <iostream>
39 #include <fstream>
40 #include <iomanip>
41 #include <utils/geom/Boundary.h>
42 #include <utils/geom/GeomHelper.h>
45 #include <utils/common/ToString.h>
48 #include "NBNetBuilder.h"
49 #include "NBEdgeCont.h"
50 #include "NBNodeCont.h"
51 #include "NBHelpers.h"
52 #include "NBCont.h"
54 #include "NBDistrictCont.h"
55 #include <cmath>
56 #include "NBTypeCont.h"
60 
61 #ifdef CHECK_MEMORY_LEAKS
62 #include <foreign/nvwa/debug_new.h>
63 #endif // CHECK_MEMORY_LEAKS
64 
65 
66 // ===========================================================================
67 // method definitions
68 // ===========================================================================
70  myTypeCont(tc),
71  myEdgesSplit(0),
72  myVehicleClasses2Keep(0),
73  myVehicleClasses2Remove(0),
74  myNeedGeoTransformedPrunningBoundary(false)
75 {}
76 
77 
79  clear();
80 }
81 
82 
83 void
85  myAmLeftHanded = oc.getBool("lefthand");
86  // set edges dismiss/accept options
87  myEdgesMinSpeed = oc.isSet("keep-edges.min-speed") ? oc.getFloat("keep-edges.min-speed") : -1;
88  myRemoveEdgesAfterJoining = oc.exists("keep-edges.postload") && oc.getBool("keep-edges.postload");
89  if (oc.isSet("keep-edges.explicit")) {
90  const std::vector<std::string> edges = oc.getStringVector("keep-edges.explicit");
91  myEdges2Keep.insert(edges.begin(), edges.end());
92  }
93  if (oc.isSet("remove-edges.explicit")) {
94  const std::vector<std::string> edges = oc.getStringVector("remove-edges.explicit");
95  myEdges2Remove.insert(edges.begin(), edges.end());
96  }
97  if (oc.exists("keep-edges.by-vclass") && oc.isSet("keep-edges.by-vclass")) {
98  myVehicleClasses2Keep = parseVehicleClasses(oc.getStringVector("keep-edges.by-vclass"));
99  }
100  if (oc.exists("remove-edges.by-vclass") && oc.isSet("remove-edges.by-vclass")) {
101  myVehicleClasses2Remove = parseVehicleClasses(oc.getStringVector("remove-edges.by-vclass"));
102  }
103  if (oc.exists("keep-edges.by-type") && oc.isSet("keep-edges.by-type")) {
104  const std::vector<std::string> types = oc.getStringVector("keep-edges.by-type");
105  myTypes2Keep.insert(types.begin(), types.end());
106  }
107  if (oc.exists("remove-edges.by-type") && oc.isSet("remove-edges.by-type")) {
108  const std::vector<std::string> types = oc.getStringVector("remove-edges.by-type");
109  myTypes2Remove.insert(types.begin(), types.end());
110  }
111 
112  if (oc.isSet("keep-edges.in-boundary") || oc.isSet("keep-edges.in-geo-boundary")) {
113  std::vector<std::string> polyS = oc.getStringVector(oc.isSet("keep-edges.in-boundary") ?
114  "keep-edges.in-boundary" : "keep-edges.in-geo-boundary");
115  // !!! throw something if length<4 || length%2!=0?
116  std::vector<SUMOReal> poly;
117  for (std::vector<std::string>::iterator i = polyS.begin(); i != polyS.end(); ++i) {
118  poly.push_back(TplConvert::_2SUMOReal((*i).c_str())); // !!! may throw something anyhow...
119  }
120  if (poly.size() < 4) {
121  throw ProcessError("Invalid boundary: need at least 2 coordinates");
122  } else if (poly.size() % 2 != 0) {
123  throw ProcessError("Invalid boundary: malformed coordinate");
124  } else if (poly.size() == 4) {
125  // prunning boundary (box)
126  myPrunningBoundary.push_back(Position(poly[0], poly[1]));
127  myPrunningBoundary.push_back(Position(poly[2], poly[1]));
128  myPrunningBoundary.push_back(Position(poly[2], poly[3]));
129  myPrunningBoundary.push_back(Position(poly[0], poly[3]));
130  } else {
131  for (std::vector<SUMOReal>::iterator j = poly.begin(); j != poly.end();) {
132  SUMOReal x = *j++;
133  SUMOReal y = *j++;
135  }
136  }
137  myNeedGeoTransformedPrunningBoundary = oc.isSet("keep-edges.in-geo-boundary");
138  }
139 }
140 
141 
142 void
144  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
145  delete((*i).second);
146  }
147  myEdges.clear();
148  for (EdgeCont::iterator i = myExtractedEdges.begin(); i != myExtractedEdges.end(); i++) {
149  delete((*i).second);
150  }
151  myExtractedEdges.clear();
152 }
153 
154 
155 
156 // ----- edge access methods
157 bool
158 NBEdgeCont::insert(NBEdge* edge, bool ignorePrunning) {
159  if (myAmLeftHanded) {
160  edge->setLeftHanded();
161  }
162  if (myEdges.count(edge->getID())) {
163  return false;
164  }
165  if (!ignorePrunning && ignoreFilterMatch(edge)) {
166  edge->getFromNode()->removeEdge(edge);
167  edge->getToNode()->removeEdge(edge);
168  myIgnoredEdges.insert(edge->getID());
169  delete edge;
170  } else {
172  if (oc.exists("dismiss-vclasses") && oc.getBool("dismiss-vclasses")) {
174  }
175  myEdges[edge->getID()] = edge;
176  }
177  return true;
178 }
179 
180 
181 bool
183  // remove edges which allow a speed below a set one (set using "keep-edges.min-speed")
184  if (edge->getSpeed() < myEdgesMinSpeed) {
185  return true;
186  }
187  // check whether the edge is a named edge to keep
188  if (!myRemoveEdgesAfterJoining && myEdges2Keep.size() != 0) {
189  if (find(myEdges2Keep.begin(), myEdges2Keep.end(), edge->getID()) == myEdges2Keep.end()) {
190  return true;
191  }
192  }
193  // check whether the edge is a named edge to remove
194  if (myEdges2Remove.size() != 0) {
195  if (find(myEdges2Remove.begin(), myEdges2Remove.end(), edge->getID()) != myEdges2Remove.end()) {
196  return true;
197  }
198  }
199  // check whether the edge shall be removed because it does not allow any of the wished classes
200  if (myVehicleClasses2Keep != 0 && (myVehicleClasses2Keep & edge->getPermissions()) == 0) {
201  return true;
202  }
203  // check whether the edge shall be removed due to allowing unwished classes only
205  return true;
206  }
207  // check whether the edge shall be removed because it does not have one of the requested types
208  if (myTypes2Keep.size() != 0) {
209  if (myTypes2Keep.count(edge->getTypeID()) == 0) {
210  return true;
211  }
212  }
213  // check whether the edge shall be removed because it has one of the forbidden types
214  if (myTypes2Remove.size() != 0) {
215  if (myTypes2Remove.count(edge->getTypeID()) > 0) {
216  return true;
217  }
218  }
219  // check whether the edge is within the prunning boundary
220  if (myPrunningBoundary.size() != 0) {
224  } else if (GeoConvHelper::getLoaded().usingGeoProjection()) {
225  // XXX what if input file with different projections are loaded?
226  for (int i = 0; i < (int) myPrunningBoundary.size(); i++) {
228  }
229  } else {
230  WRITE_ERROR("Cannot prune edges using a geo-boundary because no projection has been loaded");
231  }
232  }
234  return true;
235  }
236  }
238  return true;
239  }
240  return false;
241 }
242 
243 
244 NBEdge*
245 NBEdgeCont::retrieve(const std::string& id, bool retrieveExtracted) const {
246  EdgeCont::const_iterator i = myEdges.find(id);
247  if (i == myEdges.end()) {
248  if (retrieveExtracted) {
249  i = myExtractedEdges.find(id);
250  if (i == myExtractedEdges.end()) {
251  return 0;
252  }
253  } else {
254  return 0;
255  }
256  }
257  return (*i).second;
258 }
259 
260 
261 NBEdge*
262 NBEdgeCont::retrievePossiblySplit(const std::string& id, bool downstream) const {
263  NBEdge* edge = retrieve(id);
264  if (edge == 0) {
265  return 0;
266  }
267  const EdgeVector* candidates = downstream ? &edge->getToNode()->getOutgoingEdges() : &edge->getFromNode()->getIncomingEdges();
268  while (candidates->size() == 1) {
269  const std::string& nextID = candidates->front()->getID();
270  if (nextID.find(id) != 0 || nextID.size() <= id.size() + 1 || (nextID[id.size()] != '.' && nextID[id.size()] != '-')) {
271  break;
272  }
273  edge = candidates->front();
274  candidates = downstream ? &edge->getToNode()->getOutgoingEdges() : &edge->getFromNode()->getIncomingEdges();
275  }
276  return edge;
277 }
278 
279 
280 NBEdge*
281 NBEdgeCont::retrievePossiblySplit(const std::string& id, const std::string& hint, bool incoming) const {
282  // try to retrieve using the given name (iterative)
283  NBEdge* edge = retrieve(id);
284  if (edge != 0) {
285  return edge;
286  }
287  // now, we did not find it; we have to look over all possibilities
288  EdgeVector hints;
289  // check whether at least the hint was not splitted
290  NBEdge* hintedge = retrieve(hint);
291  if (hintedge == 0) {
292  hints = getGeneratedFrom(hint);
293  } else {
294  hints.push_back(hintedge);
295  }
296  EdgeVector candidates = getGeneratedFrom(id);
297  for (EdgeVector::iterator i = hints.begin(); i != hints.end(); i++) {
298  NBEdge* hintedge = (*i);
299  for (EdgeVector::iterator j = candidates.begin(); j != candidates.end(); j++) {
300  NBEdge* poss_searched = (*j);
301  NBNode* node = incoming
302  ? poss_searched->myTo : poss_searched->myFrom;
303  const EdgeVector& cont = incoming
304  ? node->getOutgoingEdges() : node->getIncomingEdges();
305  if (find(cont.begin(), cont.end(), hintedge) != cont.end()) {
306  return poss_searched;
307  }
308  }
309  }
310  return 0;
311 }
312 
313 
314 NBEdge*
315 NBEdgeCont::retrievePossiblySplit(const std::string& id, SUMOReal pos) const {
316  // check whether the edge was not split, yet
317  NBEdge* edge = retrieve(id);
318  if (edge != 0) {
319  return edge;
320  }
321  size_t maxLength = 0;
322  std::string tid = id + "[";
323  for (EdgeCont::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
324  if ((*i).first.find(tid) == 0) {
325  maxLength = MAX2(maxLength, (*i).first.length());
326  }
327  }
328  // find the part of the edge which matches the position
329  SUMOReal seen = 0;
330  std::vector<std::string> names;
331  names.push_back(id + "[1]");
332  names.push_back(id + "[0]");
333  while (names.size() > 0) {
334  // retrieve the first subelement (to follow)
335  std::string cid = names.back();
336  names.pop_back();
337  edge = retrieve(cid);
338  // The edge was splitted; check its subparts within the
339  // next step
340  if (edge == 0) {
341  if (cid.length() + 3 < maxLength) {
342  names.push_back(cid + "[1]");
343  names.push_back(cid + "[0]");
344  }
345  }
346  // an edge with the name was found,
347  // check whether the position lies within it
348  else {
349  seen += edge->getLength();
350  if (seen >= pos) {
351  return edge;
352  }
353  }
354  }
355  return 0;
356 }
357 
358 
359 void
361  extract(dc, edge);
362  delete edge;
363 }
364 
365 
366 void
367 NBEdgeCont::extract(NBDistrictCont& dc, NBEdge* edge, bool remember) {
368  if (remember) {
369  myExtractedEdges[edge->getID()] = edge;
370  }
371  myEdges.erase(edge->getID());
372  edge->myFrom->removeEdge(edge);
373  edge->myTo->removeEdge(edge);
374  dc.removeFromSinksAndSources(edge);
375 }
376 
377 
378 void
379 NBEdgeCont::rename(NBEdge* edge, const std::string& newID) {
380  if (myEdges.count(newID) != 0) {
381  throw ProcessError("Attempt to rename edge using existing id '" + newID + "'");
382  }
383  myEdges.erase(edge->getID());
384  edge->setID(newID);
385  myEdges[newID] = edge;
386 }
387 
388 
389 // ----- explicit edge manipulation methods
390 bool
392  return splitAt(dc, edge, node, edge->getID() + "[0]", edge->getID() + "[1]",
393  (unsigned int) edge->myLanes.size(), (unsigned int) edge->myLanes.size());
394 }
395 
396 
397 bool
399  const std::string& firstEdgeName,
400  const std::string& secondEdgeName,
401  unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge,
402  const SUMOReal speed) {
403  SUMOReal pos;
404  pos = edge->getGeometry().nearest_offset_to_point2D(node->getPosition());
405  if (pos <= 0) {
407  edge->myFrom->getPosition(), edge->myTo->getPosition(),
408  node->getPosition());
409  }
410  if (pos <= 0 || pos + POSITION_EPS > edge->getGeometry().length()) {
411  return false;
412  }
413  return splitAt(dc, edge, pos, node, firstEdgeName, secondEdgeName,
414  noLanesFirstEdge, noLanesSecondEdge, speed);
415 }
416 
417 
418 bool
420  NBEdge* edge, SUMOReal pos, NBNode* node,
421  const std::string& firstEdgeName,
422  const std::string& secondEdgeName,
423  unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge,
424  const SUMOReal speed) {
425  // build the new edges' geometries
426  std::pair<PositionVector, PositionVector> geoms =
427  edge->getGeometry().splitAt(pos);
428  if (geoms.first[-1] != node->getPosition()) {
429  geoms.first.pop_back();
430  geoms.first.push_back(node->getPosition());
431  }
432 
433  if (geoms.second[0] != node->getPosition()) {
434  geoms.second.pop_front();
435  geoms.second.push_front(node->getPosition());
436  }
437  // build and insert the edges
438  NBEdge* one = new NBEdge(firstEdgeName, edge->myFrom, node, edge, geoms.first, noLanesFirstEdge);
439  NBEdge* two = new NBEdge(secondEdgeName, node, edge->myTo, edge, geoms.second, noLanesSecondEdge);
440  two->copyConnectionsFrom(edge);
441  if (speed != -1.) {
442  two->setSpeed(-1, speed);
443  }
444  // replace information about this edge within the nodes
445  edge->myFrom->replaceOutgoing(edge, one, 0);
446  edge->myTo->replaceIncoming(edge, two, 0);
447  // the edge is now occuring twice in both nodes...
448  // clean up
449  edge->myFrom->removeDoubleEdges();
450  edge->myTo->removeDoubleEdges();
451  // add connections from the first to the second edge
452  // check special case:
453  // one in, one out, the outgoing has one lane more
454  if (noLanesFirstEdge == noLanesSecondEdge - 1) {
455  for (unsigned int i = 0; i < one->getNumLanes(); i++) {
456  if (!one->addLane2LaneConnection(i, two, i + 1, NBEdge::L2L_COMPUTED)) { // !!! Bresenham, here!!!
457  throw ProcessError("Could not set connection!");
458  }
459  }
461  } else {
462  for (unsigned int i = 0; i < one->getNumLanes() && i < two->getNumLanes(); i++) {
463  if (!one->addLane2LaneConnection(i, two, i, NBEdge::L2L_COMPUTED)) {// !!! Bresenham, here!!!
464  throw ProcessError("Could not set connection!");
465  }
466  }
467  }
469  if (find(myEdges2Keep.begin(), myEdges2Keep.end(), edge->getID()) != myEdges2Keep.end()) {
470  myEdges2Keep.insert(one->getID());
471  myEdges2Keep.insert(two->getID());
472  }
473  if (find(myEdges2Remove.begin(), myEdges2Remove.end(), edge->getID()) != myEdges2Remove.end()) {
474  myEdges2Remove.insert(one->getID());
475  myEdges2Remove.insert(two->getID());
476  }
477  }
478  // erase the splitted edge
479  erase(dc, edge);
480  insert(one, true);
481  insert(two, true);
482  myEdgesSplit++;
483  return true;
484 }
485 
486 
487 
488 // ----- container access methods
489 std::vector<std::string>
491  std::vector<std::string> ret;
492  for (EdgeCont::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
493  ret.push_back((*i).first);
494  }
495  return ret;
496 }
497 
498 
499 // ----- Adapting the input
500 void
502  EdgeVector toRemove;
503  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
504  NBEdge* edge = (*i).second;
505  if (!myEdges2Keep.count(edge->getID())) {
506  edge->getFromNode()->removeEdge(edge);
507  edge->getToNode()->removeEdge(edge);
508  toRemove.push_back(edge);
509  }
510  }
511  for (EdgeVector::iterator j = toRemove.begin(); j != toRemove.end(); ++j) {
512  erase(dc, *j);
513  }
514 }
515 
516 
517 void
519  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
520  if ((*i).second->getGeometry().size() < 3) {
521  continue;
522  }
523  (*i).second->splitGeometry(*this, nc);
524  }
525 }
526 
527 
528 void
530  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
531  (*i).second->reduceGeometry(minDist);
532  }
533 }
534 
535 
536 void
537 NBEdgeCont::checkGeometries(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix) {
538  if (maxAngle > 0 || minRadius > 0) {
539  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
540  (*i).second->checkGeometry(maxAngle, minRadius, fix);
541  }
542  }
543 }
544 
545 
546 // ----- processing methods
547 void
549  for (EdgeCont::const_iterator i = myEdges.begin(); i != myEdges.end(); i++) {
550  (*i).second->clearControllingTLInformation();
551  }
552 }
553 
554 
555 void
557  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
558  (*i).second->sortOutgoingConnectionsByAngle();
559  }
560 }
561 
562 
563 void
564 NBEdgeCont::computeEdge2Edges(bool noLeftMovers) {
565  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
566  (*i).second->computeEdge2Edges(noLeftMovers);
567  }
568 }
569 
570 
571 void
572 NBEdgeCont::computeLanes2Edges(const bool buildCrossingsAndWalkingAreas) {
573  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
574  (*i).second->computeLanes2Edges(buildCrossingsAndWalkingAreas);
575  }
576 }
577 
578 
579 void
580 NBEdgeCont::recheckLanes(const bool buildCrossingsAndWalkingAreas) {
581  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
582  (*i).second->recheckLanes(buildCrossingsAndWalkingAreas);
583  }
584 }
585 
586 
587 void
588 NBEdgeCont::appendTurnarounds(bool noTLSControlled) {
589  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
590  (*i).second->appendTurnaround(noTLSControlled);
591  }
592 }
593 
594 
595 void
596 NBEdgeCont::appendTurnarounds(const std::set<std::string>& ids, bool noTLSControlled) {
597  for (std::set<std::string>::const_iterator it = ids.begin(); it != ids.end(); it++) {
598  myEdges[*it]->appendTurnaround(noTLSControlled);
599  }
600 }
601 
602 
603 void
605  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
606  (*i).second->computeEdgeShape();
607  }
608 }
609 
610 
611 void
613  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
614  (*i).second->computeLaneShapes();
615  }
616 }
617 
618 
619 void
622  EdgeVector edges) {
623  // !!! Attention!
624  // No merging of the geometry to come is being done
625  // The connections are moved from one edge to another within
626  // the replacement where the edge is a node's incoming edge.
627 
628  // count the number of lanes, the speed and the id
629  unsigned int nolanes = 0;
630  SUMOReal speed = 0;
631  int priority = 0;
632  std::string id;
633  sort(edges.begin(), edges.end(), NBContHelper::same_connection_edge_sorter());
634  // retrieve the connected nodes
635  NBEdge* tpledge = *(edges.begin());
636  NBNode* from = tpledge->getFromNode();
637  NBNode* to = tpledge->getToNode();
638  EdgeVector::const_iterator i;
639  for (i = edges.begin(); i != edges.end(); i++) {
640  // some assertions
641  assert((*i)->getFromNode() == from);
642  assert((*i)->getToNode() == to);
643  // ad the number of lanes the current edge has
644  nolanes += (*i)->getNumLanes();
645  // build the id
646  if (i != edges.begin()) {
647  id += "+";
648  }
649  id += (*i)->getID();
650  // compute the speed
651  speed += (*i)->getSpeed();
652  // build the priority
653  priority = MAX2(priority, (*i)->getPriority());
654  }
655  speed /= edges.size();
656  // build the new edge
657  // @bug new edge does not know about allowed vclass of old edges
658  // @bug both the width and the offset are not regarded
659  NBEdge* newEdge = new NBEdge(id, from, to, "", speed, nolanes, priority,
661  tpledge->getStreetName(), tpledge->myLaneSpreadFunction);
662  insert(newEdge, true);
663  // replace old edge by current within the nodes
664  // and delete the old
665  from->replaceOutgoing(edges, newEdge);
666  to->replaceIncoming(edges, newEdge);
667  // patch connections
668  // add edge2edge-information
669  for (i = edges.begin(); i != edges.end(); i++) {
670  EdgeVector ev = (*i)->getConnectedEdges();
671  for (EdgeVector::iterator j = ev.begin(); j != ev.end(); j++) {
672  newEdge->addEdge2EdgeConnection(*j);
673  }
674  }
675  // move lane2lane-connections
676  unsigned int currLane = 0;
677  for (i = edges.begin(); i != edges.end(); i++) {
678  newEdge->moveOutgoingConnectionsFrom(*i, currLane);
679  currLane += (*i)->getNumLanes();
680  }
681  // patch tl-information
682  currLane = 0;
683  for (i = edges.begin(); i != edges.end(); i++) {
684  unsigned int noLanes = (*i)->getNumLanes();
685  for (unsigned int j = 0; j < noLanes; j++, currLane++) {
686  // replace in traffic lights
687  tlc.replaceRemoved(*i, j, newEdge, currLane);
688  }
689  }
690  // delete joined edges
691  for (i = edges.begin(); i != edges.end(); i++) {
692  erase(dc, *i);
693  }
694 }
695 
696 
697 void
699  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
700  std::string oppositeID;
701  if ((*i).first[0] == '-') {
702  oppositeID = (*i).first.substr(1);
703  } else {
704  oppositeID = "-" + (*i).first;
705  }
706  if (myEdges.find(oppositeID) != myEdges.end()) {
707  (*i).second->setLaneSpreadFunction(LANESPREAD_RIGHT);
708  myEdges.find(oppositeID)->second->setLaneSpreadFunction(LANESPREAD_RIGHT);
709  } else {
710  (*i).second->setLaneSpreadFunction(LANESPREAD_CENTER);
711  }
712  }
713 }
714 
715 
716 
717 // ----- other
718 void
719 NBEdgeCont::addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass) {
720  myConnections.push_back(PostProcessConnection(from, fromLane, to, toLane, mayDefinitelyPass));
721 }
722 
723 
724 void
726  for (std::vector<PostProcessConnection>::const_iterator i = myConnections.begin(); i != myConnections.end(); ++i) {
727  NBEdge* from = retrievePossiblySplit((*i).from, true);
728  NBEdge* to = retrievePossiblySplit((*i).to, false);
729  if (from != 0 && to != 0) {
730  if (!from->addLane2LaneConnection((*i).fromLane, to, (*i).toLane, NBEdge::L2L_USER, false, (*i).mayDefinitelyPass)) {
731  WRITE_WARNING("Could not insert connection between '" + (*i).from + "' and '" + (*i).to + "' after build.");
732  }
733  }
734  }
735  // during loading we also kept some ambiguous connections in hope they might be valid after processing
736  // we need to make sure that all invalid connections are removed now
737  for (EdgeCont::iterator it = myEdges.begin(); it != myEdges.end(); ++it) {
738  NBEdge* edge = it->second;
739  NBNode* to = edge->getToNode();
740  // make a copy because we may delete connections
741  std::vector<NBEdge::Connection> connections = edge->getConnections();
742  for (std::vector<NBEdge::Connection>::iterator it_con = connections.begin(); it_con != connections.end(); ++it_con) {
743  NBEdge::Connection& c = *it_con;
744  if (c.toEdge != 0 && c.toEdge->getFromNode() != to) {
745  WRITE_WARNING("Found and removed invalid connection from " + edge->getID() +
746  " to " + c.toEdge->getID() + " via " + to->getID());
747  edge->removeFromConnections(c.toEdge);
748  }
749  }
750  }
751 }
752 
753 
755 NBEdgeCont::getGeneratedFrom(const std::string& id) const {
756  size_t len = id.length();
757  EdgeVector ret;
758  for (EdgeCont::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
759  std::string curr = (*i).first;
760  // the next check makes it possibly faster - we don not have
761  // to compare the names
762  if (curr.length() <= len) {
763  continue;
764  }
765  // the name must be the same as the given id but something
766  // beginning with a '[' must be appended to it
767  if (curr.substr(0, len) == id && curr[len] == '[') {
768  ret.push_back((*i).second);
769  continue;
770  }
771  // ok, maybe the edge is a compound made during joining of edges
772  size_t pos = curr.find(id);
773  // surely not
774  if (pos == std::string::npos) {
775  continue;
776  }
777  // check leading char
778  if (pos > 0) {
779  if (curr[pos - 1] != ']' && curr[pos - 1] != '+') {
780  // actually, this is another id
781  continue;
782  }
783  }
784  if (pos + id.length() < curr.length()) {
785  if (curr[pos + id.length()] != '[' && curr[pos + id.length()] != '+') {
786  // actually, this is another id
787  continue;
788  }
789  }
790  ret.push_back((*i).second);
791  }
792  return ret;
793 }
794 
795 
796 void
798  myGuessedRoundabouts.clear();
799  std::set<NBEdge*> loadedRoundaboutEdges;
800  for (std::set<EdgeSet>::const_iterator it = myRoundabouts.begin(); it != myRoundabouts.end(); ++it) {
801  loadedRoundaboutEdges.insert(it->begin(), it->end());
802  }
803  // step 1: keep only those edges which have no turnarounds and which are not
804  // part of a loaded roundabout
805  std::set<NBEdge*> candidates;
806  for (EdgeCont::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
807  NBEdge* e = (*i).second;
808  NBNode* const to = e->getToNode();
809  if (e->getTurnDestination() == 0 && to->getConnectionTo(e->getFromNode()) == 0 && loadedRoundaboutEdges.count(e) == 0) {
810  candidates.insert(e);
811  }
812  }
813 
814  // step 2:
815  std::set<NBEdge*> visited;
816  for (std::set<NBEdge*>::const_iterator i = candidates.begin(); i != candidates.end(); ++i) {
817  EdgeVector loopEdges;
818  // start with a random edge (this doesn't have to be a roundabout edge)
819  // loop over connected edges (using always the leftmost one)
820  // and keep the list in loopEdges
821  // continue until we loop back onto a loopEdges and extract the loop
822  NBEdge* e = (*i);
823  if (visited.count(e) > 0) {
824  // already seen
825  continue;
826  }
827  loopEdges.push_back(e);
828  bool doLoop = true;
829  do {
830  visited.insert(e);
831  const EdgeVector& edges = e->getToNode()->getEdges();
832  if (edges.size() < 2) {
833  doLoop = false;
834  break;
835  }
836  if (e->getTurnDestination() != 0 || e->getToNode()->getConnectionTo(e->getFromNode()) != 0) {
837  // do not follow turn-arounds while in a (tentative) loop
838  doLoop = false;
839  break;
840  }
841  EdgeVector::const_iterator me = find(edges.begin(), edges.end(), e);
842  NBContHelper::nextCW(edges, me);
843  NBEdge* left = *me;
844  SUMOReal angle = fabs(NBHelpers::relAngle(e->getAngleAtNode(e->getToNode()), left->getAngleAtNode(e->getToNode())));
845  if (angle >= 90) {
846  // roundabouts do not have sharp turns (or they wouldn't be called 'round')
847  doLoop = false;
848  break;
849  }
850  EdgeVector::const_iterator loopClosed = find(loopEdges.begin(), loopEdges.end(), left);
851  const size_t loopSize = loopEdges.end() - loopClosed;
852  if (loopSize > 0) {
853  // loop found
854  if (loopSize < 3) {
855  doLoop = false; // need at least 3 edges for a roundabout
856  } else if (loopSize < loopEdges.size()) {
857  // remove initial edges not belonging to the loop
858  EdgeVector(loopEdges.begin() + (loopEdges.size() - loopSize), loopEdges.end()).swap(loopEdges);
859  }
860  // count attachments to the outside. need at least 3 or a roundabout doesn't make much sense
861  int attachments = 0;
862  for (EdgeVector::const_iterator j = loopEdges.begin(); j != loopEdges.end(); ++j) {
863  if ((*j)->getToNode()->getEdges().size() > 2) {
864  attachments++;
865  }
866  }
867  if (attachments < 3) {
868  doLoop = false;
869  }
870  break;
871  }
872  if (visited.count(left) > 0) {
873  doLoop = false;
874  } else {
875  // keep going
876  loopEdges.push_back(left);
877  e = left;
878  }
879  } while (doLoop);
880  if (doLoop) {
881  // collected edges are marked in markRoundabouts
882  myGuessedRoundabouts.insert(EdgeSet(loopEdges.begin(), loopEdges.end()));
883  }
884  }
885 }
886 
887 
888 const std::set<EdgeSet>
890  std::set<EdgeSet> result = myRoundabouts;
891  result.insert(myGuessedRoundabouts.begin(), myGuessedRoundabouts.end());
892  return result;
893 }
894 
895 
896 void
897 NBEdgeCont::addRoundabout(const EdgeSet& roundabout) {
898  if (find(myRoundabouts.begin(), myRoundabouts.end(), roundabout) != myRoundabouts.end()) {
899  WRITE_WARNING("Ignoring duplicate roundabout: " + toString(roundabout));
900  } else {
901  myRoundabouts.insert(roundabout);
902  }
903 }
904 
905 
906 void
908  const std::set<EdgeSet> roundabouts = getRoundabouts();
909  for (std::set<EdgeSet>::const_iterator it = roundabouts.begin(); it != roundabouts.end(); ++it) {
910  const EdgeSet roundaboutSet = *it;
911  for (std::set<NBEdge*>::const_iterator j = roundaboutSet.begin(); j != roundaboutSet.end(); ++j) {
912  // disable turnarounds on incoming edges
913  NBNode* node = (*j)->getToNode();
914  const EdgeVector& incoming = node->getIncomingEdges();
915  for (EdgeVector::const_iterator k = incoming.begin(); k != incoming.end(); ++k) {
916  NBEdge* inEdge = *k;
917  if (roundaboutSet.count(inEdge) > 0) {
918  continue;
919  }
920  if ((inEdge)->getStep() >= NBEdge::LANES2LANES_USER) {
921  continue;
922  }
923  inEdge->removeFromConnections(inEdge->getTurnDestination(), -1);
924  }
925  // let the connections to succeeding roundabout edge have a higher priority
926  (*j)->setJunctionPriority(node, 1000);
927  node->setRoundabout();
928  }
929  }
930 }
931 
932 void
934  for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
935  NBEdge* e = i->second;
936  // is this a "real" junction?
937  // XXX nyi
938  //continue
939  const SUMOReal offset = e->getLength() - 3;
940  switch (e->getToNode()->getType()) {
941  case NODETYPE_PRIORITY:
942  // yield or major?
943  if (e->getJunctionPriority(e->getToNode()) > 0) {
945  } else {
947  }
948  break;
950  // yield or major?
951  if (e->getJunctionPriority(e->getToNode()) > 0) {
953  } else {
955  }
956  break;
959  break;
962  break;
963  default:
964  break;
965  }
966  }
967 }
968 
969 
970 int
972  int sidewalksCreated = 0;
973  for (EdgeCont::iterator it = myEdges.begin(); it != myEdges.end(); it++) {
974  NBEdge* edge = it->second;
975  if (edge->getSpeed() > minSpeed && edge->getSpeed() <= maxSpeed && edge->getPermissions(0) != SVC_PEDESTRIAN) {
976  edge->addSidewalk(width);
977  sidewalksCreated += 1;
978  }
979  }
980  return sidewalksCreated;
981 }
982 
983 
984 /****************************************************************************/
~NBEdgeCont()
Destructor.
Definition: NBEdgeCont.cpp:78
std::vector< Lane > myLanes
Lane information.
Definition: NBEdge.h:1259
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:851
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
const EdgeVector & getIncomingEdges() const
Returns this node&#39;s incoming edges.
Definition: NBNode.h:244
const std::string & getTypeID() const
Definition: NBEdge.h:885
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:148
void sortOutgoingLanesConnections()
Sorts all lanes of all edges within the container by their direction.
Definition: NBEdgeCont.cpp:556
bool myAmLeftHanded
Whether the network is left-handed.
Definition: NBEdgeCont.h:580
void markRoundabouts()
mark edge priorities and prohibit turn-arounds for all roundabout edges
Definition: NBEdgeCont.cpp:907
void setRoundabout()
update the type of this node as a roundabout
Definition: NBNode.cpp:2005
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
Definition: NBEdgeCont.cpp:262
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:201
A class representing a single street sign.
Definition: NBSign.h:51
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
is a pedestrian
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
std::vector< std::string > getAllNames() const
Returns all ids of known edges.
Definition: NBEdgeCont.cpp:490
static bool transformCoordinates(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
void addSign(NBSign sign)
Definition: NBEdge.h:1049
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:164
NBNode * myTo
Definition: NBEdge.h:1210
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
Definition: NBEdgeCont.cpp:889
static SUMOReal _2SUMOReal(const E *const data)
Definition: TplConvert.h:223
bool myNeedGeoTransformedPrunningBoundary
whether a geo transform has been applied to the pruning boundary
Definition: NBEdgeCont.h:614
A container for traffic light definitions and built programs.
bool myRemoveEdgesAfterJoining
Whether edges shall be joined first, then removed.
Definition: NBEdgeCont.h:590
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:2112
void moveOutgoingConnectionsFrom(NBEdge *e, unsigned int laneOff)
Definition: NBEdge.cpp:1697
void addSidewalk(SUMOReal width)
add a pedestrian sidewalk of the given width and shift existing connctions
Definition: NBEdge.cpp:2237
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
Definition: GeoConvHelper.h:97
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
Definition: NBNode.cpp:1031
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The representation of a single edge during network building.
Definition: NBEdge.h:71
A container for districts.
static GeoConvHelper & getLoaded()
the coordinate transformation that was loaded fron an input file
bool addLane2LaneConnection(unsigned int fromLane, NBEdge *dest, unsigned int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false)
Adds a connection between the specified this edge&#39;s lane and an approached one.
Definition: NBEdge.cpp:628
void removeDoubleEdges()
Definition: NBNode.cpp:919
T MAX2(T a, T b)
Definition: StdDefs.h:74
void clearControllingTLInformation() const
Clears information about controlling traffic lights for all connenections of all edges.
Definition: NBEdgeCont.cpp:548
void generateStreetSigns()
assigns street signs to edges based on toNode types
Definition: NBEdgeCont.cpp:933
void rename(NBEdge *edge, const std::string &newID)
Renames the edge. Throws exception if newID already exists.
Definition: NBEdgeCont.cpp:379
bool splitAt(NBDistrictCont &dc, NBEdge *edge, NBNode *node)
Splits the edge at the position nearest to the given node.
Definition: NBEdgeCont.cpp:391
void recheckPostProcessConnections()
Try to set any stored connections.
Definition: NBEdgeCont.cpp:725
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
unsigned int myEdgesSplit
the number of splits of edges during the building
Definition: NBEdgeCont.h:577
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:203
std::vector< PostProcessConnection > myConnections
The list of connections to recheck.
Definition: NBEdgeCont.h:561
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:67
void checkGeometries(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
Definition: NBEdgeCont.cpp:537
NBEdgeCont(NBTypeCont &tc)
Constructor.
Definition: NBEdgeCont.cpp:69
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges.
Definition: NBNode.h:252
const std::string & getID() const
Returns the id.
Definition: Named.h:60
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:604
bool overlapsWith(const AbstractPoly &poly, SUMOReal offset=0) const
Returns whether the boundary overlaps with the given polygon.
Definition: Boundary.cpp:156
static SUMOReal nearest_offset_on_line_to_point2D(const Position &l1, const Position &l2, const Position &p, bool perpendicular=true)
Definition: GeomHelper.cpp:256
SVCPermissions myVehicleClasses2Keep
Set of vehicle types which must be allowed on edges in order to keep them.
Definition: NBEdgeCont.h:599
const Position & getPosition() const
Returns the position of this node.
Definition: NBNode.h:232
void reduceGeometries(const SUMOReal minDist)
Definition: NBEdgeCont.cpp:529
void computeLanes2Edges(const bool buildCrossingsAndWalkingAreas)
Computes for each edge which lanes approach the next edges.
Definition: NBEdgeCont.cpp:572
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Definition: NBEdge.h:103
std::set< NBEdge * > EdgeSet
Definition: NBCont.h:51
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
Definition: NBEdgeCont.cpp:158
void removeUnwishedEdges(NBDistrictCont &dc)
Removes unwished edges (not in keep-edges)
Definition: NBEdgeCont.cpp:501
void extract(NBDistrictCont &dc, NBEdge *edge, bool remember=false)
Removes the given edge from the container like erase but does not delete it.
Definition: NBEdgeCont.cpp:367
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
void guessRoundabouts()
Determines which edges belong to roundabouts and increases their priority.
Definition: NBEdgeCont.cpp:797
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
Definition: NBEdgeCont.cpp:84
unsigned int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:344
std::set< std::string > myEdges2Keep
Set of ids of edges which shall explicitly be kept.
Definition: NBEdgeCont.h:593
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:269
void computeEdge2Edges(bool noLeftMovers)
Computes for each edge the approached edges.
Definition: NBEdgeCont.cpp:564
void computeLaneShapes()
Computes the shapes of all lanes of all edges stored in the container.
Definition: NBEdgeCont.cpp:612
void setLeftHanded()
Marks this edge to be left-handed.
Definition: NBEdge.h:333
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
Definition: NBNode.h:260
void splitGeometry(NBNodeCont &nc)
Splits edges into multiple if they have a complex geometry.
Definition: NBEdgeCont.cpp:518
EdgeCont myEdges
The instance of the dictionary (id-&gt;edge)
Definition: NBEdgeCont.h:568
#define POSITION_EPS
Definition: config.h:189
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
void clear()
Deletes all edges.
Definition: NBEdgeCont.cpp:143
EdgeCont myExtractedEdges
The extracted nodes which are kept for reference.
Definition: NBEdgeCont.h:571
bool knows(const std::string &type) const
Returns whether the named type is in the container.
Definition: NBTypeCont.cpp:80
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
The connection was given by the user.
Definition: NBEdge.h:114
std::set< EdgeSet > myGuessedRoundabouts
Edges marked as belonging to a roundabout after guessing.
Definition: NBEdgeCont.h:620
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:839
std::set< EdgeSet > myRoundabouts
Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout) ...
Definition: NBEdgeCont.h:618
NBEdge * getConnectionTo(NBNode *n) const
Definition: NBNode.cpp:1410
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1142
void joinSameNodeConnectingEdges(NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, EdgeVector edges)
Joins the given edges because they connect the same nodes.
Definition: NBEdgeCont.cpp:620
std::pair< PositionVector, PositionVector > splitAt(SUMOReal where) const
Returns the two lists made when this list vector is splitted at the given point.
SVCPermissions myVehicleClasses2Remove
Set of vehicle types which need not be supported (edges which allow ONLY these are removed) ...
Definition: NBEdgeCont.h:602
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:205
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2156
PositionVector myPrunningBoundary
Boundary within which an edge must be located in order to be kept.
Definition: NBEdgeCont.h:611
SUMOReal length() const
Returns the length.
void push_back(const PositionVector &p)
Appends all positions from the given vector.
std::set< std::string > myTypes2Keep
Set of edges types which shall be kept.
Definition: NBEdgeCont.h:605
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
Definition: Boundary.cpp:200
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:368
SUMOReal myEdgesMinSpeed
The minimum speed an edge may have in order to be kept (default: -1)
Definition: NBEdgeCont.h:587
void setID(const std::string &newID)
resets the id
Definition: Named.h:68
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:815
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
Definition: NBEdgeCont.cpp:245
void appendTurnarounds(bool noTLSControlled)
Appends turnarounds to all edges stored in the container.
Definition: NBEdgeCont.cpp:588
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:41
bool getShallBeDiscarded(const std::string &type) const
Returns the information whether edges of this type shall be discarded.
Definition: NBTypeCont.cpp:122
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:521
A storage for options typed value containers)
Definition: OptionsCont.h:108
void recheckLanes(const bool buildCrossingsAndWalkingAreas)
Rechecks whether all lanes have a successor for each of the stored edges.
Definition: NBEdgeCont.cpp:580
void erase(NBDistrictCont &dc, NBEdge *edge)
Removes the given edge from the container (deleting it)
Definition: NBEdgeCont.cpp:360
A structure representing a connection between two lanes.
Definition: NBEdgeCont.h:536
void computeEdgeShapes()
Computes the shapes of all edges stored in the container.
Definition: NBEdgeCont.cpp:604
The connection was computed.
Definition: NBEdge.h:112
Represents a single node (junction) during network building.
Definition: NBNode.h:75
void dismissVehicleClassInformation()
Definition: NBEdge.cpp:2177
NBTypeCont & myTypeCont
The network builder; used to obtain type information.
Definition: NBEdgeCont.h:531
void recheckLaneSpread()
Rechecks whether the lane spread is proper.
Definition: NBEdgeCont.cpp:698
NBEdge * getTurnDestination() const
Definition: NBEdge.cpp:1952
#define SUMOReal
Definition: config.h:218
static SUMOReal relAngle(SUMOReal angle1, SUMOReal angle2)
Definition: NBHelpers.cpp:63
void removeFromSinksAndSources(NBEdge *const e)
Removes the given edge from the lists of sources and sinks in all stored districts.
std::set< std::string > myTypes2Remove
Set of edges types which shall be removed.
Definition: NBEdgeCont.h:608
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:428
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:64
std::set< std::string > myIgnoredEdges
The ids of ignored edges.
Definition: NBEdgeCont.h:574
EdgeVector getGeneratedFrom(const std::string &id) const
Returns the edges which have been built by splitting the edge of the given id.
Definition: NBEdgeCont.cpp:755
int guessSidewalks(SUMOReal width, SUMOReal minSpeed, SUMOReal maxSpeed)
add sidwalks to edges within the given limits and return the number of edges affected ...
Definition: NBEdgeCont.cpp:971
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces occurences of the removed edge/lane in all definitions by the given edge.
void addRoundabout(const EdgeSet &roundabout)
add user specified roundabout
Definition: NBEdgeCont.cpp:897
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:747
void addPostProcessConnection(const std::string &from, int fromLane, const std::string &to, int toLane, bool mayDefinitelyPass)
Adds a connection which could not be set during loading.
Definition: NBEdgeCont.cpp:719
NBNode * myFrom
The source and the destination node.
Definition: NBEdge.h:1210
bool exists(const std::string &name) const
Returns the information whether the named option is known.
void copyConnectionsFrom(NBEdge *src)
Definition: NBEdge.cpp:944
bool ignoreFilterMatch(NBEdge *edge)
Returns true if this edge matches one of the removal criteria.
Definition: NBEdgeCont.cpp:182
A storage for available types of edges.
Definition: NBTypeCont.h:56
SUMOReal getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:403
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge&#39;s geometry at the given node.
Definition: NBEdge.cpp:1162
std::set< std::string > myEdges2Remove
Set of ids of edges which shall explicitly be removed.
Definition: NBEdgeCont.h:596
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:360