SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBNetBuilder.cpp
Go to the documentation of this file.
1 /****************************************************************************/
12 // Instance responsible for building networks
13 /****************************************************************************/
14 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
15 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <fstream>
38 #include "NBNetBuilder.h"
39 #include "NBNodeCont.h"
40 #include "NBEdgeCont.h"
42 #include "NBDistrictCont.h"
43 #include "NBDistrict.h"
44 #include "NBDistribution.h"
45 #include "NBRequest.h"
46 #include "NBTypeCont.h"
51 #include <utils/common/ToString.h>
53 #include "NBAlgorithms.h"
54 #include "NBAlgorithms_Ramps.h"
55 
56 #ifdef HAVE_INTERNAL
57 #include <internal/HeightMapper.h>
58 #endif
59 
60 #ifdef CHECK_MEMORY_LEAKS
61 #include <foreign/nvwa/debug_new.h>
62 #endif // CHECK_MEMORY_LEAKS
63 
64 
65 // ===========================================================================
66 // method definitions
67 // ===========================================================================
69  myEdgeCont(myTypeCont),
70  myHaveSeenRoundabouts(false)
71 {}
72 
73 
75 
76 
77 void
79  // we possibly have to load the edges to keep
80  if (oc.isSet("keep-edges.input-file")) {
81  std::ifstream strm(oc.getString("keep-edges.input-file").c_str());
82  if (!strm.good()) {
83  throw ProcessError("Could not load names of edges too keep from '" + oc.getString("keep-edges.input-file") + "'.");
84  }
85  std::ostringstream oss;
86  bool first = true;
87  while (strm.good()) {
88  if (!first) {
89  oss << ',';
90  }
91  std::string name;
92  strm >> name;
93  oss << name;
94  first = false;
95  }
96  oc.set("keep-edges.explicit", oss.str());
97  }
98  // apply options to type control
99  myTypeCont.setDefaults(oc.getInt("default.lanenumber"), oc.getFloat("default.speed"), oc.getInt("default.priority"));
100  // apply options to edge control
102  // apply options to traffic light logics control
104 }
105 
106 
107 void
109  const std::set<std::string>& explicitTurnarounds,
110  bool removeElements) {
111  GeoConvHelper& geoConvHelper = GeoConvHelper::getProcessing();
112 
113 
114  // MODIFYING THE SETS OF NODES AND EDGES
115 
116  // Removes edges that are connecting the same node
117  PROGRESS_BEGIN_MESSAGE("Removing self-loops");
120  //
121  if (oc.exists("remove-edges.isolated") && oc.getBool("remove-edges.isolated")) {
122  PROGRESS_BEGIN_MESSAGE("Finding isolated roads");
125  }
126  //
127  if (oc.exists("keep-edges.postload") && oc.getBool("keep-edges.postload")) {
128  if (oc.isSet("keep-edges.explicit")) {
129  PROGRESS_BEGIN_MESSAGE("Removing unwished edges");
132  }
133  }
134  // join junctions (may create new "geometry"-nodes so it needs to come before removing these
135  if (oc.exists("junctions.join-exclude") && oc.isSet("junctions.join-exclude")) {
136  myNodeCont.addJoinExclusion(oc.getStringVector("junctions.join-exclude"));
137  }
139  if (oc.getBool("junctions.join")) {
140  PROGRESS_BEGIN_MESSAGE("Joining junction clusters");
141  // preliminary geometry computations to determine the length of edges
142  // This depends on turning directions and sorting of edge list
143  // in case junctions are joined geometry computations have to be repeated
146  myNodeCont.computeNodeShapes(oc.getBool("lefthand"));
148  // preliminary roundabout computations to avoid destroying roundabouts
149  if (oc.getBool("roundabouts.guess") || (oc.isDefault("roundabouts.guess") && myHaveSeenRoundabouts)) {
150  assert(myRoundabouts.size() == 0);
152  for (std::vector<EdgeVector>::const_iterator it_round = myRoundabouts.begin();
153  it_round != myRoundabouts.end(); ++it_round) {
154  std::vector<std::string> nodeIDs;
155  for (EdgeVector::const_iterator it_edge = it_round->begin(); it_edge != it_round->end(); ++it_edge) {
156  nodeIDs.push_back((*it_edge)->getToNode()->getID());
157  }
158  myNodeCont.addJoinExclusion(nodeIDs);
159  }
160  myRoundabouts.clear();
161  }
162  numJoined += myNodeCont.joinJunctions(oc.getFloat("junctions.join-dist"), myDistrictCont, myEdgeCont, myTLLCont);
163  // reset geometry to avoid influencing subsequent steps (ramps.guess)
164  myEdgeCont.computeLaneShapes();
166  }
167  if (numJoined > 0) {
168  // bit of a misnomer since we're already done
169  WRITE_MESSAGE(" Joined " + toString(numJoined) + " junction cluster(s).");
170  }
171  //
172  if (removeElements) {
173  unsigned int no = 0;
174  const bool removeGeometryNodes = oc.exists("geometry.remove") && oc.getBool("geometry.remove");
175  PROGRESS_BEGIN_MESSAGE("Removing empty nodes" + std::string(removeGeometryNodes ? " and geometry nodes" : ""));
178  WRITE_MESSAGE(" " + toString(no) + " nodes removed.");
179  }
180 
181  // MOVE TO ORIGIN
182  // compute new boundary after network modifications have taken place
183  Boundary boundary;
184  for (std::map<std::string, NBNode*>::const_iterator it = myNodeCont.begin(); it != myNodeCont.end(); ++it) {
185  boundary.add(it->second->getPosition());
186  }
187  for (std::map<std::string, NBEdge*>::const_iterator it = myEdgeCont.begin(); it != myEdgeCont.end(); ++it) {
188  boundary.add(it->second->getGeometry().getBoxBoundary());
189  }
190  geoConvHelper.setConvBoundary(boundary);
191 
192  if (!oc.getBool("offset.disable-normalization") && oc.isDefault("offset.x") && oc.isDefault("offset.y")) {
193  moveToOrigin(geoConvHelper);
194  }
195  geoConvHelper.computeFinal(); // information needed for location element fixed at this point
196 
197  if (oc.exists("geometry.min-dist") && oc.isSet("geometry.min-dist")) {
198  PROGRESS_BEGIN_MESSAGE("Reducing geometries");
199  myEdgeCont.reduceGeometries(oc.getFloat("geometry.min-dist"));
201  }
202  // @note: removing geometry can create similar edges so joinSimilarEdges must come afterwards
203  // @note: likewise splitting can destroy similarities so joinSimilarEdges must come before
204  if (removeElements) {
205  PROGRESS_BEGIN_MESSAGE("Joining similar edges");
209  }
210  //
211  if (oc.exists("geometry.split") && oc.getBool("geometry.split")) {
212  PROGRESS_BEGIN_MESSAGE("Splitting geometry edges");
215  }
216  // guess ramps
217  if ((oc.exists("ramps.guess") && oc.getBool("ramps.guess")) || (oc.exists("ramps.set") && oc.isSet("ramps.set"))) {
218  PROGRESS_BEGIN_MESSAGE("Guessing and setting on-/off-ramps");
222  }
223 
224  // check whether any not previously setable connections may be set now
226  //
227  if (oc.exists("geometry.max-angle")) {
229  oc.getFloat("geometry.max-angle"),
230  oc.getFloat("geometry.min-radius"),
231  oc.getBool("geometry.min-radius.fix"));
232  }
233  //
235 
236  // APPLY SPEED MODIFICATIONS
237  if (oc.exists("speed.offset")) {
238  const SUMOReal speedOffset = oc.getFloat("speed.offset");
239  const SUMOReal speedFactor = oc.getFloat("speed.factor");
240  if (speedOffset != 0 || speedFactor != 1) {
241  PROGRESS_BEGIN_MESSAGE("Applying speed modifications");
242  for (std::map<std::string, NBEdge*>::const_iterator i = myEdgeCont.begin(); i != myEdgeCont.end(); ++i) {
243  (*i).second->setSpeed(-1, (*i).second->getSpeed() * speedFactor + speedOffset);
244  }
246  }
247  }
248 
249  // CONNECTIONS COMPUTATION
250  //
251  PROGRESS_BEGIN_MESSAGE("Computing turning directions");
254  //
255  PROGRESS_BEGIN_MESSAGE("Sorting nodes' edges");
258  //
259  PROGRESS_BEGIN_MESSAGE("Computing node types");
262  //
263  PROGRESS_BEGIN_MESSAGE("Computing priorities");
266  //
267  PROGRESS_BEGIN_MESSAGE("Computing approached edges");
268  myEdgeCont.computeEdge2Edges(oc.getBool("no-left-connections"));
270  //
271  if (oc.getBool("roundabouts.guess") || (oc.isDefault("roundabouts.guess") && myHaveSeenRoundabouts)) {
272  PROGRESS_BEGIN_MESSAGE("Guessing and setting roundabouts");
275  }
276  //
277  PROGRESS_BEGIN_MESSAGE("Computing approaching lanes");
280  //
281  PROGRESS_BEGIN_MESSAGE("Dividing of lanes on approached lanes");
285  //
286  PROGRESS_BEGIN_MESSAGE("Processing turnarounds");
287  if (!oc.getBool("no-turnarounds")) {
288  myEdgeCont.appendTurnarounds(oc.getBool("no-turnarounds.tls"));
289  } else {
290  myEdgeCont.appendTurnarounds(explicitTurnarounds, oc.getBool("no-turnarounds.tls"));
291  }
293  //
294  PROGRESS_BEGIN_MESSAGE("Rechecking of lane endings");
297 
298 
299  // GEOMETRY COMPUTATION
300  //
301  PROGRESS_BEGIN_MESSAGE("Computing node shapes");
302  myNodeCont.computeNodeShapes(oc.getBool("lefthand"));
304  //
305  PROGRESS_BEGIN_MESSAGE("Computing edge shapes");
308 
309 
310  // GUESS TLS POSITIONS
311  PROGRESS_BEGIN_MESSAGE("Assigning nodes to traffic lights");
312  if (oc.isSet("tls.set")) {
313  std::vector<std::string> tlControlledNodes = oc.getStringVector("tls.set");
315  for (std::vector<std::string>::const_iterator i = tlControlledNodes.begin(); i != tlControlledNodes.end(); ++i) {
316  NBNode* node = myNodeCont.retrieve(*i);
317  if (node == 0) {
318  WRITE_WARNING("Building a tl-logic for node '" + *i + "' is not possible." + "\n The node '" + *i + "' is not known.");
319  } else {
321  }
322  }
323  }
326  //
327  if (oc.getBool("tls.join")) {
328  PROGRESS_BEGIN_MESSAGE("Joining traffic light nodes");
329  myNodeCont.joinTLS(myTLLCont, oc.getFloat("tls.join-dist"));
331  }
332 
333 
334  // COMPUTING RIGHT-OF-WAY AND TRAFFIC LIGHT PROGRAMS
335  //
336  PROGRESS_BEGIN_MESSAGE("Computing traffic light control information");
339  //
340  PROGRESS_BEGIN_MESSAGE("Computing node logics");
343  //
344  PROGRESS_BEGIN_MESSAGE("Computing traffic light logics");
345  std::pair<unsigned int, unsigned int> numbers = myTLLCont.computeLogics(myEdgeCont, oc);
347  std::string progCount = "";
348  if (numbers.first != numbers.second) {
349  progCount = "(" + toString(numbers.second) + " programs) ";
350  }
351  WRITE_MESSAGE(" " + toString(numbers.first) + " traffic light(s) " + progCount + "computed.");
352  //
353  if (oc.isSet("street-sign-output")) {
354  PROGRESS_BEGIN_MESSAGE("Generating street signs");
357  }
358 
359  // FINISHING INNER EDGES
360  if (!oc.getBool("no-internal-links")) {
361  PROGRESS_BEGIN_MESSAGE("Building inner edges");
362  for (std::map<std::string, NBEdge*>::const_iterator i = myEdgeCont.begin(); i != myEdgeCont.end(); ++i) {
363  (*i).second->sortOutgoingConnectionsByIndex();
364  }
365  for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
366  (*i).second->buildInnerEdges();
367  }
369  }
370 
371 
372  // report
373  WRITE_MESSAGE("-----------------------------------------------------");
374  WRITE_MESSAGE("Summary:");
376  WRITE_MESSAGE(" Network boundaries:");
377  WRITE_MESSAGE(" Original boundary : " + toString(geoConvHelper.getOrigBoundary()));
378  WRITE_MESSAGE(" Applied offset : " + toString(geoConvHelper.getOffsetBase()));
379  WRITE_MESSAGE(" Converted boundary : " + toString(geoConvHelper.getConvBoundary()));
380  WRITE_MESSAGE("-----------------------------------------------------");
382  // report on very large networks
383  if (MAX2(geoConvHelper.getConvBoundary().xmax(), geoConvHelper.getConvBoundary().ymax()) > 1000000 ||
384  MIN2(geoConvHelper.getConvBoundary().xmin(), geoConvHelper.getConvBoundary().ymin()) < -1000000) {
385  WRITE_WARNING("Network contains very large coordinates and will probably flicker in the GUI. Check for outlying nodes and make sure the network is shifted to the coordinate origin");
386  }
387 }
388 
389 
390 void
392  PROGRESS_BEGIN_MESSAGE("Moving network to origin");
393  Boundary boundary = geoConvHelper.getConvBoundary();
394  const SUMOReal x = -boundary.xmin();
395  const SUMOReal y = -boundary.ymin();
396  for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
397  (*i).second->reshiftPosition(x, y);
398  }
399  for (std::map<std::string, NBEdge*>::const_iterator i = myEdgeCont.begin(); i != myEdgeCont.end(); ++i) {
400  (*i).second->reshiftPosition(x, y);
401  }
402  for (std::map<std::string, NBDistrict*>::const_iterator i = myDistrictCont.begin(); i != myDistrictCont.end(); ++i) {
403  (*i).second->reshiftPosition(x, y);
404  }
405  geoConvHelper.moveConvertedBy(x, y);
407 }
408 
409 
410 bool
411 NBNetBuilder::transformCoordinates(Position& from, bool includeInBoundary, GeoConvHelper* from_srs) {
412  Position orig(from);
413  bool ok = GeoConvHelper::getProcessing().x2cartesian(from, includeInBoundary);
414 #ifdef HAVE_INTERNAL
415  if (ok) {
416  const HeightMapper& hm = HeightMapper::get();
417  if (hm.ready()) {
418  if (from_srs != 0 && from_srs->usingGeoProjection()) {
419  from_srs->cartesian2geo(orig);
420  }
421  SUMOReal z = hm.getZ(orig);
422  from = Position(from.x(), from.y(), z);
423  }
424  }
425 #else
426  UNUSED_PARAMETER(from_srs);
427 #endif
428  return ok;
429 }
430 
431 
432 bool
433 NBNetBuilder::transformCoordinates(PositionVector& from, bool includeInBoundary, GeoConvHelper* from_srs) {
434  const SUMOReal maxLength = OptionsCont::getOptions().getFloat("geometry.max-segment-length");
435  if (maxLength > 0 && from.size() > 1) {
436  // transformation to cartesian coordinates must happen before we can check segment length
437  PositionVector copy = from;
438  for (int i = 0; i < (int) from.size(); i++) {
439  transformCoordinates(copy[i], false);
440  }
441  // check lengths and insert new points where needed (in the original
442  // coordinate system)
443  int inserted = 0;
444  for (int i = 0; i < (int)copy.size() - 1; i++) {
445  Position start = from[i + inserted];
446  Position end = from[i + inserted + 1];
447  SUMOReal length = copy[i].distanceTo(copy[i + 1]);
448  const Position step = (end - start) * (maxLength / length);
449  int steps = 0;
450  while (length > maxLength) {
451  length -= maxLength;
452  steps++;
453  from.insertAt(i + inserted + 1, start + (step * steps));
454  inserted++;
455  }
456  }
457  // now perform the transformation again so that height mapping can be
458  // performed for the new points
459  }
460  bool ok = true;
461  for (int i = 0; i < (int) from.size(); i++) {
462  ok = ok && transformCoordinates(from[i], includeInBoundary, from_srs);
463  }
464  return ok;
465 }
466 /****************************************************************************/
void moveToOrigin(GeoConvHelper &geoConvHelper)
shift network so its lower left corner is at 0,0
NBNetBuilder()
Constructor.
NBTypeCont myTypeCont
The used container for street types.
Definition: NBNetBuilder.h:246
void joinSimilarEdges(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc)
Joins edges connecting the same nodes.
Definition: NBNodeCont.cpp:192
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) ...
void removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes self-loop edges (edges where the source and the destination node are the same) ...
Definition: NBNodeCont.cpp:180
void setTLControllingInformation(const NBEdgeCont &ec)
Informs the edges about being controlled by a tls.
void sortOutgoingLanesConnections()
Sorts all lanes of all edges within the container by their direction.
Definition: NBEdgeCont.cpp:566
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
void setConvBoundary(const Boundary &boundary)
sets the converted boundary
static bool transformCoordinates(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
NBJoinedEdgesMap myJoinedEdges
Map of joined edges.
Definition: NBNetBuilder.h:264
void addJoinExclusion(const std::vector< std::string > &ids, bool check=false)
Definition: NBNodeCont.cpp:432
unsigned int removeUnwishedNodes(NBDistrictCont &dc, NBEdgeCont &ec, NBJoinedEdgesMap &je, NBTrafficLightLogicCont &tlc, bool removeGeometryNodes)
Removes &quot;unwished&quot; nodes.
Definition: NBNodeCont.cpp:336
void insertAt(int index, const Position &p)
void compute(OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool removeElements=true)
Performs the network building steps.
~NBNetBuilder()
Destructor.
SUMOReal ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:124
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
Definition: GeoConvHelper.h:97
bool x2cartesian(Position &from, bool includeInBoundary=true)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
SUMOReal xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:112
T MAX2(T a, T b)
Definition: StdDefs.h:63
void generateStreetSigns()
assigns street signs to edges based on toNode types
Definition: NBEdgeCont.cpp:912
unsigned int joinJunctions(SUMOReal maxdist, NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc)
Joins junctions that are very close together.
Definition: NBNodeCont.cpp:490
void recheckPostProcessConnections()
Try to set any stored connections.
Definition: NBEdgeCont.cpp:735
void guessTLs(OptionsCont &oc, NBTrafficLightLogicCont &tlc)
Guesses which junctions or junction clusters shall be controlled by tls.
Definition: NBNodeCont.cpp:702
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
void computeLanes2Edges()
Computes for each edge which lanes approach the next edges.
Definition: NBEdgeCont.cpp:582
bool myHaveSeenRoundabouts
whether a sumo network with roundabout information was loaded
Definition: NBNetBuilder.h:258
SUMOReal x() const
Returns the x-position.
Definition: Position.h:63
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:36
SUMOReal xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:118
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:196
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:67
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
void checkGeometries(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
Definition: NBEdgeCont.cpp:547
void computeLogics(const NBEdgeCont &ec, OptionsCont &oc)
build the list of outgoing edges and lanes
Definition: NBNodeCont.cpp:874
void guessRoundabouts(std::vector< EdgeVector > &marked)
Determines which edges belong to roundabouts and increases their priority.
Definition: NBEdgeCont.cpp:807
static void computeFinal()
compute the location attributes which will be used for output based on the loaded location data...
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static void reportWarnings()
reports warnings if any occured
Definition: NBRequest.cpp:651
void reduceGeometries(const SUMOReal minDist)
Definition: NBEdgeCont.cpp:539
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
Definition: NBEdgeCont.h:198
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:59
void computeLanes2Lanes()
divides the incoming lanes on outgoing lanes
Definition: NBNodeCont.cpp:865
std::map< std::string, NBDistrict * >::const_iterator begin() const
Returns the pointer to the begin of the stored districts.
void removeUnwishedEdges(NBDistrictCont &dc)
Removes unwished edges (not in keep-edges)
Definition: NBEdgeCont.cpp:511
void joinTLS(NBTrafficLightLogicCont &tlc, SUMOReal maxdist)
Builds clusters of tls-controlled junctions and joins the control if possible.
Definition: NBNodeCont.cpp:802
static StringBijection< TrafficLightType > TrafficLightTypes
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
std::map< std::string, NBDistrict * >::const_iterator end() const
Returns the pointer to the end of the stored districts.
static void computeEdgePriorities(NBNodeCont &nc)
Computes edge priorities within a node.
A list of positions.
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
Definition: NBEdgeCont.cpp:84
void setDefaults(int defaultNoLanes, SUMOReal defaultSpeed, int defaultPriority)
Sets the default values.
Definition: NBTypeCont.cpp:50
NBEdgeCont myEdgeCont
The used container for edges.
Definition: NBNetBuilder.h:249
unsigned int joinLoadedClusters(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc)
Joins loaded junction clusters (see NIXMLNodesHandler)
Definition: NBNodeCont.cpp:466
void computeEdge2Edges(bool noLeftMovers)
Computes for each edge the approached edges.
Definition: NBEdgeCont.cpp:574
void computeLaneShapes()
Computes the shapes of all lanes of all edges stored in the container.
Definition: NBEdgeCont.cpp:622
NBTrafficLightLogicCont myTLLCont
The used container for traffic light logics.
Definition: NBNetBuilder.h:252
std::vector< EdgeVector > myRoundabouts
Edges marked as belonging to a roundabout (each EdgeVector is a roundabout)
Definition: NBNetBuilder.h:261
static void computeTurnDirections(NBNodeCont &nc)
Computes turnaround destinations for all edges (if exist)
T MIN2(T a, T b)
Definition: StdDefs.h:57
#define PROGRESS_BEGIN_MESSAGE(msg)
Definition: MsgHandler.h:198
void splitGeometry(NBNodeCont &nc)
Splits edges into multiple if they have a complex geometry.
Definition: NBEdgeCont.cpp:528
const Position getOffsetBase() const
Returns the network base.
std::pair< unsigned int, unsigned int > computeLogics(NBEdgeCont &ec, OptionsCont &oc)
Computes the traffic light logics using the stored definitions and stores the results.
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Definition: NBNodeCont.h:149
const Boundary & getConvBoundary() const
Returns the converted boundary.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:51
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
Definition: NBEdgeCont.h:190
void setAsTLControlled(NBNode *node, NBTrafficLightLogicCont &tlc, TrafficLightType type, std::string id="")
Sets the given node as being controlled by a tls.
Definition: NBNodeCont.cpp:848
T get(const std::string &str)
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:76
static void computeRamps(NBNetBuilder &nb, OptionsCont &oc)
Computes highway on-/off-ramps (if wished)
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
void appendTurnarounds(bool noTLSControlled)
Appends turnarounds to all edges stored in the container.
Definition: NBEdgeCont.cpp:598
static void computeNodeTypes(NBNodeCont &nc)
Computes node types.
void removeIsolatedRoads(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes sequences of edges that are not connected with a junction. Simple roads without junctions som...
Definition: NBNodeCont.cpp:242
SUMOReal y() const
Returns the y-position.
Definition: Position.h:68
A storage for options typed value containers)
Definition: OptionsCont.h:108
void computeNodeShapes(bool leftHand)
Definition: NBNodeCont.cpp:904
void computeEdgeShapes()
Computes the shapes of all edges stored in the container.
Definition: NBEdgeCont.cpp:614
Represents a single node (junction) during network building.
Definition: NBNode.h:74
NBDistrictCont myDistrictCont
The used container for districts.
Definition: NBNetBuilder.h:255
#define SUMOReal
Definition: config.h:215
SUMOReal ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:130
const Boundary & getOrigBoundary() const
Returns the original boundary.
void init(NBEdgeCont &ec)
Initialises the map using the list of edge names.
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Definition: NBNodeCont.cpp:129
void recheckLanes()
Rechecks whether all lanes have a successor for each of the stored edges.
Definition: NBEdgeCont.cpp:590
#define PROGRESS_DONE_MESSAGE()
Definition: MsgHandler.h:199
static void sortNodesEdges(NBNodeCont &nc, bool leftHand)
Sorts a node&#39;s edges clockwise regarding driving direction.
void printBuiltNodesStatistics() const
Prints statistics about built nodes.
Definition: NBNodeCont.cpp:912
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:197
NBNodeCont myNodeCont
The used container for nodes.
Definition: NBNetBuilder.h:243
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
Definition: NBNodeCont.h:141
void moveConvertedBy(SUMOReal x, SUMOReal y)
Shifts the converted boundary by the given amounts.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
TrafficLightType
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.