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-2017 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 // ===========================================================================
48 // static members
49 // ===========================================================================
50 const std::string NBTrafficLightDefinition::DefaultProgramID = "0";
51 const std::string NBTrafficLightDefinition::DummyID = "dummy";
52 
53 // ===========================================================================
54 // method definitions
55 // ===========================================================================
57  const std::vector<NBNode*>& junctions, const std::string& programID,
58  SUMOTime offset, TrafficLightType type) :
59  Named(id),
60  myControlledNodes(junctions),
61  mySubID(programID), myOffset(offset),
62  myType(type),
63  myNeedsContRelationReady(false),
64  myRightOnRedConflictsReady(false) {
65  std::vector<NBNode*>::iterator i = myControlledNodes.begin();
66  while (i != myControlledNodes.end()) {
67  for (std::vector<NBNode*>::iterator j = i + 1; j != myControlledNodes.end();) {
68  if (*i == *j) {
69  j = myControlledNodes.erase(j);
70  } else {
71  j++;
72  }
73  }
74  i++;
75  }
77  for (std::vector<NBNode*>::const_iterator i = junctions.begin(); i != junctions.end(); i++) {
78  (*i)->addTrafficLight(this);
79  }
80 }
81 
82 
84  NBNode* junction, const std::string& programID, SUMOTime offset, TrafficLightType type) :
85  Named(id),
86  mySubID(programID),
87  myOffset(offset),
88  myType(type),
91  addNode(junction);
92 }
93 
94 
95 NBTrafficLightDefinition::NBTrafficLightDefinition(const std::string& id, const std::string& programID,
96  SUMOTime offset, TrafficLightType type) :
97  Named(id),
98  mySubID(programID),
99  myOffset(offset),
100  myType(type),
103 }
104 
105 
107 
108 
111  // it is not really a traffic light if no incoming edge exists
112  if (amInvalid()) {
113  // make a copy of myControlledNodes because it will be modified;
114  std::vector<NBNode*> nodes = myControlledNodes;
115  for (std::vector<NBNode*>::iterator it = nodes.begin(); it != nodes.end(); it++) {
116  (*it)->removeTrafficLight(this);
117  }
118  WRITE_WARNING("The traffic light '" + getID() + "' does not control any links; it will not be build.");
119  return 0;
120  }
121  // compute the time needed to brake
122  int brakingTime = computeBrakingTime(oc.getFloat("tls.yellow.min-decel"));
123  // perform the computation depending on whether the traffic light
124  // definition was loaded or shall be computed new completely
125  if (!oc.isDefault("tls.yellow.time")) {
126  brakingTime = oc.getInt("tls.yellow.time");
127  }
128  NBTrafficLightLogic* ret = myCompute(brakingTime);
129  ret->addParameter(getMap());
130  return ret;
131 }
132 
133 
134 bool
136  return myControlledLinks.size() == 0;
137 }
138 
139 
140 int
143  return (int)(vmax / minDecel);
144 }
145 
146 
147 void
149  // collect the information about participating edges and links
150  collectEdges();
151  collectLinks();
152 }
153 
154 std::set<NBEdge*>
155 NBTrafficLightDefinition::collectReachable(EdgeVector outer, const EdgeVector& within, bool checkControlled) {
156  std::set<NBEdge*> reachable;
157  while (outer.size() > 0) {
158  NBEdge* from = outer.back();
159  outer.pop_back();
160  std::vector<NBEdge::Connection>& cons = from->getConnections();
161  for (std::vector<NBEdge::Connection>::iterator k = cons.begin(); k != cons.end(); k++) {
162  NBEdge* to = (*k).toEdge;
163  if (reachable.count(to) == 0 &&
164  (find(within.begin(), within.end(), to) != within.end()) &&
165  (!checkControlled || from->mayBeTLSControlled((*k).fromLane, to, (*k).toLane))) {
166  reachable.insert(to);
167  outer.push_back(to);
168  }
169  }
170  }
171  return reachable;
172 }
173 
174 
175 void
177  myIncomingEdges.clear();
178  myEdgesWithin.clear();
179  EdgeVector myOutgoing;
180  // collect the edges from the participating nodes
181  for (std::vector<NBNode*>::iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
182  const EdgeVector& incoming = (*i)->getIncomingEdges();
183  copy(incoming.begin(), incoming.end(), back_inserter(myIncomingEdges));
184  const EdgeVector& outgoing = (*i)->getOutgoingEdges();
185  copy(outgoing.begin(), outgoing.end(), back_inserter(myOutgoing));
186  }
187  EdgeVector outer;
188  // check which of the edges are completely within the junction
189  // add them to the list of edges lying within the node
190  for (EdgeVector::iterator j = myIncomingEdges.begin(); j != myIncomingEdges.end(); ++j) {
191  NBEdge* edge = *j;
192  // an edge lies within the logic if it is outgoing as well as incoming
193  EdgeVector::iterator k = find(myOutgoing.begin(), myOutgoing.end(), edge);
194  if (k != myOutgoing.end()) {
195  myEdgesWithin.push_back(edge);
196  } else {
197  outer.push_back(edge);
198  }
199  }
200  // collect edges that are reachable from the outside via controlled connections
201  std::set<NBEdge*> reachable = collectReachable(outer, myEdgesWithin, true);
202  // collect edges that are reachable from the outside regardless of controllability
203  std::set<NBEdge*> reachable2 = collectReachable(outer, myEdgesWithin, false);
204 
205  const bool uncontrolledWithin = OptionsCont::getOptions().getBool("tls.uncontrolled-within");
206  for (EdgeVector::iterator j = myEdgesWithin.begin(); j != myEdgesWithin.end(); ++j) {
207  NBEdge* edge = *j;
208  // edges that are marked as 'inner' will not get their own phase when
209  // computing traffic light logics (unless they cannot be reached from the outside at all)
210  if (reachable.count(edge) == 1) {
211  edge->setIsInnerEdge();
212  // legacy behavior
213  if (uncontrolledWithin && myControlledInnerEdges.count(edge->getID()) == 0) {
214  myIncomingEdges.erase(find(myIncomingEdges.begin(), myIncomingEdges.end(), edge));
215  }
216  }
217  if (reachable2.count(edge) == 0 && edge->getFirstNonPedestrianLaneIndex(NBNode::FORWARD, true) >= 0
218  && getID() != DummyID) {
219  WRITE_WARNING("Unreachable edge '" + edge->getID() + "' within tlLogic '" + getID() + "'");
220  }
221  }
222 }
223 
224 
225 bool
226 NBTrafficLightDefinition::mustBrake(const NBEdge* const from, const NBEdge* const to) const {
227  std::vector<NBNode*>::const_iterator i =
228  find_if(myControlledNodes.begin(), myControlledNodes.end(),
230  assert(i != myControlledNodes.end());
231  NBNode* node = *i;
232  if (!node->hasOutgoing(to)) {
233  return true; // !!!
234  }
235  // @todo recheck relevance of lane indices
236  return node->mustBrake(from, to, -1, -1, true);
237 }
238 
239 
240 bool
241 NBTrafficLightDefinition::mustBrake(const NBEdge* const possProhibitedFrom,
242  const NBEdge* const possProhibitedTo,
243  const NBEdge* const possProhibitorFrom,
244  const NBEdge* const possProhibitorTo,
245  bool regardNonSignalisedLowerPriority) const {
246  return forbids(possProhibitorFrom, possProhibitorTo,
247  possProhibitedFrom, possProhibitedTo,
248  regardNonSignalisedLowerPriority);
249 }
250 
251 
252 bool
254  const NBConnection& possProhibitor,
255  bool regardNonSignalisedLowerPriority) const {
256  return forbids(possProhibitor.getFrom(), possProhibitor.getTo(),
257  possProhibited.getFrom(), possProhibited.getTo(),
258  regardNonSignalisedLowerPriority);
259 }
260 
261 
262 bool
263 NBTrafficLightDefinition::forbids(const NBEdge* const possProhibitorFrom,
264  const NBEdge* const possProhibitorTo,
265  const NBEdge* const possProhibitedFrom,
266  const NBEdge* const possProhibitedTo,
267  bool regardNonSignalisedLowerPriority,
268  bool sameNodeOnly) const {
269  if (possProhibitorFrom == 0 || possProhibitorTo == 0 || possProhibitedFrom == 0 || possProhibitedTo == 0) {
270  return false;
271  }
272  // retrieve both nodes
273  std::vector<NBNode*>::const_iterator incoming =
274  find_if(myControlledNodes.begin(), myControlledNodes.end(), NBContHelper::node_with_incoming_finder(possProhibitorFrom));
275  std::vector<NBNode*>::const_iterator outgoing =
276  find_if(myControlledNodes.begin(), myControlledNodes.end(), NBContHelper::node_with_outgoing_finder(possProhibitedTo));
277  assert(incoming != myControlledNodes.end());
278  NBNode* incnode = *incoming;
279  NBNode* outnode = *outgoing;
280  EdgeVector::const_iterator i;
281 
282  if (incnode != outnode) {
283  if (sameNodeOnly) {
284  return false;
285  }
286  // the links are located at different nodes
287  const EdgeVector& ev1 = possProhibitedTo->getConnectedEdges();
288  // go through the following edge,
289  // check whether one of these connections is prohibited
290  for (i = ev1.begin(); i != ev1.end(); ++i) {
291  std::vector<NBNode*>::const_iterator outgoing2 =
293  if (outgoing2 == myControlledNodes.end()) {
294  continue;
295  }
296  NBNode* outnode2 = *outgoing2;
297  if (incnode != outnode2) {
298  continue;
299  }
300  if (incnode->getDirection(possProhibitedTo, *i) != LINKDIR_STRAIGHT) {
301  continue;
302  }
303  bool ret1 = incnode->foes(possProhibitorFrom, possProhibitorTo,
304  possProhibitedTo, *i);
305  bool ret2 = incnode->forbids(possProhibitorFrom, possProhibitorTo,
306  possProhibitedTo, *i,
307  regardNonSignalisedLowerPriority);
308  bool ret = ret1 || ret2;
309  if (ret) {
310  return true;
311  }
312  }
313 
314  const EdgeVector& ev2 = possProhibitorTo->getConnectedEdges();
315  // go through the following edge,
316  // check whether one of these connections is prohibited
317  for (i = ev2.begin(); i != ev2.end(); ++i) {
318  std::vector<NBNode*>::const_iterator incoming2 =
319  find_if(myControlledNodes.begin(), myControlledNodes.end(), NBContHelper::node_with_incoming_finder(possProhibitorTo));
320  if (incoming2 == myControlledNodes.end()) {
321  continue;
322  }
323  NBNode* incnode2 = *incoming2;
324  if (incnode2 != outnode) {
325  continue;
326  }
327  if (incnode2->getDirection(possProhibitorTo, *i) != LINKDIR_STRAIGHT) {
328  continue;
329  }
330  bool ret1 = incnode2->foes(possProhibitorTo, *i,
331  possProhibitedFrom, possProhibitedTo);
332  bool ret2 = incnode2->forbids(possProhibitorTo, *i,
333  possProhibitedFrom, possProhibitedTo,
334  regardNonSignalisedLowerPriority);
335  bool ret = ret1 || ret2;
336  if (ret) {
337  return true;
338  }
339  }
340  return false;
341  }
342  // both links are located at the same node
343  // check using this node's information
344  return incnode->forbids(possProhibitorFrom, possProhibitorTo,
345  possProhibitedFrom, possProhibitedTo,
346  regardNonSignalisedLowerPriority);
347 }
348 
349 
350 bool
351 NBTrafficLightDefinition::foes(const NBEdge* const from1, const NBEdge* const to1,
352  const NBEdge* const from2, const NBEdge* const to2) const {
353  if (to1 == 0 || to2 == 0) {
354  return false;
355  }
356  // retrieve both nodes (it is possible that a connection
357  std::vector<NBNode*>::const_iterator incoming =
358  find_if(myControlledNodes.begin(), myControlledNodes.end(),
360  std::vector<NBNode*>::const_iterator outgoing =
361  find_if(myControlledNodes.begin(), myControlledNodes.end(),
363  assert(incoming != myControlledNodes.end());
364  NBNode* incnode = *incoming;
365  NBNode* outnode = *outgoing;
366  if (incnode != outnode) {
367  return false;
368  }
369  return incnode->foes(from1, to1, from2, to2);
370 }
371 
372 
373 void
375  if (std::find(myControlledNodes.begin(), myControlledNodes.end(), node) == myControlledNodes.end()) {
376  myControlledNodes.push_back(node);
378  }
379  node->addTrafficLight(this);
380 }
381 
382 
383 void
385  std::vector<NBNode*>::iterator i = std::find(myControlledNodes.begin(), myControlledNodes.end(), node);
386  if (i != myControlledNodes.end()) {
387  myControlledNodes.erase(i);
388  }
389  // !!! remove in node?
390 }
391 
392 
393 void
394 NBTrafficLightDefinition::addControlledInnerEdges(const std::vector<std::string>& edges) {
395  myControlledInnerEdges.insert(edges.begin(), edges.end());
396 }
397 
398 
399 std::vector<std::string>
401  return std::vector<std::string>(myControlledInnerEdges.begin(), myControlledInnerEdges.end());
402 }
403 
404 
405 const EdgeVector&
407  return myIncomingEdges;
408 }
409 
410 
411 void
413  myControlledLinks.clear();
414  int tlIndex = 0;
415  // build the list of links which are controled by the traffic light
416  for (EdgeVector::iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) {
417  NBEdge* incoming = *i;
418  int noLanes = incoming->getNumLanes();
419  for (int j = 0; j < noLanes; j++) {
420  std::vector<NBEdge::Connection> connected = incoming->getConnectionsFromLane(j);
421  for (std::vector<NBEdge::Connection>::iterator k = connected.begin(); k != connected.end(); k++) {
422  const NBEdge::Connection& el = *k;
423  if (incoming->mayBeTLSControlled(el.fromLane, el.toEdge, el.toLane)) {
424  if (el.toEdge != 0 && el.toLane >= (int) el.toEdge->getNumLanes()) {
425  throw ProcessError("Connection '" + incoming->getID() + "_" + toString(j) + "->" + el.toEdge->getID() + "_" + toString(el.toLane) + "' yields in a not existing lane.");
426  }
427  if (incoming->getToNode()->getType() != NODETYPE_RAIL_CROSSING || !isRailway(incoming->getPermissions())) {
428  myControlledLinks.push_back(NBConnection(incoming, el.fromLane, el.toEdge, el.toLane, tlIndex++));
429  } else {
430  myControlledLinks.push_back(NBConnection(incoming, el.fromLane, el.toEdge, el.toLane, -1));
431  }
432  }
433  }
434  }
435  }
436  if (myControlledLinks.size() > 0 && tlIndex == 0) {
437  WRITE_WARNING("The rail crossing '" + getID() + "' does not have any roads.");
438  }
439 }
440 
441 
442 bool
443 NBTrafficLightDefinition::needsCont(const NBEdge* fromE, const NBEdge* toE, const NBEdge* otherFromE, const NBEdge* otherToE) const {
446  assert(myNeedsContRelationReady);
447  }
448  return std::find(myNeedsContRelation.begin(), myNeedsContRelation.end(),
449  StreamPair(fromE, toE, otherFromE, otherToE)) != myNeedsContRelation.end();
450 }
451 
452 
453 void
455  if (!amInvalid()) {
457  dummy.initNeedsContRelation();
459  for (std::vector<NBNode*>::const_iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
460  (*i)->removeTrafficLight(&dummy);
461  }
462  }
464 }
465 
466 
467 bool
468 NBTrafficLightDefinition::rightOnRedConflict(int index, int foeIndex) const {
472  NBTrafficLightLogic* tllDummy = dummy.computeLogicAndConts(0, true);
473  delete tllDummy;
475  for (std::vector<NBNode*>::const_iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
476  (*i)->removeTrafficLight(&dummy);
477  }
479  //std::cout << " rightOnRedConflicts tls=" << getID() << " pro=" << getProgramID() << "\n";
480  //for (RightOnRedConflicts::const_iterator it = myRightOnRedConflicts.begin(); it != myRightOnRedConflicts.end(); ++it) {
481  // std::cout << " " << it->first << ", " << it->second << "\n";
482  //}
483  }
484  return std::find(myRightOnRedConflicts.begin(), myRightOnRedConflicts.end(), std::make_pair(index, foeIndex)) != myRightOnRedConflicts.end();
485 }
486 
487 /****************************************************************************/
488 
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
Definition: NBEdge.cpp:2420
virtual void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:164
int toLane
The lane the connections yields in.
Definition: NBEdge.h:190
TrafficLightType myType
The algorithm type for the traffic light.
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:1461
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
static double maxSpeed(const EdgeVector &ev)
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:187
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:1365
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:657
int computeBrakingTime(double minDecel) const
Computes the time vehicles may need to brake.
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:65
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:2955
The link is a straight direction.
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1010
virtual void collectEdges()
Build the list of participating edges.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
static const int FORWARD
edge directions (for pedestrian related stuff)
Definition: NBNode.h:194
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:413
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:184
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.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2913
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:1549
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:310
NBTrafficLightLogic * computeLogicAndConts(int brakingTimeSeconds, bool onlyConts=false)
helper function for myCompute
Definition: NBOwnTLDef.cpp:187
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:834
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
container for (sorted) edges
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:1451
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:257
void setIsInnerEdge()
Marks this edge being within an intersection.
Definition: NBEdge.h:934
Represents a single node (junction) during network building.
Definition: NBNode.h:75
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1107
long long int SUMOTime
Definition: TraCIDefs.h:52
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:555
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:523
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:434
EdgeVector myEdgesWithin
The list of edges within the area controlled by the tls.
std::string mySubID
The tls program&#39;s subid.
TrafficLightType