44#define DEBUGCOND (myJunction->getID() == "C")
65 myOutgoing(outgoing) {
70 myDone.reserve(variations);
71 for (
int i = 0; i < variations; i++) {
76 for (NBConnectionProhibits::const_iterator j = loadedProhibits.begin(); j != loadedProhibits.end(); j++) {
78 bool ok1 = prohibited.
check(ec);
93 for (NBConnectionVector::const_iterator k = prohibiting.begin(); k != prohibiting.end(); k++) {
95 bool ok2 = sprohibiting.
check(ec);
108 myDone[idx2][idx1] =
true;
109 myDone[idx1][idx2] =
true;
113 std::string pfID = prohibited.
getFrom() !=
nullptr ? prohibited.
getFrom()->
getID() :
"UNKNOWN";
114 std::string ptID = prohibited.
getTo() !=
nullptr ? prohibited.
getTo()->
getID() :
"UNKNOWN";
115 std::string bfID = sprohibiting.
getFrom() !=
nullptr ? sprohibiting.
getFrom()->
getID() :
"UNKNOWN";
116 std::string btID = sprohibiting.
getTo() !=
nullptr ? sprohibiting.
getTo()->
getID() :
"UNKNOWN";
117 WRITE_WARNING(
"could not prohibit " + pfID +
"->" + ptID +
" by " + bfID +
"->" + btID);
124 for (
int s1 = 0; s1 < variations; s1++) {
125 for (
int s2 = s1 + 1; s2 < variations; s2++) {
146 EdgeVector::const_iterator i, j;
162 EdgeVector::const_iterator pfrom = std::find(
myAll.begin(),
myAll.end(), from);
163 while (*pfrom != to) {
166 EdgeVector::const_iterator pto = std::find(
myAll.begin(),
myAll.end(), to);
167 while (*pto != from) {
180 EdgeVector::const_iterator pfrom = std::find(
myAll.begin(),
myAll.end(), from);
181 while (*pfrom != to) {
184 EdgeVector::const_iterator pto = std::find(
myAll.begin(),
myAll.end(), to);
185 while (*pto != from) {
200 if (to1 ==
nullptr || to2 ==
nullptr) {
206 if (idx1 < 0 || idx2 < 0) {
215 myDone[idx1][idx2] =
true;
216 myDone[idx2][idx1] =
true;
252#ifdef DEBUG_SETBLOCKING
255 <<
" 1:" << from1->
getID() <<
"->" << to1->
getID()
256 <<
" 2:" << from2->
getID() <<
"->" << to2->
getID() <<
"\n";
263#ifdef DEBUG_SETBLOCKING
265 std::cout <<
" p1=" << from1p <<
" p2=" << from2p <<
"\n";
270 if (from1p > from2p) {
274 if (from2p > from1p) {
284#ifdef DEBUG_SETBLOCKING
285 if (
DEBUGCOND) std::cout <<
"setBlocking"
286 <<
" 1:" << from1->
getID() <<
"->" << to1->
getID()
287 <<
" 2:" << from2->
getID() <<
"->" << to2->
getID()
328 EdgeVector::const_iterator c1 = std::find(
myAll.begin(),
myAll.end(), from1);
331 while (*c1 != from1 && *c1 != from2) {
339#ifdef DEBUG_SETBLOCKING
340 if (
DEBUGCOND) std::cout <<
"setBlocking"
341 <<
" 1:" << from1->
getID() <<
"->" << to1->
getID()
342 <<
" 2:" << from2->
getID() <<
"->" << to2->
getID()
350 EdgeVector::const_iterator c2 = std::find(
myAll.begin(),
myAll.end(), from2);
353 while (*c2 != from2 && *c2 != from1) {
361#ifdef DEBUG_SETBLOCKING
362 if (
DEBUGCOND) std::cout <<
"setBlocking"
363 <<
" 1:" << from1->
getID() <<
"->" << to1->
getID()
364 <<
" 2:" << from2->
getID() <<
"->" << to2->
getID()
371#ifdef DEBUG_SETBLOCKING
372 if (
DEBUGCOND) std::cout <<
"setBlocking"
373 <<
" 1:" << from1->
getID() <<
"->" << to1->
getID()
374 <<
" 2:" << from2->
getID() <<
"->" << to2->
getID()
382 EdgeVector::const_iterator p = std::find(
myAll.begin(),
myAll.end(), from);
386 if (p ==
myAll.begin()) {
396 assert(linkIndex >= 0);
397 assert(linkIndex < (
int)
myFoes.size());
404 assert(linkIndex >= 0);
416 for (
int i = 0; i <
numLinks; i++) {
419 if (padding && i < 10) {
438 EdgeVector::const_iterator i;
441 int noLanes = (*i)->getNumLanes();
442 for (
int k = 0; k < noLanes; k++) {
448 for (
auto c : crossings) {
457 int noLanesEdge1 = (*i11)->getNumLanes();
458 for (
int j1 = 0; j1 < noLanesEdge1; j1++) {
459 std::vector<NBEdge::Connection> el1 = (*i11)->getConnectionsFromLane(j1);
460 for (std::vector<NBEdge::Connection>::iterator i12 = el1.begin(); i12 != el1.end(); ++i12) {
461 int idx1 =
getIndex((*i11), (*i12).toEdge);
467 int noLanesEdge2 = (*i21)->getNumLanes();
468 for (
int j2 = 0; j2 < noLanesEdge2; j2++) {
469 std::vector<NBEdge::Connection> el2 = (*i21)->getConnectionsFromLane(j2);
470 for (std::vector<NBEdge::Connection>::iterator i22 = el2.begin(); i22 != el2.end(); i22++) {
471 int idx2 =
getIndex((*i21), (*i22).toEdge);
477 if ((*i11) == (*i21)) {
480#ifdef DEBUG_SETBLOCKING
481 if (
DEBUGCOND) std::cout <<
"resetSignalised both"
482 <<
" 1:" << (*i11)->getID() <<
"->" << (*i12).toEdge->getID()
483 <<
" 2:" << (*i21)->getID() <<
"->" << (*i22).toEdge->getID()
490 if (((*i12).tlID ==
"" && (*i22).tlID ==
"")
492 ((*i12).tlID !=
"" && (*i22).tlID !=
"")) {
498 if (!
foes(*i11, (*i12).toEdge, *i21, (*i22).toEdge)) {
503 if ((*i12).tlID !=
"") {
506#ifdef DEBUG_SETBLOCKING
507 if (
DEBUGCOND) std::cout <<
"resetSignalised:2 yields"
508 <<
" 1:" << (*i11)->getID() <<
"->" << (*i12).toEdge->getID()
509 <<
" 2:" << (*i21)->getID() <<
"->" << (*i22).toEdge->getID() <<
"\n";
514#ifdef DEBUG_SETBLOCKING
515 if (
DEBUGCOND) std::cout <<
"resetSignalised:1 yields"
516 <<
" 1:" << (*i11)->getID() <<
"->" << (*i12).toEdge->getID()
517 <<
" 2:" << (*i21)->getID() <<
"->" << (*i22).toEdge->getID() <<
"\n";
534 const int numLanesEdge = e->getNumLanes();
535 for (
int j = 0; j < numLanesEdge; j++) {
536 int numConnections = (int)e->getConnectionsFromLane(j).size();
538 if (numConnections > 0) {
543 return std::make_pair(numLanes,
numLinks);
549 const NBEdge*
const from2,
const NBEdge*
const to2)
const {
551 if (to1 ==
nullptr || to2 ==
nullptr) {
557 if (idx1 < 0 || idx2 < 0) {
568 const NBEdge*
const possProhibitedFrom,
const NBEdge*
const possProhibitedTo,
569 bool regardNonSignalisedLowerPriority)
const {
571 if (possProhibitorTo ==
nullptr || possProhibitedTo ==
nullptr) {
575 int possProhibitorIdx =
getIndex(possProhibitorFrom, possProhibitorTo);
576 int possProhibitedIdx =
getIndex(possProhibitedFrom, possProhibitedTo);
577 if (possProhibitorIdx < 0 || possProhibitedIdx < 0) {
583 if (!regardNonSignalisedLowerPriority) {
584 return myForbids[possProhibitorIdx][possProhibitedIdx];
587 if (!
myForbids[possProhibitorIdx][possProhibitedIdx]) {
600 assert(c.toEdge != 0);
602 const std::string
foes =
getFoesString(from, c.toEdge, fromLane, c.toLane, checkLaneFoes);
621 const int size = (int) connected.size();
622 for (
int k = size; k-- > 0;) {
623 const NBEdge* to = connected[k].toEdge;
626 if (e == from || e == to) {
631 foes += foe ?
'1' :
'0';
648 const int toLane = c.
toLane;
657 for (std::vector<NBNode::Crossing*>::const_reverse_iterator i = crossings.rbegin(); i != crossings.rend(); i++) {
664 int noLanes = (*i)->getNumLanes();
665 for (
int j = noLanes; j-- > 0;) {
666 std::vector<NBEdge::Connection> connected = (*i)->getConnectionsFromLane(j);
667 int size = (int) connected.size();
668 for (
int k = size; k-- > 0;) {
676 }
else if ((*i) == from && fromLane == j) {
681 std::cout <<
" c=" << queryCon.
getDescription(from) <<
" prohibitC=" << connected[k].getDescription(*i)
692 assert(connected[k].toEdge != 0);
693 const int idx2 =
getIndex(*i, connected[k].toEdge);
694 assert(k < (
int) connected.size());
700 std::cout <<
" c=" << queryCon.
getDescription(from) <<
" prohibitC=" << connected[k].getDescription(*i)
701 <<
" idx=" << idx <<
" idx2=" << idx2
703 <<
" clf=" << checkLaneFoes
706 <<
" lc=" <<
laneConflict(from, to, toLane, *i, connected[k].toEdge, connected[k].toLane)
709 <<
" mc=" <<
mergeConflict(from, queryCon, *i, connected[k],
false)
712 <<
" bc=" <<
bidiConflict(from, queryCon, *i, connected[k],
false)
718 const bool hasLaneConflict = (!(checkLaneFoes ||
checkLaneFoesByClass(queryCon, *i, connected[k])
720 ||
laneConflict(from, to, toLane, *i, connected[k].toEdge, connected[k].toLane));
726 ||
bidiConflict(from, queryCon, *i, connected[k],
false)
753 for (std::vector<NBNode::Crossing*>::const_reverse_iterator i = crossings.rbegin(); i != crossings.rend(); i++) {
755 for (EdgeVector::const_iterator it_e = (**i).edges.begin(); it_e != (**i).edges.end(); ++it_e) {
756 if ((*it_e) == from || (*it_e) == to) {
761 result +=
foes ?
'1' :
'0';
766 for (
int j = (*i)->getNumLanes() - 1; j >= 0; --j) {
767 const std::vector<NBEdge::Connection>& connected = (*i)->getConnectionsFromLane(j);
768 int size = (int) connected.size();
769 for (
int k = size; k-- > 0;) {
770 const bool hasLaneConflict = (!(checkLaneFoes ||
checkLaneFoesByClass(queryCon, *i, connected[k])
772 ||
laneConflict(from, to, toLane, *i, connected[k].toEdge, connected[k].toLane));
773 if ((
foes(from, to, (*i), connected[k].toEdge) && hasLaneConflict)
775 ||
myJunction->
turnFoes(from, to, fromLane, *i, connected[k].toEdge, connected[k].fromLane, lefthand)
808 if (from == prohibitorFrom
876 if (shape.size() == 0 || otherShape.size() == 0) {
881 if (minDV < shape.
length() - POSITION_EPS && minDV > POSITION_EPS) {
891 if (from == prohibitorFrom) {
908 if (from == prohibitorFrom) {
921 if (!
foes && fromBidi && prohibitorFromBidi) {
925 if (prohibitorFromBidi &&
932 return fromBidi || prohibitorFromBidi;
962 std::set<int> fromTargetLanes;
964 if (c.toEdge == con.
toEdge) {
965 fromTargetLanes.insert(c.toLane);
969 if (c.toEdge == con.
toEdge && fromTargetLanes.count(c.toLane) != 0) {
981 const NBEdge* prohibitorFrom,
const NBEdge* prohibitorTo,
int prohibitorToLane)
const {
982 if (to != prohibitorTo) {
997 return rightOfProhibitor ? toLane >= prohibitorToLane : toLane <= prohibitorToLane;
1015 for (
int i = 0; i < variations; i++) {
1017 for (
int j = 0; j < variations; j++) {
1035 if (linkIndex >= 0 && (
int)
myResponse.size() > linkIndex) {
1037 if (!includePedCrossings) {
1040 if (response.find_first_of(
"1") == std::string::npos) {
1057 for (
int idx1 = 0; idx1 <
numLinks(); idx1++) {
1064 if (includePedCrossings) {
1066 for (std::vector<NBNode::Crossing*>::const_reverse_iterator i = crossings.rbegin(); i != crossings.rend(); i++) {
1084 for (EdgeVector::const_reverse_iterator i =
myIncoming.rbegin(); i !=
myIncoming.rend(); i++) {
1085 int noLanes = (*i)->getNumLanes();
1086 for (
int j = noLanes; j-- > 0;) {
1087 std::vector<NBEdge::Connection> connected = (*i)->getConnectionsFromLane(j);
1088 const int size = (int) connected.size();
1089 for (
int k = size; k-- > 0;) {
1090 if ((*i) == from && fromLane != j
1099 for (
int idx1 = 0; idx1 <
numLinks(); idx1++) {
1114 if (crossing.
priority || mustYield) {
1117 if ((e == from && crossing.
priority) || e == to) {
1128 const NBEdge*
const possProhibitedFrom,
const NBEdge*
const possProhibitedTo)
const {
1130 int idx1 =
getIndex(possProhibitorFrom, possProhibitorTo);
1131 int idx2 =
getIndex(possProhibitedFrom, possProhibitedTo);
1148 std::map<const NBEdge*, int> incomingCount;
1150 std::map<const NBEdge*, std::set<int> > approachedLanes;
1152 std::map<const NBEdge*, std::vector<const NBEdge*> > incomingEdges;
1155 incomingCount[con.toEdge]++;
1156 approachedLanes[con.toEdge].insert(con.toLane);
1157 incomingEdges[con.toEdge].push_back(e);
1160 for (std::map<const NBEdge*, int>::iterator it = incomingCount.begin(); it != incomingCount.end(); ++it) {
1161 const NBEdge*
const to = it->first;
1163 if ((
int)approachedLanes[to].size() >= it->second) {
1164 const std::vector<const NBEdge*>& incoming = incomingEdges[to];
1166 for (
const NBEdge*
const e1 : incoming) {
1167 for (
const NBEdge*
const e2 : incoming) {
1169#ifdef DEBUG_SETBLOCKING
1170 if (
DEBUGCOND) std::cout <<
"resetCooperating"
1171 <<
" 1:" << e1->
getID() <<
"->" << to->
getID()
1172 <<
" 2:" << e2->getID() <<
"->" << to->
getID()
1184 for (
int i = 0; i < (int)
myFoes.size(); i++) {
1194 return myFoes[linkIndex].find_first_of(
"1") != std::string::npos;
#define WRITE_WARNING(msg)
std::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
std::vector< NBConnection > NBConnectionVector
Definition of a connection vector.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
std::ostream & operator<<(std::ostream &os, const NBRequest &r)
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permissions is a railway edge.
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_REQUEST
description of a logic request within the junction
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
@ PARTLEFT
The link is a partial left direction.
@ RIGHT
The link is a (hard) right direction.
@ LEFT
The link is a (hard) left direction.
@ STRAIGHT
The link is a straight direction.
@ PARTRIGHT
The link is a partial right direction.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
NBEdge * getFrom() const
returns the from-edge (start of the connection)
NBEdge * getTo() const
returns the to-edge (end of the connection)
bool check(const NBEdgeCont &ec)
checks whether the edges are still valid
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
Storage for edges, including some functionality operating on multiple edges.
The representation of a single edge during network building.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
const std::vector< Connection > & getConnections() const
Returns the connections.
double getLaneWidth() const
Returns the default width of lanes of this edge.
NBNode * getToNode() const
Returns the destination node of the edge.
const Connection & getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection (unmodifiable) This method goes through "myConnections" and returns ...
const std::string & getID() const
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
int getNumLanes() const
Returns the number of lanes.
std::vector< Connection > getConnectionsFromLane(int lane, const NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
static double firstIntersection(const PositionVector &v1, const PositionVector &v2, double width1, double width2, const std::string &error="", bool secondIntersection=false)
compute the first intersection point between the given lane geometries considering their rspective wi...
bool isConnectedTo(const NBEdge *e, const bool ignoreTurnaround=false) const
Returns the information whethe a connection to the given edge has been added (or computed)
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
const NBEdge * getBidiEdge() const
NBNode * getFromNode() const
Returns the origin node of the edge.
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
static double relAngle(double angle1, double angle2)
computes the relative angle between the two angles
A definition of a pedestrian crossing.
bool priority
whether the pedestrians have priority
EdgeVector edges
The edges being crossed.
Represents a single node (junction) during network building.
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turing right on a red light
SumoXMLNodeType getType() const
Returns the type of this node.
static bool rightTurnConflict(const NBEdge *from, const NBEdge *to, int fromLane, const NBEdge *prohibitorFrom, const NBEdge *prohibitorTo, int prohibitorFromLane)
return whether the given laneToLane connection is a right turn which must yield to a bicycle crossing...
std::vector< Crossing * > getCrossings() const
return this junctions pedestrian crossings
bool isBentPriority() const
return whether a priority road turns at this node
bool turnFoes(const NBEdge *from, const NBEdge *to, int fromLane, const NBEdge *from2, const NBEdge *to2, int fromLane2, bool lefthand=false) const
return whether the given laneToLane connection originate from the same edge and are in conflict due t...
bool isConstantWidthTransition() const
detects whether a given junction splits or merges lanes while keeping constant road width
bool tlsContConflict(const NBEdge *from, const NBEdge::Connection &c, const NBEdge *foeFrom, const NBEdge::Connection &foe) const
whether the connection must yield if the foe remains on the intersection after its phase ends
bool isTLControlled() const
Returns whether this node is controlled by any tls.
std::vector< std::string > myResponse
const EdgeVector & myOutgoing
edges outgoing from the junction
CombinationsCont myForbids
the link X link blockings
int computeLaneResponse(NBEdge *from, int lane, int pos, const bool checkLaneFoes)
computes the response of a certain lane Returns the next link index within the junction
CombinationsCont myDone
the link X link is done-checks
const EdgeVector & myAll
all (icoming and outgoing) of the junctions edges
bool checkLaneFoesByCooperation(const NBEdge *from, const NBEdge::Connection &con, const NBEdge *prohibitorFrom, const NBEdge::Connection &prohibitorCon) const
whether the given connections must be checked for lane conflicts due to disjunct target lanes
std::vector< std::string > myFoes
precomputed right-of-way matrices for each lane-to-lane link
int distanceCounterClockwise(NBEdge *from, NBEdge *to)
returns the distance between the incoming (from) and the outgoing (to) edge clockwise in edges
bool bidiConflict(const NBEdge *from, const NBEdge::Connection &con, const NBEdge *prohibitorFrom, const NBEdge::Connection &prohibitorCon, bool foes) const
whether straight connections are in conflict via bidirectional lane use
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.
bool hasConflictAtLink(int linkIndex) const
whether there are conflicting streams of traffic for the given link index
const EdgeVector & myIncoming
edges incoming to the junction
NBNode * myJunction
the node the request is assigned to
int numLinks() const
return to total number of edge-to-edge connections of this request-logic
const std::string & getFoes(int linkIndex) const
bool hasConflict() const
whether there are conflicting streams of traffic at this node
std::string getFoesString(NBEdge *from, NBEdge *to, int fromLane, int toLane, const bool checkLaneFoes) const
void buildBitfieldLogic()
builds the bitset-representation of the logic
bool oppositeLeftTurnConflict(const NBEdge *from, const NBEdge::Connection &con, const NBEdge *prohibitorFrom, const NBEdge::Connection &prohibitorCon, bool foes) const
whether opposite left turns intersect
bool laneConflict(const NBEdge *from, const NBEdge *to, int toLane, const NBEdge *prohibitorFrom, const NBEdge *prohibitorTo, int prohibitorToLane) const
return whether the given laneToLane connections prohibit each other under the assumption that the edg...
bool indirectLeftTurnConflict(const NBEdge *from, const NBEdge::Connection &con, const NBEdge *prohibitorFrom, const NBEdge::Connection &prohibitorCon, bool foes) const
whether straight and indirect left turn are in conflict
int getIndex(const NBEdge *const from, const NBEdge *const to) const
Returns the index to the internal combination container for the given edge combination.
static bool mustBrakeForCrossing(const NBNode *node, const NBEdge *const from, const NBEdge *const to, const NBNode::Crossing &crossing)
Returns the information whether the described flow must brake for the given crossing.
void computeRightOutgoingLinkCrossings(NBEdge *from, NBEdge *to)
computes the relationships between links outgoing right of the given link */
bool mergeConflict(const NBEdge *from, const NBEdge::Connection &con, const NBEdge *prohibitorFrom, const NBEdge::Connection &prohibitorCon, bool foes) const
whether multple connections from the same edge target the same lane
void writeLogic(OutputDevice &into) const
NBRequest(const NBEdgeCont &ec, NBNode *junction, const EdgeVector &all, const EdgeVector &incoming, const EdgeVector &outgoing, const NBConnectionProhibits &loadedProhibits)
void computeLogic(const bool checkLaneFoes)
writes the XML-representation of the logic as a bitset-logic XML representation
std::string getResponseString(const NBEdge *const from, const NBEdge::Connection &c, const bool checkLaneFoes) const
Writes the response of a certain link.
std::pair< int, int > getSizes() const
returns the number of the junction's lanes and the number of the junction's links in respect.
bool mustBrake(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
const std::string & getResponse(int linkIndex) const
int computeCrossingResponse(const NBNode::Crossing &crossing, int pos)
computes the response of a certain crossing Returns the next link index within the junction
void setBlocking(NBEdge *from1, NBEdge *to1, NBEdge *from2, NBEdge *to2)
void computeLeftOutgoingLinkCrossings(NBEdge *from, NBEdge *to)
computes the relationships between links outgoing left of the given link
bool checkLaneFoesByClass(const NBEdge::Connection &con, const NBEdge *prohibitorFrom, const NBEdge::Connection &prohibitorCon) const
whether the given connections must be checked for lane conflicts due to the vClasses involved
void resetCooperating()
reset foes it the number of lanes matches (or exceeds) the number of incoming connections for an edge
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.
bool rightTurnConflict(const NBEdge *from, const NBEdge::Connection &con, const NBEdge *prohibitorFrom, const NBEdge::Connection &prohibitorCon) const
whether the given connections crosses the foe connection from the same lane and must yield
static void reportWarnings()
reports warnings if any occurred
std::vector< bool > LinkInfoCont
definition of a container to store boolean informations about a link into
std::vector< bool > myHaveVia
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & writePadding(const std::string &val)
writes padding (ignored for binary output)
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void append(const PositionVector &v, double sameThreshold=2.0)
double length() const
Returns the length.
bool almostSame(const PositionVector &v2, double maxDiv=POSITION_EPS) const
check if the two vectors have the same length and pairwise similar positions
PositionVector reverse() const
reverse position vector
A structure which describes a connection between edges or lanes.
bool indirectLeft
Whether this connection is an indirect left turn.
int fromLane
The lane the connections starts at.
int toLane
The lane the connections yields in.
NBEdge * toEdge
The edge the connections yields in.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
PositionVector viaShape
shape of via
std::string getDescription(const NBEdge *parent) const
get string describing this connection
PositionVector shape
shape of Connection
int tlLinkIndex
The index of this connection within the controlling traffic light.