SUMO - Simulation of Urban MObility
NBTrafficLightDefinition.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // The base class for traffic light logic definitions
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2016 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 <vector>
34 #include <string>
35 #include <algorithm>
36 #include <cassert>
37 #include <iterator>
39 #include <utils/common/ToString.h>
43 #include "NBTrafficLightLogic.h"
44 #include "NBOwnTLDef.h"
45 #include "NBContHelper.h"
46 
47 #ifdef CHECK_MEMORY_LEAKS
48 #include <foreign/nvwa/debug_new.h>
49 #endif // CHECK_MEMORY_LEAKS
50 
51 // ===========================================================================
52 // static members
53 // ===========================================================================
54 const std::string NBTrafficLightDefinition::DefaultProgramID = "0";
55 const std::string NBTrafficLightDefinition::DummyID = "dummy";
56 
57 // ===========================================================================
58 // method definitions
59 // ===========================================================================
61  const std::vector<NBNode*>& junctions, const std::string& programID,
62  SUMOTime offset, TrafficLightType type) :
63  Named(id),
64  myControlledNodes(junctions),
65  mySubID(programID), myOffset(offset),
66  myType(type),
67  myNeedsContRelationReady(false),
68  myRightOnRedConflictsReady(false) {
69  std::vector<NBNode*>::iterator i = myControlledNodes.begin();
70  while (i != myControlledNodes.end()) {
71  for (std::vector<NBNode*>::iterator j = i + 1; j != myControlledNodes.end();) {
72  if (*i == *j) {
73  j = myControlledNodes.erase(j);
74  } else {
75  j++;
76  }
77  }
78  i++;
79  }
81  for (std::vector<NBNode*>::const_iterator i = junctions.begin(); i != junctions.end(); i++) {
82  (*i)->addTrafficLight(this);
83  }
84 }
85 
86 
88  NBNode* junction, const std::string& programID, SUMOTime offset, TrafficLightType type) :
89  Named(id),
90  mySubID(programID),
91  myOffset(offset),
92  myType(type),
95  addNode(junction);
96 }
97 
98 
99 NBTrafficLightDefinition::NBTrafficLightDefinition(const std::string& id, const std::string& programID,
100  SUMOTime offset, TrafficLightType type) :
101  Named(id),
102  mySubID(programID),
103  myOffset(offset),
104  myType(type),
107 }
108 
109 
111 
112 
115  // it is not really a traffic light if no incoming edge exists
116  if (amInvalid()) {
117  // make a copy of myControlledNodes because it will be modified;
118  std::vector<NBNode*> nodes = myControlledNodes;
119  for (std::vector<NBNode*>::iterator it = nodes.begin(); it != nodes.end(); it++) {
120  (*it)->removeTrafficLight(this);
121  }
122  WRITE_WARNING("The traffic light '" + getID() + "' does not control any links; it will not be build.");
123  return 0;
124  }
125  // compute the time needed to brake
126  int brakingTime = computeBrakingTime(oc.getFloat("tls.yellow.min-decel"));
127  // perform the computation depending on whether the traffic light
128  // definition was loaded or shall be computed new completely
129  if (!oc.isDefault("tls.yellow.time")) {
130  brakingTime = oc.getInt("tls.yellow.time");
131  }
132  NBTrafficLightLogic* ret = myCompute(brakingTime);
133  ret->addParameter(getMap());
134  return ret;
135 }
136 
137 
138 bool
140  return myControlledLinks.size() == 0;
141 }
142 
143 
144 int
147  return (int)(vmax / minDecel);
148 }
149 
150 
151 void
153  // collect the information about participating edges and links
154  collectEdges();
155  collectLinks();
156 }
157 
158 std::set<NBEdge*>
159 NBTrafficLightDefinition::collectReachable(EdgeVector outer, const EdgeVector& within, bool checkControlled) {
160  std::set<NBEdge*> reachable;
161  while (outer.size() > 0) {
162  NBEdge* from = outer.back();
163  outer.pop_back();
164  std::vector<NBEdge::Connection>& cons = from->getConnections();
165  for (std::vector<NBEdge::Connection>::iterator k = cons.begin(); k != cons.end(); k++) {
166  NBEdge* to = (*k).toEdge;
167  if (reachable.count(to) == 0 &&
168  (find(within.begin(), within.end(), to) != within.end()) &&
169  (!checkControlled || from->mayBeTLSControlled((*k).fromLane, to, (*k).toLane))) {
170  reachable.insert(to);
171  outer.push_back(to);
172  }
173  }
174  }
175  return reachable;
176 }
177 
178 
179 void
181  myIncomingEdges.clear();
182  myEdgesWithin.clear();
183  EdgeVector myOutgoing;
184  // collect the edges from the participating nodes
185  for (std::vector<NBNode*>::iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
186  const EdgeVector& incoming = (*i)->getIncomingEdges();
187  copy(incoming.begin(), incoming.end(), back_inserter(myIncomingEdges));
188  const EdgeVector& outgoing = (*i)->getOutgoingEdges();
189  copy(outgoing.begin(), outgoing.end(), back_inserter(myOutgoing));
190  }
191  EdgeVector outer;
192  // check which of the edges are completely within the junction
193  // add them to the list of edges lying within the node
194  for (EdgeVector::iterator j = myIncomingEdges.begin(); j != myIncomingEdges.end(); ++j) {
195  NBEdge* edge = *j;
196  // an edge lies within the logic if it is outgoing as well as incoming
197  EdgeVector::iterator k = find(myOutgoing.begin(), myOutgoing.end(), edge);
198  if (k != myOutgoing.end()) {
199  myEdgesWithin.push_back(edge);
200  } else {
201  outer.push_back(edge);
202  }
203  }
204  // collect edges that are reachable from the outside via controlled connections
205  std::set<NBEdge*> reachable = collectReachable(outer, myEdgesWithin, true);
206  // collect edges that are reachable from the outside regardless of controllability
207  std::set<NBEdge*> reachable2 = collectReachable(outer, myEdgesWithin, false);
208 
209  const bool uncontrolledWithin = OptionsCont::getOptions().getBool("tls.uncontrolled-within");
210  for (EdgeVector::iterator j = myEdgesWithin.begin(); j != myEdgesWithin.end(); ++j) {
211  NBEdge* edge = *j;
212  // edges that are marked as 'inner' will not get their own phase when
213  // computing traffic light logics (unless they cannot be reached from the outside at all)
214  if (reachable.count(edge) == 1) {
215  edge->setIsInnerEdge();
216  // legacy behavior
217  if (uncontrolledWithin && myControlledInnerEdges.count(edge->getID()) == 0) {
218  myIncomingEdges.erase(find(myIncomingEdges.begin(), myIncomingEdges.end(), edge));
219  }
220  }
221  if (reachable2.count(edge) == 0 && edge->getFirstNonPedestrianLaneIndex(NBNode::FORWARD, true) >= 0
222  && getID() != DummyID) {
223  WRITE_WARNING("Unreachable edge '" + edge->getID() + "' within tlLogic '" + getID() + "'");
224  }
225  }
226 }
227 
228 
229 bool
230 NBTrafficLightDefinition::mustBrake(const NBEdge* const from, const NBEdge* const to) const {
231  std::vector<NBNode*>::const_iterator i =
232  find_if(myControlledNodes.begin(), myControlledNodes.end(),
234  assert(i != myControlledNodes.end());
235  NBNode* node = *i;
236  if (!node->hasOutgoing(to)) {
237  return true; // !!!
238  }
239  // @todo recheck relevance of lane indices
240  return node->mustBrake(from, to, -1, -1, true);
241 }
242 
243 
244 bool
245 NBTrafficLightDefinition::mustBrake(const NBEdge* const possProhibitedFrom,
246  const NBEdge* const possProhibitedTo,
247  const NBEdge* const possProhibitorFrom,
248  const NBEdge* const possProhibitorTo,
249  bool regardNonSignalisedLowerPriority) const {
250  return forbids(possProhibitorFrom, possProhibitorTo,
251  possProhibitedFrom, possProhibitedTo,
252  regardNonSignalisedLowerPriority);
253 }
254 
255 
256 bool
258  const NBConnection& possProhibitor,
259  bool regardNonSignalisedLowerPriority) const {
260  return forbids(possProhibitor.getFrom(), possProhibitor.getTo(),
261  possProhibited.getFrom(), possProhibited.getTo(),
262  regardNonSignalisedLowerPriority);
263 }
264 
265 
266 bool
267 NBTrafficLightDefinition::forbids(const NBEdge* const possProhibitorFrom,
268  const NBEdge* const possProhibitorTo,
269  const NBEdge* const possProhibitedFrom,
270  const NBEdge* const possProhibitedTo,
271  bool regardNonSignalisedLowerPriority,
272  bool sameNodeOnly) const {
273  if (possProhibitorFrom == 0 || possProhibitorTo == 0 || possProhibitedFrom == 0 || possProhibitedTo == 0) {
274  return false;
275  }
276  // retrieve both nodes
277  std::vector<NBNode*>::const_iterator incoming =
278  find_if(myControlledNodes.begin(), myControlledNodes.end(), NBContHelper::node_with_incoming_finder(possProhibitorFrom));
279  std::vector<NBNode*>::const_iterator outgoing =
280  find_if(myControlledNodes.begin(), myControlledNodes.end(), NBContHelper::node_with_outgoing_finder(possProhibitedTo));
281  assert(incoming != myControlledNodes.end());
282  NBNode* incnode = *incoming;
283  NBNode* outnode = *outgoing;
284  EdgeVector::const_iterator i;
285 
286  if (incnode != outnode) {
287  if (sameNodeOnly) {
288  return false;
289  }
290  // the links are located at different nodes
291  const EdgeVector& ev1 = possProhibitedTo->getConnectedEdges();
292  // go through the following edge,
293  // check whether one of these connections is prohibited
294  for (i = ev1.begin(); i != ev1.end(); ++i) {
295  std::vector<NBNode*>::const_iterator outgoing2 =
297  if (outgoing2 == myControlledNodes.end()) {
298  continue;
299  }
300  NBNode* outnode2 = *outgoing2;
301  if (incnode != outnode2) {
302  continue;
303  }
304  if (incnode->getDirection(possProhibitedTo, *i) != LINKDIR_STRAIGHT) {
305  continue;
306  }
307  bool ret1 = incnode->foes(possProhibitorFrom, possProhibitorTo,
308  possProhibitedTo, *i);
309  bool ret2 = incnode->forbids(possProhibitorFrom, possProhibitorTo,
310  possProhibitedTo, *i,
311  regardNonSignalisedLowerPriority);
312  bool ret = ret1 || ret2;
313  if (ret) {
314  return true;
315  }
316  }
317 
318  const EdgeVector& ev2 = possProhibitorTo->getConnectedEdges();
319  // go through the following edge,
320  // check whether one of these connections is prohibited
321  for (i = ev2.begin(); i != ev2.end(); ++i) {
322  std::vector<NBNode*>::const_iterator incoming2 =
323  find_if(myControlledNodes.begin(), myControlledNodes.end(), NBContHelper::node_with_incoming_finder(possProhibitorTo));
324  if (incoming2 == myControlledNodes.end()) {
325  continue;
326  }
327  NBNode* incnode2 = *incoming2;
328  if (incnode2 != outnode) {
329  continue;
330  }
331  if (incnode2->getDirection(possProhibitorTo, *i) != LINKDIR_STRAIGHT) {
332  continue;
333  }
334  bool ret1 = incnode2->foes(possProhibitorTo, *i,
335  possProhibitedFrom, possProhibitedTo);
336  bool ret2 = incnode2->forbids(possProhibitorTo, *i,
337  possProhibitedFrom, possProhibitedTo,
338  regardNonSignalisedLowerPriority);
339  bool ret = ret1 || ret2;
340  if (ret) {
341  return true;
342  }
343  }
344  return false;
345  }
346  // both links are located at the same node
347  // check using this node's information
348  return incnode->forbids(possProhibitorFrom, possProhibitorTo,
349  possProhibitedFrom, possProhibitedTo,
350  regardNonSignalisedLowerPriority);
351 }
352 
353 
354 bool
355 NBTrafficLightDefinition::foes(const NBEdge* const from1, const NBEdge* const to1,
356  const NBEdge* const from2, const NBEdge* const to2) const {
357  if (to1 == 0 || to2 == 0) {
358  return false;
359  }
360  // retrieve both nodes (it is possible that a connection
361  std::vector<NBNode*>::const_iterator incoming =
362  find_if(myControlledNodes.begin(), myControlledNodes.end(),
364  std::vector<NBNode*>::const_iterator outgoing =
365  find_if(myControlledNodes.begin(), myControlledNodes.end(),
367  assert(incoming != myControlledNodes.end());
368  NBNode* incnode = *incoming;
369  NBNode* outnode = *outgoing;
370  if (incnode != outnode) {
371  return false;
372  }
373  return incnode->foes(from1, to1, from2, to2);
374 }
375 
376 
377 void
379  if (std::find(myControlledNodes.begin(), myControlledNodes.end(), node) == myControlledNodes.end()) {
380  myControlledNodes.push_back(node);
382  }
383  node->addTrafficLight(this);
384 }
385 
386 
387 void
389  std::vector<NBNode*>::iterator i = std::find(myControlledNodes.begin(), myControlledNodes.end(), node);
390  if (i != myControlledNodes.end()) {
391  myControlledNodes.erase(i);
392  }
393  // !!! remove in node?
394 }
395 
396 
397 void
398 NBTrafficLightDefinition::addControlledInnerEdges(const std::vector<std::string>& edges) {
399  myControlledInnerEdges.insert(edges.begin(), edges.end());
400 }
401 
402 
403 std::vector<std::string>
405  return std::vector<std::string>(myControlledInnerEdges.begin(), myControlledInnerEdges.end());
406 }
407 
408 
409 const EdgeVector&
411  return myIncomingEdges;
412 }
413 
414 
415 void
417  myControlledLinks.clear();
418  int tlIndex = 0;
419  // build the list of links which are controled by the traffic light
420  for (EdgeVector::iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) {
421  NBEdge* incoming = *i;
422  int noLanes = incoming->getNumLanes();
423  for (int j = 0; j < noLanes; j++) {
424  std::vector<NBEdge::Connection> connected = incoming->getConnectionsFromLane(j);
425  for (std::vector<NBEdge::Connection>::iterator k = connected.begin(); k != connected.end(); k++) {
426  const NBEdge::Connection& el = *k;
427  if (incoming->mayBeTLSControlled(el.fromLane, el.toEdge, el.toLane)) {
428  if (el.toEdge != 0 && el.toLane >= (int) el.toEdge->getNumLanes()) {
429  throw ProcessError("Connection '" + incoming->getID() + "_" + toString(j) + "->" + el.toEdge->getID() + "_" + toString(el.toLane) + "' yields in a not existing lane.");
430  }
431  if (incoming->getToNode()->getType() != NODETYPE_RAIL_CROSSING || !isRailway(incoming->getPermissions())) {
432  myControlledLinks.push_back(NBConnection(incoming, el.fromLane, el.toEdge, el.toLane, tlIndex++));
433  } else {
434  myControlledLinks.push_back(NBConnection(incoming, el.fromLane, el.toEdge, el.toLane, -1));
435  }
436  }
437  }
438  }
439  }
440 }
441 
442 
443 bool
444 NBTrafficLightDefinition::needsCont(const NBEdge* fromE, const NBEdge* toE, const NBEdge* otherFromE, const NBEdge* otherToE) const {
447  assert(myNeedsContRelationReady);
448  }
449  return std::find(myNeedsContRelation.begin(), myNeedsContRelation.end(),
450  StreamPair(fromE, toE, otherFromE, otherToE)) != myNeedsContRelation.end();
451 }
452 
453 
454 void
456  if (!amInvalid()) {
458  dummy.initNeedsContRelation();
460  for (std::vector<NBNode*>::const_iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
461  (*i)->removeTrafficLight(&dummy);
462  }
463  }
465 }
466 
467 
468 bool
469 NBTrafficLightDefinition::rightOnRedConflict(int index, int foeIndex) const {
473  NBTrafficLightLogic* tllDummy = dummy.computeLogicAndConts(0, true);
474  delete tllDummy;
476  for (std::vector<NBNode*>::const_iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
477  (*i)->removeTrafficLight(&dummy);
478  }
480  }
481  return std::find(myRightOnRedConflicts.begin(), myRightOnRedConflicts.end(), std::make_pair(index, foeIndex)) != myRightOnRedConflicts.end();
482 }
483 
484 /****************************************************************************/
485 
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2242
virtual void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:157
int toLane
The lane the connections yields in.
Definition: NBEdge.h:178
TrafficLightType myType
The algorithm type for the traffic light.
long long int SUMOTime
Definition: SUMOTime.h:43
bool foes(const NBEdge *const from1, const NBEdge *const to1, const NBEdge *const from2, const NBEdge *const to2) const
Returns the information whether the given flows cross.
Definition: NBNode.cpp:1467
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
virtual bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turing right on a red light ...
virtual void addNode(NBNode *node)
Adds a node to the traffic light logic.
void collectAllLinks()
helper method for use in NBOwnTLDef and NBLoadedSUMOTLDef
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:175
static const std::string DummyID
id for temporary definitions
RightOnRedConflicts myRightOnRedConflicts
A SUMO-compliant built logic for a traffic light.
EdgeVector myIncomingEdges
The list of incoming edges.
bool mustBrake(const NBEdge *const from, const NBEdge *const to, int fromLane, int toLane, bool includePedCrossings) const
Returns the information whether the described flow must let any other flow pass.
Definition: NBNode.cpp:1371
virtual ~NBTrafficLightDefinition()
Destructor.
The representation of a single edge during network building.
Definition: NBEdge.h:71
NBTrafficLightLogic * compute(OptionsCont &oc)
Computes the traffic light logic.
Used for sorting the cells by the begin time they describe.
Definition: NBNode.h:686
NBEdge * getFrom() const
returns the from-edge (start of the connection)
bool needsCont(const NBEdge *fromE, const NBEdge *toE, const NBEdge *otherFromE, const NBEdge *otherToE) const
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:66
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
NBTrafficLightDefinition(const std::string &id, const std::vector< NBNode *> &junctions, const std::string &programID, SUMOTime offset, TrafficLightType type)
Constructor.
SUMOTime myOffset
The offset in the program.
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:69
virtual void collectLinks()=0
Collects the links participating in this traffic light.
virtual void initNeedsContRelation() const
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Definition: NBEdge.cpp:2768
The link is a straight direction.
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:912
virtual void collectEdges()
Build the list of participating edges.
static const int FORWARD
edge directions (for pedestrian related stuff)
Definition: NBNode.h:183
std::set< std::string > myControlledInnerEdges
Set of inner edges that shall be controlled, though.
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:395
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:172
int computeBrakingTime(SUMOReal minDecel) const
Computes the time vehicles may need to brake.
static SUMOReal maxSpeed(const EdgeVector &ev)
virtual NBTrafficLightLogic * myCompute(int brakingTime)=0
Computes the traffic light logic finally in dependence to the type.
static const std::string DefaultProgramID
void addControlledInnerEdges(const std::vector< std::string > &edges)
Adds the given ids into the list of inner edges controlled by the tls.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:55
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2726
virtual void removeNode(NBNode *node)
Removes the given node from the list of controlled nodes.
Base class for objects which have an id.
Definition: Named.h:46
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream&#39;s direction.
Definition: NBNode.cpp:1555
const EdgeVector & getIncomingEdges() const
Returns the list of incoming edges (must be build first)
NBEdge * getTo() const
returns the to-edge (end of the connection)
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
Definition: NBNode.cpp:314
NBTrafficLightLogic * computeLogicAndConts(int brakingTimeSeconds, bool onlyConts=false)
helper function for myCompute
Definition: NBOwnTLDef.cpp:191
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:803
bool forbids(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo, bool regardNonSignalisedLowerPriority, bool sameNodeOnly=false) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:41
bool forbids(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo, bool regardNonSignalisedLowerPriority) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
Definition: NBNode.cpp:1457
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
A storage for options typed value containers)
Definition: OptionsCont.h:99
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:265
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:897
Represents a single node (junction) during network building.
Definition: NBNode.h:74
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1009
#define SUMOReal
Definition: config.h:213
data structure for caching needsCont information
std::vector< NBNode * > myControlledNodes
The container with participating nodes.
A traffic light logics which must be computed (only nodes/edges are given)
Definition: NBOwnTLDef.h:54
bool foes(const NBEdge *const from1, const NBEdge *const to1, const NBEdge *const from2, const NBEdge *const to2) const
Returns the information whether the given flows cross.
void initNeedsContRelation() const
Definition: NBOwnTLDef.cpp:559
static std::set< NBEdge * > collectReachable(EdgeVector outer, const EdgeVector &within, bool checkControlled)
void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
Definition: NBOwnTLDef.cpp:527
NBConnectionVector myControlledLinks
The list of controlled links.
bool mustBrake(const NBEdge *const from, const NBEdge *const to) const
Returns the information whether the described flow must let any other flow pass.
std::vector< std::string > getControlledInnerEdges() const
Retrieve the ids of edges explicitly controlled by the tls.
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:416
EdgeVector myEdgesWithin
The list of edges within the area controlled by the tls.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
std::string mySubID
The tls program&#39;s subid.
TrafficLightType