SUMO - Simulation of Urban MObility
NBOwnTLDef.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // A traffic light logics which must be computed (only nodes/edges are given)
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <cassert>
36 #include <iterator>
38 #include "NBNode.h"
39 #include "NBOwnTLDef.h"
40 #include "NBTrafficLightLogic.h"
43 #include <utils/common/ToString.h>
45 #include <utils/options/Option.h>
46 
47 #ifdef CHECK_MEMORY_LEAKS
48 #include <foreign/nvwa/debug_new.h>
49 #endif // CHECK_MEMORY_LEAKS
50 
51 
52 // ===========================================================================
53 // member method definitions
54 // ===========================================================================
55 NBOwnTLDef::NBOwnTLDef(const std::string& id,
56  const std::vector<NBNode*>& junctions, SUMOTime offset,
57  TrafficLightType type) :
58  NBTrafficLightDefinition(id, junctions, DefaultProgramID, offset, type),
59  myHaveSinglePhase(false)
60 {}
61 
62 
63 NBOwnTLDef::NBOwnTLDef(const std::string& id, NBNode* junction, SUMOTime offset,
64  TrafficLightType type) :
65  NBTrafficLightDefinition(id, junction, DefaultProgramID, offset, type),
66  myHaveSinglePhase(false)
67 {}
68 
69 
70 NBOwnTLDef::NBOwnTLDef(const std::string& id, SUMOTime offset,
71  TrafficLightType type) :
72  NBTrafficLightDefinition(id, DefaultProgramID, offset, type),
73  myHaveSinglePhase(false)
74 {}
75 
76 
78 
79 
80 int
81 NBOwnTLDef::getToPrio(const NBEdge* const e) {
82  return e->getJunctionPriority(e->getToNode());
83 }
84 
85 
88  switch (dir) {
89  case LINKDIR_STRAIGHT:
90  case LINKDIR_PARTLEFT:
91  case LINKDIR_PARTRIGHT:
92  return 2.;
93  case LINKDIR_LEFT:
94  case LINKDIR_RIGHT:
95  return .5;
96  case LINKDIR_NODIR:
97  case LINKDIR_TURN:
98  return 0;
99  }
100  return 0;
101 }
102 
103 SUMOReal
105  SUMOReal val = 0;
106  for (unsigned int e1l = 0; e1l < e1->getNumLanes(); e1l++) {
107  std::vector<NBEdge::Connection> approached1 = e1->getConnectionsFromLane(e1l);
108  for (unsigned int e2l = 0; e2l < e2->getNumLanes(); e2l++) {
109  std::vector<NBEdge::Connection> approached2 = e2->getConnectionsFromLane(e2l);
110  for (std::vector<NBEdge::Connection>::iterator e1c = approached1.begin(); e1c != approached1.end(); ++e1c) {
111  if (e1->getTurnDestination() == (*e1c).toEdge) {
112  continue;
113  }
114  for (std::vector<NBEdge::Connection>::iterator e2c = approached2.begin(); e2c != approached2.end(); ++e2c) {
115  if (e2->getTurnDestination() == (*e2c).toEdge) {
116  continue;
117  }
118  if (!foes(e1, (*e1c).toEdge, e2, (*e2c).toEdge)) {
119  val += getDirectionalWeight(e1->getToNode()->getDirection(e1, (*e1c).toEdge));
120  val += getDirectionalWeight(e2->getToNode()->getDirection(e2, (*e2c).toEdge));
121  }
122  }
123  }
124  }
125  }
126  return val;
127 }
128 
129 
130 std::pair<NBEdge*, NBEdge*>
132  std::pair<NBEdge*, NBEdge*> bestPair(static_cast<NBEdge*>(0), static_cast<NBEdge*>(0));
133  SUMOReal bestValue = -1;
134  for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
135  for (EdgeVector::const_iterator j = i + 1; j != edges.end(); ++j) {
136  const SUMOReal value = computeUnblockedWeightedStreamNumber(*i, *j);
137  if (value > bestValue) {
138  bestValue = value;
139  bestPair = std::pair<NBEdge*, NBEdge*>(*i, *j);
140  } else if (value == bestValue) {
141  const SUMOReal ca = GeomHelper::getMinAngleDiff((*i)->getAngleAtNode((*i)->getToNode()), (*j)->getAngleAtNode((*j)->getToNode()));
142  const SUMOReal oa = GeomHelper::getMinAngleDiff(bestPair.first->getAngleAtNode(bestPair.first->getToNode()), bestPair.second->getAngleAtNode(bestPair.second->getToNode()));
143  if (fabs(oa - ca) < NUMERICAL_EPS) { // break ties by id
144  if (bestPair.first->getID() < (*i)->getID()) {
145  bestPair = std::pair<NBEdge*, NBEdge*>(*i, *j);
146  }
147  } else if (oa < ca) {
148  bestPair = std::pair<NBEdge*, NBEdge*>(*i, *j);
149  }
150  }
151  }
152  }
153  return bestPair;
154 }
155 
156 
157 std::pair<NBEdge*, NBEdge*>
159  if (incoming.size() == 1) {
160  // only one there - return the one
161  std::pair<NBEdge*, NBEdge*> ret(*incoming.begin(), static_cast<NBEdge*>(0));
162  incoming.clear();
163  return ret;
164  }
165  // determine the best combination
166  // by priority, first
167  EdgeVector used;
168  std::sort(incoming.begin(), incoming.end(), edge_by_incoming_priority_sorter());
169  used.push_back(*incoming.begin()); // the first will definitely be used
170  // get the ones with the same priority
171  int prio = getToPrio(*used.begin());
172  for (EdgeVector::iterator i = incoming.begin() + 1; i != incoming.end() && prio != getToPrio(*i); ++i) {
173  used.push_back(*i);
174  }
175  // if there only lower priorised, use these, too
176  if (used.size() < 2) {
177  used = incoming;
178  }
179  std::pair<NBEdge*, NBEdge*> ret = getBestCombination(used);
180  incoming.erase(find(incoming.begin(), incoming.end(), ret.first));
181  incoming.erase(find(incoming.begin(), incoming.end(), ret.second));
182  return ret;
183 }
184 
185 
187 NBOwnTLDef::myCompute(const NBEdgeCont&, unsigned int brakingTimeSeconds) {
188  const SUMOTime brakingTime = TIME2STEPS(brakingTimeSeconds);
189  const SUMOTime leftTurnTime = TIME2STEPS(6); // make configurable
190  // build complete lists first
191  const EdgeVector& incoming = getIncomingEdges();
192  EdgeVector fromEdges, toEdges;
193  std::vector<bool> isLeftMoverV, isTurnaround;
194  unsigned int noLanesAll = 0;
195  unsigned int noLinksAll = 0;
196  for (unsigned int i1 = 0; i1 < incoming.size(); i1++) {
197  unsigned int noLanes = incoming[i1]->getNumLanes();
198  noLanesAll += noLanes;
199  for (unsigned int i2 = 0; i2 < noLanes; i2++) {
200  NBEdge* fromEdge = incoming[i1];
201  std::vector<NBEdge::Connection> approached = fromEdge->getConnectionsFromLane(i2);
202  noLinksAll += (unsigned int) approached.size();
203  for (unsigned int i3 = 0; i3 < approached.size(); i3++) {
204  if (!fromEdge->mayBeTLSControlled(i2, approached[i3].toEdge, approached[i3].toLane)) {
205  --noLinksAll;
206  continue;
207  }
208  assert(i3 < approached.size());
209  NBEdge* toEdge = approached[i3].toEdge;
210  fromEdges.push_back(fromEdge);
211  //myFromLanes.push_back(i2);
212  toEdges.push_back(toEdge);
213  if (toEdge != 0) {
214  isLeftMoverV.push_back(
215  isLeftMover(fromEdge, toEdge)
216  ||
217  fromEdge->isTurningDirectionAt(fromEdge->getToNode(), toEdge));
218 
219  isTurnaround.push_back(
220  fromEdge->isTurningDirectionAt(
221  fromEdge->getToNode(), toEdge));
222  } else {
223  isLeftMoverV.push_back(true);
224  isTurnaround.push_back(true);
225  }
226  }
227  }
228  }
229  // collect crossings
230  std::vector<NBNode::Crossing> crossings;
231  for (std::vector<NBNode*>::iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
232  const std::vector<NBNode::Crossing>& c = (*i)->getCrossings();
233  // set tl indices for crossings
234  (*i)->setCrossingTLIndices(noLinksAll);
235  copy(c.begin(), c.end(), std::back_inserter(crossings));
236  noLinksAll += (unsigned int)c.size();
237  }
238 
239  NBTrafficLightLogic* logic = new NBTrafficLightLogic(getID(), getProgramID(), noLinksAll, myOffset, myType);
240  EdgeVector toProc = incoming;
241  const SUMOTime greenTime = TIME2STEPS(OptionsCont::getOptions().getInt("tls.green.time"));
242  // build all phases
243  while (toProc.size() > 0) {
244  std::pair<NBEdge*, NBEdge*> chosen;
245  if (incoming.size() == 2) {
246  chosen = std::pair<NBEdge*, NBEdge*>(toProc[0], static_cast<NBEdge*>(0));
247  toProc.erase(toProc.begin());
248  } else {
249  chosen = getBestPair(toProc);
250  }
251  unsigned int pos = 0;
252  std::string state((size_t) noLinksAll, 'r');
253  // plain straight movers
254  for (unsigned int i1 = 0; i1 < (unsigned int) incoming.size(); ++i1) {
255  NBEdge* fromEdge = incoming[i1];
256  const bool inChosen = fromEdge == chosen.first || fromEdge == chosen.second; //chosen.find(fromEdge)!=chosen.end();
257  const unsigned int numLanes = fromEdge->getNumLanes();
258  for (unsigned int i2 = 0; i2 < numLanes; i2++) {
259  std::vector<NBEdge::Connection> approached = fromEdge->getConnectionsFromLane(i2);
260  for (unsigned int i3 = 0; i3 < approached.size(); ++i3) {
261  if (!fromEdge->mayBeTLSControlled(i2, approached[i3].toEdge, approached[i3].toLane)) {
262  continue;
263  }
264  if (inChosen) {
265  state[pos] = 'G';
266  } else {
267  state[pos] = 'r';
268  }
269  ++pos;
270  }
271  }
272  }
273  // correct behaviour for those that are not in chosen, but may drive, though
274  for (unsigned int i1 = 0; i1 < pos; ++i1) {
275  if (state[i1] == 'G') {
276  continue;
277  }
278  bool isForbidden = false;
279  for (unsigned int i2 = 0; i2 < pos && !isForbidden; ++i2) {
280  if (state[i2] == 'G' && !isTurnaround[i2] &&
281  (forbids(fromEdges[i2], toEdges[i2], fromEdges[i1], toEdges[i1], true) || forbids(fromEdges[i1], toEdges[i1], fromEdges[i2], toEdges[i2], true))) {
282  isForbidden = true;
283  }
284  }
285  if (!isForbidden) {
286  state[i1] = 'G';
287  }
288  }
289  // correct behaviour for those that have to wait (mainly left-mover)
290  bool haveForbiddenLeftMover = false;
291  for (unsigned int i1 = 0; i1 < pos; ++i1) {
292  if (state[i1] != 'G') {
293  continue;
294  }
295  for (unsigned int i2 = 0; i2 < pos; ++i2) {
296  if ((state[i2] == 'G' || state[i2] == 'g') && forbids(fromEdges[i2], toEdges[i2], fromEdges[i1], toEdges[i1], true)) {
297  state[i1] = 'g';
298  if (!isTurnaround[i1]) {
299  haveForbiddenLeftMover = true;
300  }
301  }
302  }
303  }
304  state = addPedestrianPhases(logic, greenTime, state, crossings, fromEdges, toEdges);
305  // pedestrians have 'r' from here on
306  for (unsigned int i1 = pos; i1 < pos + crossings.size(); ++i1) {
307  state[i1] = 'r';
308  }
309 
310  if (brakingTime > 0) {
311  // build yellow (straight)
312  for (unsigned int i1 = 0; i1 < pos; ++i1) {
313  if (state[i1] != 'G' && state[i1] != 'g') {
314  continue;
315  }
316  if ((state[i1] >= 'a' && state[i1] <= 'z') && haveForbiddenLeftMover) {
317  continue;
318  }
319  state[i1] = 'y';
320  }
321  // add step
322  logic->addStep(brakingTime, state);
323  }
324 
325  if (haveForbiddenLeftMover && !myHaveSinglePhase) {
326  // build left green
327  for (unsigned int i1 = 0; i1 < pos; ++i1) {
328  if (state[i1] == 'Y' || state[i1] == 'y') {
329  state[i1] = 'r';
330  continue;
331  }
332  if (state[i1] == 'g') {
333  state[i1] = 'G';
334  }
335  }
336  // add step
337  logic->addStep(leftTurnTime, state);
338 
339  // build left yellow
340  if (brakingTime > 0) {
341  for (unsigned int i1 = 0; i1 < pos; ++i1) {
342  if (state[i1] != 'G' && state[i1] != 'g') {
343  continue;
344  }
345  state[i1] = 'y';
346  }
347  // add step
348  logic->addStep(brakingTime, state);
349  }
350  }
351  }
352  const SUMOTime totalDuration = logic->getDuration();
353  if (totalDuration > 0) {
354  if (totalDuration > 3 * (greenTime + 2 * brakingTime + leftTurnTime)) {
355  WRITE_WARNING("The traffic light '" + getID() + "' has a high cycle time of " + time2string(totalDuration) + ".");
356  }
357  logic->closeBuilding();
358  return logic;
359  } else {
360  delete logic;
361  return 0;
362  }
363 }
364 
365 
366 std::string
368  std::string state, const std::vector<NBNode::Crossing>& crossings, const EdgeVector& fromEdges, const EdgeVector& toEdges) {
369  const SUMOTime pedClearingTime = TIME2STEPS(5); // compute based on length of the crossing
370  const SUMOTime minPedTime = TIME2STEPS(4); // compute: must be able to reach the middle of the second "Richtungsfahrbahn"
371  const std::string orig = state;
372  state = patchStateForCrossings(state, crossings, fromEdges, toEdges);
373  if (orig == state) {
374  // add step
375  logic->addStep(greenTime, state);
376  } else {
377  const SUMOTime pedTime = greenTime - pedClearingTime;
378  if (pedTime >= minPedTime) {
379  // ensure clearing time for pedestrians
380  const size_t pedStates = crossings.size();
381  logic->addStep(pedTime, state);
382  state = state.substr(0, state.size() - pedStates) + std::string(pedStates, 'r');
383  logic->addStep(pedClearingTime, state);
384  } else {
385  state = orig;
386  // not safe for pedestrians.
387  logic->addStep(greenTime, state);
388  }
389  }
390  return state;
391 }
392 
393 
394 std::string
395 NBOwnTLDef::patchStateForCrossings(const std::string& state, const std::vector<NBNode::Crossing>& crossings, const EdgeVector& fromEdges, const EdgeVector& toEdges) {
396  std::string result = state;
397  const unsigned int pos = (unsigned int)(state.size() - crossings.size()); // number of controlled vehicle links
398  for (int ic = 0; ic < (int)crossings.size(); ++ic) {
399  const int i1 = pos + ic;
400  const NBNode::Crossing& cross = crossings[ic];
401  bool isForbidden = false;
402  for (unsigned int i2 = 0; i2 < pos && !isForbidden; ++i2) {
403  // only check connections at this crossings node
404  if (fromEdges[i2] != 0 && toEdges[i2] != 0 && fromEdges[i2]->getToNode() == cross.node) {
405  for (EdgeVector::const_iterator it = cross.edges.begin(); it != cross.edges.end(); ++it) {
406  const NBEdge* edge = *it;
407  const LinkDirection i2dir = cross.node->getDirection(fromEdges[i2], toEdges[i2]);
408  if (state[i2] != 'r' && (edge == fromEdges[i2] ||
409  (edge == toEdges[i2] && (i2dir == LINKDIR_STRAIGHT || i2dir == LINKDIR_PARTLEFT || i2dir == LINKDIR_PARTRIGHT)))) {
410  isForbidden = true;
411  break;
412  }
413  }
414  }
415  }
416  if (!isForbidden) {
417  result[i1] = 'G';
418  } else {
419  result[i1] = 'r';
420  }
421  }
422 
423  // correct behaviour for roads that are in conflict with a pedestrian crossing
424  for (unsigned int i1 = 0; i1 < pos; ++i1) {
425  if (result[i1] == 'G') {
426  for (int ic = 0; ic < (int)crossings.size(); ++ic) {
427  const NBNode::Crossing& crossing = crossings[ic];
428  if (fromEdges[i1] != 0 && toEdges[i1] != 0 && fromEdges[i1]->getToNode() == crossing.node) {
429  const int i2 = pos + ic;
430  if (result[i2] == 'G' && crossing.node->mustBrakeForCrossing(fromEdges[i1], toEdges[i1], crossing)) {
431  result[i1] = 'g';
432  break;
433  }
434  }
435  }
436  }
437  }
438  return result;
439 }
440 
441 
442 void
444 
445 
446 void
448  collectAllLinks();
449 }
450 
451 
452 void
454  // assign participating nodes to the request
455  collectNodes();
456  // collect the information about participating edges and links
457  collectEdges();
458  collectLinks();
459 }
460 
461 
462 void
464  // set the information about the link's positions within the tl into the
465  // edges the links are starting at, respectively
466  for (NBConnectionVector::const_iterator j = myControlledLinks.begin(); j != myControlledLinks.end(); ++j) {
467  const NBConnection& conn = *j;
468  NBEdge* edge = conn.getFrom();
469  edge->setControllingTLInformation(conn, getID());
470  }
471 }
472 
473 
474 void
475 NBOwnTLDef::remapRemoved(NBEdge* /*removed*/, const EdgeVector& /*incoming*/,
476  const EdgeVector& /*outgoing*/) {}
477 
478 
479 void
480 NBOwnTLDef::replaceRemoved(NBEdge* /*removed*/, int /*removedLane*/,
481  NBEdge* /*by*/, int /*byLane*/) {}
482 
483 
484 
485 /****************************************************************************/
static std::string patchStateForCrossings(const std::string &state, const std::vector< NBNode::Crossing > &crossings, const EdgeVector &fromEdges, const EdgeVector &toEdges)
compute phase state in regard to pedestrian crossings
Definition: NBOwnTLDef.cpp:395
The link is a partial left direction.
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
Definition: NBEdge.cpp:1736
TrafficLightType myType
The algorithm type for the traffic light.
void collectAllLinks()
helper method for use in NBOwnTLDef and NBLoadedSUMOTLDef
void closeBuilding()
closes the building process
A SUMO-compliant built logic for a traffic light.
const std::string & getProgramID() const
Returns the ProgramID.
The representation of a single edge during network building.
Definition: NBEdge.h:71
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
Definition: NBEdge.cpp:1725
The link is a 180 degree turn.
void collectNodes()
Collects the nodes participating in this traffic light.
Definition: NBOwnTLDef.cpp:443
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:61
The base class for traffic light logic definitions.
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission is a forbidden edge.
const EdgeVector & getIncomingEdges() const
Returns the list of incoming edges (must be build first)
#define TIME2STEPS(x)
Definition: SUMOTime.h:66
bool isTurningDirectionAt(const NBNode *n, const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:1655
std::vector< Connection > getConnectionsFromLane(unsigned int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:726
SUMOTime myOffset
The offset in the program.
NBEdge * getFrom() const
returns the from-edge (start of the connection)
The link is a (hard) left direction.
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
std::pair< NBEdge *, NBEdge * > getBestPair(EdgeVector &incoming)
Returns the combination of two edges from the given which has most unblocked streams.
Definition: NBOwnTLDef.cpp:158
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:67
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
The link is a straight direction.
const std::string & getID() const
Returns the id.
Definition: Named.h:60
void collectEdges()
Build the list of participating edges.
bool mustBrakeForCrossing(const NBEdge *const from, const NBEdge *const to, const Crossing &crossing) const
Returns the information whether the described flow must brake for the given crossing.
Definition: NBNode.cpp:1124
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces a removed edge/lane.
Definition: NBOwnTLDef.cpp:480
std::pair< NBEdge *, NBEdge * > getBestCombination(const EdgeVector &edges)
Returns the combination of two edges from the given which has most unblocked streams.
Definition: NBOwnTLDef.cpp:131
bool myHaveSinglePhase
Whether left-mover should not have an additional phase.
Definition: NBOwnTLDef.h:230
unsigned int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:344
~NBOwnTLDef()
Destructor.
Definition: NBOwnTLDef.cpp:77
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
The link is a (hard) right direction.
static std::string addPedestrianPhases(NBTrafficLightLogic *logic, SUMOTime greenTime, std::string state, const std::vector< NBNode::Crossing > &crossings, const EdgeVector &fromEdges, const EdgeVector &toEdges)
add 1 or 2 phases depending on the presence of pedestrian crossings
Definition: NBOwnTLDef.cpp:367
The link is a partial right direction.
SUMOTime getDuration() const
Returns the duration of the complete cycle.
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1142
SUMOReal computeUnblockedWeightedStreamNumber(const NBEdge *const e1, const NBEdge *const e2)
Returns how many streams outgoing from the edges can pass the junction without being blocked...
Definition: NBOwnTLDef.cpp:104
NBOwnTLDef(const std::string &id, const std::vector< NBNode * > &junctions, SUMOTime offset, TrafficLightType type)
Constructor.
Definition: NBOwnTLDef.cpp:55
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:368
void setTLControllingInformation(const NBEdgeCont &ec) const
Informs edges about being controlled by a tls.
Definition: NBOwnTLDef.cpp:463
void collectLinks()
Collects the links participating in this traffic light If a link could not be found.
Definition: NBOwnTLDef.cpp:447
SUMOReal getDirectionalWeight(LinkDirection dir)
Returns the weight of a stream given its direction.
Definition: NBOwnTLDef.cpp:87
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:38
NBTrafficLightLogic * myCompute(const NBEdgeCont &ec, unsigned int brakingTimeSeconds)
Computes the traffic light logic finally in dependence to the type.
Definition: NBOwnTLDef.cpp:187
static SUMOReal getMinAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the minimum distance (clockwise/counter-clockwise) between both angles.
Definition: GeomHelper.cpp:395
const NBNode * node
The parent node of this crossing.
Definition: NBNode.h:137
EdgeVector edges
The edges being crossed.
Definition: NBNode.h:139
Represents a single node (junction) during network building.
Definition: NBNode.h:75
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.
A definition of a pedestrian crossing.
Definition: NBNode.h:132
NBEdge * getTurnDestination() const
Definition: NBEdge.cpp:1952
#define SUMOReal
Definition: config.h:215
#define NUMERICAL_EPS
Definition: config.h:159
bool isLeftMover(const NBEdge *const from, const NBEdge *const to) const
returns the information whether the given link is a left-mover
std::vector< NBNode * > myControlledNodes
The container with participating nodes.
void addStep(SUMOTime duration, const std::string &state, int index=-1)
Adds a phase to the logic.
Sorts edges by their priority within the node they end at.
Definition: NBOwnTLDef.h:214
void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
Definition: NBOwnTLDef.cpp:453
NBConnectionVector myControlledLinks
The list of controlled links.
int getToPrio(const NBEdge *const e)
Returns this edge's priority at the node it ends at.
Definition: NBOwnTLDef.cpp:81
TrafficLightType
void remapRemoved(NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Replaces occurences of the removed edge in incoming/outgoing edges of all definitions.
Definition: NBOwnTLDef.cpp:475
The link has no direction (is a dead end link)
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.
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing) const
Returns the representation of the described stream's direction.
Definition: NBNode.cpp:1247