SUMO - Simulation of Urban MObility
NIXMLConnectionsHandler.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // Importer for edge connections stored in XML
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <iostream>
29 #include <xercesc/sax/HandlerBase.hpp>
30 #include <xercesc/sax/AttributeList.hpp>
31 #include <xercesc/sax/SAXParseException.hpp>
32 #include <xercesc/sax/SAXException.hpp>
34 #include <netbuild/NBEdge.h>
35 #include <netbuild/NBEdgeCont.h>
36 #include <netbuild/NBNodeCont.h>
38 #include <netbuild/NBNode.h>
39 #include <netbuild/NBNetBuilder.h>
43 #include <utils/common/ToString.h>
48 
49 
50 // ===========================================================================
51 // method definitions
52 // ===========================================================================
54  SUMOSAXHandler("xml-connection-description"),
55  myEdgeCont(ec),
56  myNodeCont(nc),
57  myTLLogicCont(tlc),
58  myHaveWarnedAboutDeprecatedLanes(false),
59  myErrorMsgHandler(OptionsCont::getOptions().getBool("ignore-errors.connections") ?
60  MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) {}
61 
62 
64 
65 
66 void
68  const SUMOSAXAttributes& attrs) {
69  if (element == SUMO_TAG_DELETE) {
70  bool ok = true;
71  std::string from = attrs.get<std::string>(SUMO_ATTR_FROM, nullptr, ok);
72  std::string to = attrs.get<std::string>(SUMO_ATTR_TO, nullptr, ok);
73  if (!ok) {
74  return;
75  }
76  // these connections were removed when the edge was deleted
77  if (myEdgeCont.wasRemoved(from) || myEdgeCont.wasRemoved(to)) {
78  return;
79  }
80  NBEdge* fromEdge = myEdgeCont.retrieve(from);
81  NBEdge* toEdge = myEdgeCont.retrieve(to);
82  if (fromEdge == nullptr) {
83  myErrorMsgHandler->inform("The connection-source edge '" + from + "' to reset is not known.");
84  return;
85  }
86  if (toEdge == nullptr) {
87  myErrorMsgHandler->inform("The connection-destination edge '" + to + "' to reset is not known.");
88  return;
89  }
90  if (!fromEdge->isConnectedTo(toEdge) && fromEdge->getStep() >= NBEdge::EDGE2EDGES) {
91  WRITE_WARNING("Target edge '" + toEdge->getID() + "' is not connected with '" + fromEdge->getID() + "'; the connection cannot be reset.");
92  return;
93  }
94  int fromLane = -1; // Assume all lanes are to be reset.
95  int toLane = -1;
96  if (attrs.hasAttribute(SUMO_ATTR_LANE)
98  || attrs.hasAttribute(SUMO_ATTR_TO_LANE)) {
99  if (!parseLaneInfo(attrs, fromEdge, toEdge, &fromLane, &toLane)) {
100  return;
101  }
102  // we could be trying to reset a connection loaded from a sumo net and which has become obsolete.
103  // In this case it's ok to encounter invalid lance indices
104  if (!fromEdge->hasConnectionTo(toEdge, toLane) && fromEdge->getStep() >= NBEdge::LANES2EDGES) {
105  WRITE_WARNING("Edge '" + fromEdge->getID() + "' has no connection to lane " + toString(toLane) + " of edge '" + toEdge->getID() + "'; the connection cannot be reset.");
106  }
107  }
108  fromEdge->removeFromConnections(toEdge, fromLane, toLane, true);
109  }
110 
111  if (element == SUMO_TAG_CONNECTION) {
112  bool ok = true;
113  std::string from = attrs.get<std::string>(SUMO_ATTR_FROM, "connection", ok);
114  std::string to = attrs.getOpt<std::string>(SUMO_ATTR_TO, "connection", ok, "");
115  if (!ok || myEdgeCont.wasIgnored(from) || myEdgeCont.wasIgnored(to)) {
116  return;
117  }
118  // extract edges
119  NBEdge* fromEdge = myEdgeCont.retrieve(from);
120  NBEdge* toEdge = to.length() != 0 ? myEdgeCont.retrieve(to) : nullptr;
121  // check whether they are valid
122  if (fromEdge == nullptr) {
123  myErrorMsgHandler->inform("The connection-source edge '" + from + "' is not known.");
124  return;
125  }
126  if (toEdge == nullptr && to.length() != 0) {
127  myErrorMsgHandler->inform("The connection-destination edge '" + to + "' is not known.");
128  return;
129  }
130  fromEdge->getToNode()->invalidateTLS(myTLLogicCont, true, false);
131  // parse optional lane information
133  parseLaneBound(attrs, fromEdge, toEdge);
134  } else {
135  fromEdge->addEdge2EdgeConnection(toEdge);
136  }
137  }
138  if (element == SUMO_TAG_PROHIBITION) {
139  bool ok = true;
140  std::string prohibitor = attrs.getOpt<std::string>(SUMO_ATTR_PROHIBITOR, nullptr, ok, "");
141  std::string prohibited = attrs.getOpt<std::string>(SUMO_ATTR_PROHIBITED, nullptr, ok, "");
142  if (!ok) {
143  return;
144  }
145  NBConnection prohibitorC = parseConnection("prohibitor", prohibitor);
146  NBConnection prohibitedC = parseConnection("prohibited", prohibited);
147  if (prohibitorC == NBConnection::InvalidConnection || prohibitedC == NBConnection::InvalidConnection) {
148  // something failed
149  return;
150  }
151  NBNode* n = prohibitorC.getFrom()->getToNode();
152  n->addSortedLinkFoes(prohibitorC, prohibitedC);
153  }
154  if (element == SUMO_TAG_CROSSING) {
155  addCrossing(attrs);
156  }
157  if (element == SUMO_TAG_WALKINGAREA) {
158  addWalkingArea(attrs);
159  }
160 }
161 
162 
164 NIXMLConnectionsHandler::parseConnection(const std::string& defRole, const std::string& def) {
165  // split from/to
166  const std::string::size_type div = def.find("->");
167  if (div == std::string::npos) {
168  myErrorMsgHandler->inform("Missing connection divider in " + defRole + " '" + def + "'");
170  }
171  std::string fromDef = def.substr(0, div);
172  std::string toDef = def.substr(div + 2);
173 
174  // retrieve the edges
175  // check whether the definition includes a lane information (do not process it)
176  if (fromDef.find('_') != std::string::npos) {
177  fromDef = fromDef.substr(0, fromDef.find('_'));
178  }
179  if (toDef.find('_') != std::string::npos) {
180  toDef = toDef.substr(0, toDef.find('_'));
181  }
182  // retrieve them now
183  NBEdge* fromE = myEdgeCont.retrieve(fromDef);
184  NBEdge* toE = myEdgeCont.retrieve(toDef);
185  // check
186  if (fromE == nullptr) {
187  myErrorMsgHandler->inform("Could not find edge '" + fromDef + "' in " + defRole + " '" + def + "'");
189  }
190  if (toE == nullptr) {
191  myErrorMsgHandler->inform("Could not find edge '" + toDef + "' in " + defRole + " '" + def + "'");
193  }
194  return NBConnection(fromE, toE);
195 }
196 
197 
198 void
200  if (to == nullptr) {
201  // do nothing if it's a dead end
202  return;
203  }
204  bool ok = true;
205  const bool mayDefinitelyPass = attrs.getOpt<bool>(SUMO_ATTR_PASS, nullptr, ok, false);
206  const bool keepClear = attrs.getOpt<bool>(SUMO_ATTR_KEEP_CLEAR, nullptr, ok, true);
207  const double contPos = attrs.getOpt<double>(SUMO_ATTR_CONTPOS, nullptr, ok, NBEdge::UNSPECIFIED_CONTPOS);
208  const double visibility = attrs.getOpt<double>(SUMO_ATTR_VISIBILITY_DISTANCE, nullptr, ok, NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE);
209  const double speed = attrs.getOpt<double>(SUMO_ATTR_SPEED, nullptr, ok, NBEdge::UNSPECIFIED_SPEED);
210  PositionVector customShape = attrs.getOpt<PositionVector>(SUMO_ATTR_SHAPE, nullptr, ok, PositionVector::EMPTY);
211  if (!NBNetBuilder::transformCoordinates(customShape)) {
212  WRITE_ERROR("Unable to project shape for connection from edge '" + from->getID() + "' to edge '" + to->getID() + "'.");
213  }
214  if (!ok) {
215  return;
216  }
217  // get the begin and the end lane
218  int fromLane;
219  int toLane;
220  try {
221  if (!parseLaneInfo(attrs, from, to, &fromLane, &toLane)) {
222  return;
223  }
224  if (fromLane < 0) {
225  myErrorMsgHandler->inform("Invalid value '" + toString(fromLane) +
226  "' for " + toString(SUMO_ATTR_FROM_LANE) + " in connection from '" +
227  from->getID() + "' to '" + to->getID() + "'.");
228  return;
229  }
230  if (toLane < 0) {
231  myErrorMsgHandler->inform("Invalid value '" + toString(toLane) +
232  "' for " + toString(SUMO_ATTR_TO_LANE) + " in connection from '" +
233  from->getID() + "' to '" + to->getID() + "'.");
234  return;
235  }
236  if (from->hasConnectionTo(to, toLane) && from->getToNode()->getType() != NODETYPE_ZIPPER) {
237  WRITE_WARNING("Target lane '" + to->getLaneID(toLane) + "' is already connected from '" + from->getID() + "'.");
238  }
239  if (!from->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, true, mayDefinitelyPass, keepClear, contPos, visibility, speed, customShape)) {
240  if (OptionsCont::getOptions().getBool("show-errors.connections-first-try")) {
241  WRITE_WARNING("Could not set loaded connection from '" + from->getLaneID(fromLane) + "' to '" + to->getLaneID(toLane) + "'.");
242  }
243  // set as to be re-applied after network processing
244  myEdgeCont.addPostProcessConnection(from->getID(), fromLane, to->getID(), toLane, mayDefinitelyPass, keepClear, contPos, visibility, speed, customShape);
245  }
246  } catch (NumberFormatException&) {
247  myErrorMsgHandler->inform("At least one of the defined lanes was not numeric");
248  }
249  //
250  bool keepUncontrolled = attrs.getOpt<bool>(SUMO_ATTR_UNCONTROLLED, nullptr, ok, false);
251  if (keepUncontrolled) {
252  from->disableConnection4TLS(fromLane, to, toLane);
253  }
254 }
255 
256 bool
258  int* fromLane, int* toLane) {
259  if (attributes.hasAttribute(SUMO_ATTR_LANE)) {
260  return parseDeprecatedLaneDefinition(attributes, fromEdge, toEdge, fromLane, toLane);
261  } else {
262  return parseLaneDefinition(attributes, fromLane, toLane);
263  }
264 }
265 
266 
267 inline bool
269  NBEdge* from, NBEdge* to,
270  int* fromLane, int* toLane) {
271  bool ok = true;
274  WRITE_WARNING("'" + toString(SUMO_ATTR_LANE) + "' is deprecated, please use '" +
276  "' instead.");
277  }
278 
279  std::string laneConn = attributes.get<std::string>(SUMO_ATTR_LANE, nullptr, ok);
280  StringTokenizer st(laneConn, ':');
281  if (!ok || st.size() != 2) {
282  myErrorMsgHandler->inform("Invalid lane to lane connection from '" +
283  from->getID() + "' to '" + to->getID() + "'.");
284  return false; // There was an error.
285  }
286 
287  *fromLane = StringUtils::toIntSecure(st.next(), -1);
288  *toLane = StringUtils::toIntSecure(st.next(), -1);
289 
290  return true; // We succeeded.
291 }
292 
293 
294 inline bool
296  int* fromLane,
297  int* toLane) {
298  bool ok = true;
299  *fromLane = attributes.get<int>(SUMO_ATTR_FROM_LANE, nullptr, ok);
300  *toLane = attributes.get<int>(SUMO_ATTR_TO_LANE, nullptr, ok);
301  return ok;
302 }
303 
304 
305 void
307  bool ok = true;
308  NBNode* node = nullptr;
309  EdgeVector edges;
310  const std::string nodeID = attrs.get<std::string>(SUMO_ATTR_NODE, nullptr, ok);
311  const double width = attrs.getOpt<double>(SUMO_ATTR_WIDTH, nodeID.c_str(), ok, NBEdge::UNSPECIFIED_WIDTH, true);
312  const bool discard = attrs.getOpt<bool>(SUMO_ATTR_DISCARD, nodeID.c_str(), ok, false, true);
313  int tlIndex = attrs.getOpt<int>(SUMO_ATTR_TLLINKINDEX, nullptr, ok, -1);
314  int tlIndex2 = attrs.getOpt<int>(SUMO_ATTR_TLLINKINDEX2, nullptr, ok, -1);
315  std::vector<std::string> edgeIDs;
316  if (!attrs.hasAttribute(SUMO_ATTR_EDGES)) {
317  if (discard) {
318  node = myNodeCont.retrieve(nodeID);
319  if (node == nullptr) {
320  WRITE_ERROR("Node '" + nodeID + "' in crossing is not known.");
321  return;
322  }
323  node->discardAllCrossings(true);
324  return;
325  } else {
326  WRITE_ERROR("No edges specified for crossing at node '" + nodeID + "'.");
327  return;
328  }
329  }
330  SUMOSAXAttributes::parseStringVector(attrs.get<std::string>(SUMO_ATTR_EDGES, nullptr, ok), edgeIDs);
331  if (!ok) {
332  return;
333  }
334  for (std::vector<std::string>::const_iterator it = edgeIDs.begin(); it != edgeIDs.end(); ++it) {
335  NBEdge* edge = myEdgeCont.retrieve(*it);
336  if (edge == nullptr) {
337  WRITE_ERROR("Edge '" + (*it) + "' for crossing at node '" + nodeID + "' is not known.");
338  return;
339  }
340  if (node == nullptr) {
341  if (edge->getToNode()->getID() == nodeID) {
342  node = edge->getToNode();
343  } else if (edge->getFromNode()->getID() == nodeID) {
344  node = edge->getFromNode();
345  } else {
346  WRITE_ERROR("Edge '" + (*it) + "' does not touch node '" + nodeID + "'.");
347  return;
348  }
349  } else {
350  if (edge->getToNode() != node && edge->getFromNode() != node) {
351  WRITE_ERROR("Edge '" + (*it) + "' does not touch node '" + nodeID + "'.");
352  return;
353  }
354  }
355  edges.push_back(edge);
356  }
357  bool priority = attrs.getOpt<bool>(SUMO_ATTR_PRIORITY, nodeID.c_str(), ok, node->isTLControlled(), true);
358  if (node->isTLControlled() && !priority) {
359  // traffic_light nodes should always have priority crossings
360  WRITE_WARNING("Crossing at controlled node '" + nodeID + "' must be prioritized");
361  priority = true;
362  }
363  PositionVector customShape = attrs.getOpt<PositionVector>(SUMO_ATTR_SHAPE, nullptr, ok, PositionVector::EMPTY);
364  if (!NBNetBuilder::transformCoordinates(customShape)) {
365  WRITE_ERROR("Unable to project shape for crossing at node '" + node->getID() + "'.");
366  }
367  if (discard) {
368  node->removeCrossing(edges);
369  } else {
370  if (node->checkCrossingDuplicated(edges)) {
371  WRITE_ERROR("Crossing with edges '" + toString(edges) + "' already exists at node '" + node->getID() + "'.");
372  return;
373  }
374  node->addCrossing(edges, width, priority, tlIndex, tlIndex2, customShape);
375  }
376 }
377 
378 
379 void
381  bool ok = true;
382  NBNode* node = nullptr;
383  EdgeVector edges;
384  const std::string nodeID = attrs.get<std::string>(SUMO_ATTR_NODE, nullptr, ok);
385  std::vector<std::string> edgeIDs;
386  if (!attrs.hasAttribute(SUMO_ATTR_EDGES)) {
387  WRITE_ERROR("No edges specified for walkingArea at node '" + nodeID + "'.");
388  return;
389  }
390  SUMOSAXAttributes::parseStringVector(attrs.get<std::string>(SUMO_ATTR_EDGES, nullptr, ok), edgeIDs);
391  if (!ok) {
392  return;
393  }
394  for (std::vector<std::string>::const_iterator it = edgeIDs.begin(); it != edgeIDs.end(); ++it) {
395  NBEdge* edge = myEdgeCont.retrieve(*it);
396  if (edge == nullptr) {
397  WRITE_ERROR("Edge '" + (*it) + "' for walkingArea at node '" + nodeID + "' is not known.");
398  return;
399  }
400  if (node == nullptr) {
401  if (edge->getToNode()->getID() == nodeID) {
402  node = edge->getToNode();
403  } else if (edge->getFromNode()->getID() == nodeID) {
404  node = edge->getFromNode();
405  } else {
406  WRITE_ERROR("Edge '" + (*it) + "' does not touch node '" + nodeID + "'.");
407  return;
408  }
409  } else {
410  if (edge->getToNode() != node && edge->getFromNode() != node) {
411  WRITE_ERROR("Edge '" + (*it) + "' does not touch node '" + nodeID + "'.");
412  return;
413  }
414  }
415  edges.push_back(edge);
416  }
417  PositionVector customShape = attrs.getOpt<PositionVector>(SUMO_ATTR_SHAPE, nullptr, ok, PositionVector::EMPTY);
418  if (!NBNetBuilder::transformCoordinates(customShape)) {
419  WRITE_ERROR("Unable to project shape for walkingArea at node '" + node->getID() + "'.");
420  }
421  node->addWalkingAreaShape(edges, customShape);
422 }
423 
424 /****************************************************************************/
425 
static const PositionVector EMPTY
empty Vector
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Definition: NBNodeCont.cpp:108
Whether vehicles must keep the junction clear.
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
Definition: NBEdge.h:270
The relationships between edges are computed/loaded.
Definition: NBEdge.h:88
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed) ...
Definition: NBEdge.cpp:1164
void addCrossing(const SUMOSAXAttributes &attrs)
Parses a crossing and updates the referenced node.
static const NBConnection InvalidConnection
Definition: NBConnection.h:121
A container for traffic light definitions and built programs.
bool myHaveWarnedAboutDeprecatedLanes
Information whether we have a deprecated attribute.
static int toIntSecure(const std::string &sData, int def)
converts a string into the integer value described by it
connectio between two lanes
bool parseLaneInfo(const SUMOSAXAttributes &attributes, NBEdge *fromEdge, NBEdge *toEdge, int *fromLane, int *toLane)
Parses information about lane-2-lane connection when it describes a lane-2-lane relationship.
The representation of a single edge during network building.
Definition: NBEdge.h:65
foe visibility distance of a link
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:1281
static bool transformCoordinates(PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
NBEdge * getFrom() const
returns the from-edge (start of the connection)
void parseLaneBound(const SUMOSAXAttributes &attrs, NBEdge *from, NBEdge *to)
Parses a connection when it describes a lane-2-lane relationship.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const std::string & getID() const
Returns the id.
Definition: Named.h:78
SAX-handler base for SUMO-files.
bool parseLaneDefinition(const SUMOSAXAttributes &attributes, int *fromLane, int *toLane)
Parses information about lane-2-lane connection.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:258
prohibition of circulation between two edges
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:241
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
link: the index of the opposite direction link of a pedestrian crossing
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition: NBEdge.h:264
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED)
Adds a connection between the specified this edge&#39;s lane and an approached one.
Definition: NBEdge.cpp:998
NBEdgeCont & myEdgeCont
The edge container to fill.
void invalidateTLS(NBTrafficLightLogicCont &tlCont, bool removedConnections, bool addedConnections)
causes the traffic light to be computed anew
Definition: NBNode.cpp:363
bool parseDeprecatedLaneDefinition(const SUMOSAXAttributes &attributes, NBEdge *fromEdge, NBEdge *toEdge, int *fromLane, int *toLane)
Parses information about lane-2-lane connection in deprecated format.
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
Definition: NBEdge.cpp:974
NBConnection parseConnection(const std::string &defRole, const std::string &def)
Returns the connection described by def.
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:303
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
void removeCrossing(const EdgeVector &edges)
remove a pedestrian crossing from this node (identified by its edges)
Definition: NBNode.cpp:2933
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
Encapsulated SAX-Attributes.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
std::string getLaneID(int lane) const
get Lane ID (Secure)
Definition: NBEdge.cpp:3022
walking area for pedestrians
A list of positions.
bool wasRemoved(std::string id) const
Returns whether the edge with the id was deleted explicitly.
Definition: NBEdgeCont.h:514
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
Definition: NBEdge.h:267
bool hasConnectionTo(NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1158
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
NBNodeCont & myNodeCont
The edge container to fill.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
EdgeBuildingStep getStep() const
The building step of this edge.
Definition: NBEdge.h:523
edge: the shape in xml-definition
void discardAllCrossings(bool rejectAll)
discard all current (and optionally future) crossings
Definition: NBNode.cpp:2309
The connection was given by the user.
Definition: NBEdge.h:107
MsgHandler *const myErrorMsgHandler
the handler for loading errors
NBNode::Crossing * addCrossing(EdgeVector edges, double width, bool priority, int tlIndex=-1, int tlIndex2=-1, const PositionVector &customShape=PositionVector::EMPTY, bool fromSumoNet=false)
add a pedestrian crossing to this node
Definition: NBNode.cpp:2921
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:247
void addWalkingAreaShape(EdgeVector edges, const PositionVector &shape)
add custom shape for walkingArea
Definition: NBNode.cpp:2873
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
Definition: NBNode.cpp:2240
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
Definition: NBEdge.cpp:2821
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
void addPostProcessConnection(const std::string &from, int fromLane, const std::string &to, int toLane, bool mayDefinitelyPass, bool keepClear, double contPos, double visibility, double speed, const PositionVector &customShape, bool warnOnly=false)
Adds a connection which could not be set during loading.
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
Definition: NBEdgeCont.cpp:245
void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:113
A storage for options typed value containers)
Definition: OptionsCont.h:92
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:267
NIXMLConnectionsHandler(NBEdgeCont &ec, NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Constructor.
crossing between edges for pedestrians
void addWalkingArea(const SUMOSAXAttributes &attrs)
Parses a walkingArea and updates the referenced node.
Represents a single node (junction) during network building.
Definition: NBNode.h:68
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
add shorted link FOES
Definition: NBNode.cpp:1417
link: the index of the link within the traffic light
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:434
bool wasIgnored(std::string id) const
Returns whether the edge with the id was ignored during parsing.
Definition: NBEdgeCont.h:503
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
delete certain element
Lanes to edges - relationships are computed/loaded.
Definition: NBEdge.h:90
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls)
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:441