SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NBAlgorithms_Ramps.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Algorithms for highway on-/off-ramps computation
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <cassert>
36 #include "NBNetBuilder.h"
37 #include "NBNodeCont.h"
38 #include "NBNode.h"
39 #include "NBEdge.h"
40 #include "NBAlgorithms_Ramps.h"
41 
42 #ifdef CHECK_MEMORY_LEAKS
43 #include <foreign/nvwa/debug_new.h>
44 #endif // CHECK_MEMORY_LEAKS
45 
46 
47 // ===========================================================================
48 // static members
49 // ===========================================================================
50 const std::string NBRampsComputer::ADDED_ON_RAMP_EDGE("-AddedOnRampEdge");
51 
52 // ===========================================================================
53 // method definitions
54 // ===========================================================================
55 // ---------------------------------------------------------------------------
56 // NBRampsComputer
57 // ---------------------------------------------------------------------------
58 void
60  SUMOReal minHighwaySpeed = oc.getFloat("ramps.min-highway-speed");
61  SUMOReal maxRampSpeed = oc.getFloat("ramps.max-ramp-speed");
62  SUMOReal rampLength = oc.getFloat("ramps.ramp-length");
63  bool dontSplit = oc.getBool("ramps.no-split");
64  std::set<NBEdge*> incremented;
65  // check whether on-off ramps shall be guessed
66  if (oc.getBool("ramps.guess")) {
67  NBNodeCont& nc = nb.getNodeCont();
68  NBEdgeCont& ec = nb.getEdgeCont();
70  std::set<NBNode*> potOnRamps;
71  std::set<NBNode*> potOffRamps;
72  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
73  NBNode* cur = (*i).second;
74  if (mayNeedOnRamp(cur, minHighwaySpeed, maxRampSpeed)) {
75  potOnRamps.insert(cur);
76  }
77  if (mayNeedOffRamp(cur, minHighwaySpeed, maxRampSpeed)) {
78  potOffRamps.insert(cur);
79  }
80  }
81  for (std::set<NBNode*>::const_iterator i = potOnRamps.begin(); i != potOnRamps.end(); ++i) {
82  buildOnRamp(*i, nc, ec, dc, rampLength, dontSplit, incremented);
83  }
84  for (std::set<NBNode*>::const_iterator i = potOffRamps.begin(); i != potOffRamps.end(); ++i) {
85  buildOffRamp(*i, nc, ec, dc, rampLength, dontSplit, incremented);
86  }
87  }
88  // check whether on-off ramps shall be guessed
89  if (oc.isSet("ramps.set")) {
90  std::vector<std::string> edges = oc.getStringVector("ramps.set");
91  NBNodeCont& nc = nb.getNodeCont();
92  NBEdgeCont& ec = nb.getEdgeCont();
94  for (std::vector<std::string>::iterator i = edges.begin(); i != edges.end(); ++i) {
95  NBEdge* e = ec.retrieve(*i);
96  if (e == 0) {
97  WRITE_WARNING("Can not build on ramp on edge '" + *i + "' - the edge is not known.");
98  continue;
99  }
100  NBNode* from = e->getFromNode();
101  if (from->getIncomingEdges().size() == 2 && from->getOutgoingEdges().size() == 1) {
102  buildOnRamp(from, nc, ec, dc, rampLength, dontSplit, incremented);
103  }
104  // load edge again to check offramps
105  e = ec.retrieve(*i);
106  if (e == 0) {
107  WRITE_WARNING("Can not build off ramp on edge '" + *i + "' - the edge is not known.");
108  continue;
109  }
110  NBNode* to = e->getToNode();
111  if (to->getIncomingEdges().size() == 1 && to->getOutgoingEdges().size() == 2) {
112  buildOffRamp(to, nc, ec, dc, rampLength, dontSplit, incremented);
113  }
114  }
115  }
116 }
117 
118 
119 bool
120 NBRampsComputer::mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) {
121  if (cur->getOutgoingEdges().size() != 1 || cur->getIncomingEdges().size() != 2) {
122  return false;
123  }
124  NBEdge* potHighway, *potRamp, *cont;
125  getOnRampEdges(cur, &potHighway, &potRamp, &cont);
126  // may be an on-ramp
127  return fulfillsRampConstraints(potHighway, potRamp, cont, minHighwaySpeed, maxRampSpeed);
128 }
129 
130 
131 bool
132 NBRampsComputer::mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) {
133  if (cur->getIncomingEdges().size() != 1 || cur->getOutgoingEdges().size() != 2) {
134  return false;
135  }
136  // may be an off-ramp
137  NBEdge* potHighway, *potRamp, *prev;
138  getOffRampEdges(cur, &potHighway, &potRamp, &prev);
139  return fulfillsRampConstraints(potHighway, potRamp, prev, minHighwaySpeed, maxRampSpeed);
140 }
141 
142 
143 void
144 NBRampsComputer::buildOnRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set<NBEdge*>& incremented) {
145  NBEdge* potHighway, *potRamp, *cont;
146  getOnRampEdges(cur, &potHighway, &potRamp, &cont);
147  // compute the number of lanes to append
148  const unsigned int firstLaneNumber = cont->getNumLanes();
149  int toAdd = (potRamp->getNumLanes() + potHighway->getNumLanes()) - firstLaneNumber;
150  NBEdge* first = cont;
151  NBEdge* last = cont;
152  NBEdge* curr = cont;
153  if (toAdd > 0 && find(incremented.begin(), incremented.end(), cont) == incremented.end()) {
154  SUMOReal currLength = 0;
155  while (curr != 0 && currLength + curr->getGeometry().length() - POSITION_EPS < rampLength) {
156  if (find(incremented.begin(), incremented.end(), curr) == incremented.end()) {
157  curr->incLaneNo(toAdd);
158  curr->invalidateConnections(true);
159  incremented.insert(curr);
160  moveRampRight(curr, toAdd);
161  currLength += curr->getLength(); // !!! loaded length?
162  last = curr;
163  }
164  NBNode* nextN = curr->getToNode();
165  if (nextN->getOutgoingEdges().size() == 1) {
166  curr = nextN->getOutgoingEdges()[0];
167  if (curr->getNumLanes() != firstLaneNumber) {
168  // the number of lanes changes along the computation; we'll stop...
169  curr = 0;
170  } else if (curr->isTurningDirectionAt(last)) {
171  // turnarounds certainly should not be included in a ramp
172  curr = 0;
173  } else if (curr == potHighway || curr == potRamp) {
174  // circular connectivity. do not split!
175  curr = 0;
176  }
177  } else {
178  // ambigous; and, in fact, what should it be? ...stop
179  curr = 0;
180  }
181  }
182  // check whether a further split is necessary
183  if (curr != 0 && !dontSplit && currLength - POSITION_EPS < rampLength && curr->getNumLanes() == firstLaneNumber && find(incremented.begin(), incremented.end(), curr) == incremented.end()) {
184  // there is enough place to build a ramp; do it
185  bool wasFirst = first == curr;
186  NBNode* rn = new NBNode(curr->getID() + "-AddedOnRampNode", curr->getGeometry().positionAtOffset(rampLength - currLength));
187  if (!nc.insert(rn)) {
188  throw ProcessError("Ups - could not build on-ramp for edge '" + curr->getID() + "' (node could not be build)!");
189  }
190  std::string name = curr->getID();
191  bool ok = ec.splitAt(dc, curr, rn, curr->getID() + ADDED_ON_RAMP_EDGE, curr->getID(), curr->getNumLanes() + toAdd, curr->getNumLanes());
192  if (!ok) {
193  WRITE_ERROR("Ups - could not build on-ramp for edge '" + curr->getID() + "'!");
194  return;
195  }
196  //ec.retrieve(name)->invalidateConnections();
197  curr = ec.retrieve(name + ADDED_ON_RAMP_EDGE);
198  incremented.insert(curr);
199  last = curr;
200  moveRampRight(curr, toAdd);
201  if (wasFirst) {
202  first = curr;
203  }
204  }
205  if (curr == cont && dontSplit) {
206  WRITE_WARNING("Could not build on-ramp for edge '" + curr->getID() + "' due to option '--ramps.no-split'");
207  return;
208  }
209  }
210  // set connections from ramp/highway to added ramp
211  if (!potHighway->addLane2LaneConnections(0, first, potRamp->getNumLanes(), MIN2(first->getNumLanes() - potRamp->getNumLanes(), potHighway->getNumLanes()), NBEdge::L2L_VALIDATED, true, true)) {
212  throw ProcessError("Could not set connection!");
213  }
214  if (!potRamp->addLane2LaneConnections(0, first, 0, potRamp->getNumLanes(), NBEdge::L2L_VALIDATED, true, true)) {
215  throw ProcessError("Could not set connection!");
216  }
217  // patch ramp geometry
218  PositionVector p = potRamp->getGeometry();
219  p.pop_back();
220  p.push_back(first->getLaneShape(0)[0]);
221  potRamp->setGeometry(p);
222 }
223 
224 
225 void
226 NBRampsComputer::buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set<NBEdge*>& incremented) {
227  NBEdge* potHighway, *potRamp, *prev;
228  getOffRampEdges(cur, &potHighway, &potRamp, &prev);
229  // compute the number of lanes to append
230  const unsigned int firstLaneNumber = prev->getNumLanes();
231  int toAdd = (potRamp->getNumLanes() + potHighway->getNumLanes()) - firstLaneNumber;
232  NBEdge* first = prev;
233  NBEdge* last = prev;
234  NBEdge* curr = prev;
235  if (toAdd > 0 && find(incremented.begin(), incremented.end(), prev) == incremented.end()) {
236  SUMOReal currLength = 0;
237  while (curr != 0 && currLength + curr->getGeometry().length() - POSITION_EPS < rampLength) {
238  if (find(incremented.begin(), incremented.end(), curr) == incremented.end()) {
239  curr->incLaneNo(toAdd);
240  curr->invalidateConnections(true);
241  incremented.insert(curr);
242  moveRampRight(curr, toAdd);
243  currLength += curr->getLength(); // !!! loaded length?
244  last = curr;
245  }
246  NBNode* prevN = curr->getFromNode();
247  if (prevN->getIncomingEdges().size() == 1) {
248  curr = prevN->getIncomingEdges()[0];
249  if (curr->getNumLanes() != firstLaneNumber) {
250  // the number of lanes changes along the computation; we'll stop...
251  curr = 0;
252  } else if (last->isTurningDirectionAt(curr)) {
253  // turnarounds certainly should not be included in a ramp
254  curr = 0;
255  } else if (curr == potHighway || curr == potRamp) {
256  // circular connectivity. do not split!
257  curr = 0;
258  }
259  } else {
260  // ambigous; and, in fact, what should it be? ...stop
261  curr = 0;
262  }
263  }
264  // check whether a further split is necessary
265  if (curr != 0 && !dontSplit && currLength - POSITION_EPS < rampLength && curr->getNumLanes() == firstLaneNumber && find(incremented.begin(), incremented.end(), curr) == incremented.end()) {
266  // there is enough place to build a ramp; do it
267  bool wasFirst = first == curr;
268  Position pos = curr->getGeometry().positionAtOffset(curr->getGeometry().length() - (rampLength - currLength));
269  NBNode* rn = new NBNode(curr->getID() + "-AddedOffRampNode", pos);
270  if (!nc.insert(rn)) {
271  throw ProcessError("Ups - could not build on-ramp for edge '" + curr->getID() + "' (node could not be build)!");
272  }
273  std::string name = curr->getID();
274  bool ok = ec.splitAt(dc, curr, rn, curr->getID(), curr->getID() + "-AddedOffRampEdge", curr->getNumLanes(), curr->getNumLanes() + toAdd);
275  if (!ok) {
276  WRITE_ERROR("Ups - could not build on-ramp for edge '" + curr->getID() + "'!");
277  return;
278  }
279  curr = ec.retrieve(name + "-AddedOffRampEdge");
280  incremented.insert(curr);
281  last = curr;
282  moveRampRight(curr, toAdd);
283  if (wasFirst) {
284  first = curr;
285  }
286  }
287  if (curr == prev && dontSplit) {
288  WRITE_WARNING("Could not build off-ramp for edge '" + curr->getID() + "' due to option '--ramps.no-split'");
289  return;
290  }
291  }
292  // set connections from added ramp to ramp/highway
293  if (!first->addLane2LaneConnections(potRamp->getNumLanes(), potHighway, 0, MIN2(first->getNumLanes() - 1, potHighway->getNumLanes()), NBEdge::L2L_VALIDATED, true)) {
294  throw ProcessError("Could not set connection!");
295  }
296  if (!first->addLane2LaneConnections(0, potRamp, 0, potRamp->getNumLanes(), NBEdge::L2L_VALIDATED, false)) {
297  throw ProcessError("Could not set connection!");
298  }
299  // patch ramp geometry
300  PositionVector p = potRamp->getGeometry();
301  p.pop_front();
302  p.push_front(first->getLaneShape(0)[-1]);
303  potRamp->setGeometry(p);
304 }
305 
306 
307 void
308 NBRampsComputer::moveRampRight(NBEdge* ramp, int addedLanes) {
309  if (ramp->getLaneSpreadFunction() != LANESPREAD_CENTER) {
310  return;
311  }
312  try {
313  PositionVector g = ramp->getGeometry();
314  const SUMOReal offset = (0.5 * addedLanes *
316  g.move2side(offset);
317  ramp->setGeometry(g);
318  } catch (InvalidArgument&) {
319  WRITE_WARNING("For edge '" + ramp->getID() + "': could not compute shape.");
320  }
321 }
322 
323 
324 bool
326  if (fabs((*potHighway)->getSpeed() - (*potRamp)->getSpeed()) < .1) {
327  return false;
328  }
329  if ((*potHighway)->getSpeed() < (*potRamp)->getSpeed()) {
330  std::swap(*potHighway, *potRamp);
331  }
332  return true;
333 }
334 
335 
336 bool
338  if ((*potHighway)->getNumLanes() == (*potRamp)->getNumLanes()) {
339  return false;
340  }
341  if ((*potHighway)->getNumLanes() < (*potRamp)->getNumLanes()) {
342  std::swap(*potHighway, *potRamp);
343  }
344  return true;
345 }
346 
347 
348 void
349 NBRampsComputer::getOnRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other) {
350  *other = n->getOutgoingEdges()[0];
351  const std::vector<NBEdge*>& edges = n->getIncomingEdges();
352  assert(edges.size() == 2);
353  *potHighway = edges[0];
354  *potRamp = edges[1];
355  /*
356  // heuristic: highway is faster than ramp
357  if(determinedBySpeed(potHighway, potRamp)) {
358  return;
359  }
360  // heuristic: highway has more lanes than ramp
361  if(determinedByLaneNumber(potHighway, potRamp)) {
362  return;
363  }
364  */
365  // heuristic: ramp comes from right
366  const std::vector<NBEdge*>& edges2 = n->getEdges();
367  std::vector<NBEdge*>::const_iterator i = std::find(edges2.begin(), edges2.end(), *other);
368  NBContHelper::nextCW(edges2, i);
369  if ((*i) == *potHighway) {
370  std::swap(*potHighway, *potRamp);
371  }
372 }
373 
374 
375 void
376 NBRampsComputer::getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other) {
377  *other = n->getIncomingEdges()[0];
378  const std::vector<NBEdge*>& edges = n->getOutgoingEdges();
379  *potHighway = edges[0];
380  *potRamp = edges[1];
381  assert(edges.size() == 2);
382  /*
383  // heuristic: highway is faster than ramp
384  if(determinedBySpeed(potHighway, potRamp)) {
385  return;
386  }
387  // heuristic: highway has more lanes than ramp
388  if(determinedByLaneNumber(potHighway, potRamp)) {
389  return;
390  }
391  */
392  // heuristic: ramp goes to right
393  const std::vector<NBEdge*>& edges2 = n->getEdges();
394  std::vector<NBEdge*>::const_iterator i = std::find(edges2.begin(), edges2.end(), *other);
395  NBContHelper::nextCW(edges2, i);
396  if ((*i) == *potRamp) {
397  std::swap(*potHighway, *potRamp);
398  }
399 }
400 
401 
402 bool
404  NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) {
405  // do not build ramps on rail edges
406  if (isRailway(potHighway->getPermissions()) || isRailway(potRamp->getPermissions())) {
407  return false;
408  }
409  // do not build ramps on connectors
410  if (potHighway->isMacroscopicConnector() || potRamp->isMacroscopicConnector() || other->isMacroscopicConnector()) {
411  return false;
412  }
413  // check whether a lane is missing
414  if (potHighway->getNumLanes() + potRamp->getNumLanes() <= other->getNumLanes()) {
415  return false;
416  }
417  // is it really a highway?
418  SUMOReal maxSpeed = MAX3(potHighway->getSpeed(), other->getSpeed(), potRamp->getSpeed());
419  if (maxSpeed < minHighwaySpeed) {
420  return false;
421  }
422  // is any of the connections a turnaround?
423  if (other->getToNode() == potHighway->getFromNode()) {
424  // off ramp
425  if (other->isTurningDirectionAt(potHighway) ||
426  other->isTurningDirectionAt(potRamp)) {
427  return false;
428  }
429  } else {
430  // on ramp
431  if (other->isTurningDirectionAt(potHighway) ||
432  other->isTurningDirectionAt(potRamp)) {
433  return false;
434  }
435  }
436  /*
437  if (potHighway->getSpeed() < minHighwaySpeed || other->getSpeed() < minHighwaySpeed) {
438  return false;
439  }
440  */
441  // is it really a ramp?
442  if (maxRampSpeed > 0 && maxRampSpeed < potRamp->getSpeed()) {
443  return false;
444  }
445  return true;
446 }
447 
448 
449 /****************************************************************************/
450 
void invalidateConnections(bool reallowSetting=false)
Definition: NBEdge.cpp:896
const PositionVector & getLaneShape(unsigned int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:510
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's incoming edges.
Definition: NBNode.h:251
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:201
const SUMOReal SUMO_const_laneWidth
Definition: StdDefs.h:46
static bool determinedBySpeed(NBEdge **potHighway, NBEdge **potRamp)
static bool mayNeedOnRamp(NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
Determines whether the given node may be an on-ramp begin.
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
void incLaneNo(unsigned int by)
Definition: NBEdge.cpp:2069
A container for districts.
bool addLane2LaneConnections(unsigned int fromLane, NBEdge *dest, unsigned int toLane, unsigned int no, Lane2LaneInfoType type, bool invalidatePrevious=false, bool mayDefinitelyPass=false)
Builds no connections starting at the given lanes.
Definition: NBEdge.cpp:671
SUMOReal getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:449
bool splitAt(NBDistrictCont &dc, NBEdge *edge, NBNode *node)
Splits the edge at the position nearest to the given node.
Definition: NBEdgeCont.cpp:404
static void moveRampRight(NBEdge *ramp, int addedLanes)
Moves the ramp to the right, as new lanes were added.
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)
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition: NBEdge.cpp:413
T MAX3(T a, T b, T c)
Definition: StdDefs.h:88
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
static void buildOnRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, SUMOReal rampLength, bool dontSplit, std::set< NBEdge * > &incremented)
Builds an on-ramp starting at the given node.
The connection was computed and validated.
Definition: NBEdge.h:116
static bool determinedByLaneNumber(NBEdge **potHighway, NBEdge **potRamp)
static const std::string ADDED_ON_RAMP_EDGE
suffix for newly generated on-ramp edges
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
Definition: NBNode.h:259
const std::string & getID() const
Returns the id.
Definition: Named.h:60
static void buildOffRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, SUMOReal rampLength, bool dontSplit, std::set< NBEdge * > &incremented)
Builds an off-ramp ending at the given node.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
Position pop_front()
Removes and returns the position at the fron of the list.
NBEdgeCont & getEdgeCont()
Returns the edge container.
Definition: NBNetBuilder.h:154
A list of positions.
void push_front(const Position &p)
Puts the given position at the front of the list.
unsigned int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:347
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:1756
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
Definition: NBNode.h:267
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
T MIN2(T a, T b)
Definition: StdDefs.h:68
#define POSITION_EPS
Definition: config.h:189
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Definition: NBNodeCont.h:135
static bool mayNeedOffRamp(NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
Determines whether the given node may be an off-ramp end.
#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:2255
SUMOReal length() const
Returns the length.
static bool fulfillsRampConstraints(NBEdge *potHighway, NBEdge *potRamp, NBEdge *other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
Checks whether an on-/off-ramp can be bult here.
void push_back(const PositionVector &p)
Appends all positions from the given vector.
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:371
static void computeRamps(NBNetBuilder &nb, OptionsCont &oc)
Computes highway on-/off-ramps (if wished)
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
Definition: NBEdgeCont.cpp:258
static void getOffRampEdges(NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
NBNodeCont & getNodeCont()
Returns the node container.
Definition: NBNetBuilder.h:162
Instance responsible for building networks.
Definition: NBNetBuilder.h:113
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:531
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Definition: NBEdge.h:859
A storage for options typed value containers)
Definition: OptionsCont.h:108
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
Definition: NBNodeCont.cpp:79
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.h:611
Represents a single node (junction) during network building.
Definition: NBNode.h:75
static void getOnRampEdges(NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
void move2side(SUMOReal amount)
#define SUMOReal
Definition: config.h:218
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:431
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:64
NBDistrictCont & getDistrictCont()
Returns the districts container.
Definition: NBNetBuilder.h:186
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
Definition: NBNodeCont.h:127
SUMOReal getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:406
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:363