57 #ifdef CHECK_MEMORY_LEAKS 59 #endif // CHECK_MEMORY_LEAKS 62 #define DEBUGCOND true 90 assert(myTransitions.size() > virtEdge);
92 NBEdge* succEdge = myTransitions[virtEdge];
93 std::vector<unsigned int> lanes;
97 std::map<NBEdge*, std::vector<unsigned int> >::iterator i =
myConnections.find(succEdge);
105 std::vector<unsigned int>::iterator j = find(lanes.begin(), lanes.end(), lane);
106 if (j == lanes.end()) {
108 lanes.push_back(lane);
121 if (outgoing.size() == 0) {
125 assert(outgoing.size() > 0);
127 #ifdef DEBUG_CONNECTION_GUESSING 129 std::cout <<
" MainDirections edge=" << parent->
getID() <<
" straightest=" << outgoing[indexOfStraightest]->getID() <<
" dir=" <<
toString(straightestDir) <<
"\n";
141 if (outgoing.back()->getJunctionPriority(to) == 1) {
147 if (outgoing.back()->getPriority() > tmp[0]->getPriority()) {
150 if (outgoing.back()->getNumLanes() > tmp[0]->getNumLanes()) {
159 NBEdge* edge = *(tmp.begin());
172 return myDirs.empty();
178 return find(myDirs.begin(), myDirs.end(), d) != myDirs.end();
198 std::string type,
SUMOReal speed,
unsigned int nolanes,
200 const std::string& streetName,
216 init(nolanes,
false,
id);
221 std::string type,
SUMOReal speed,
unsigned int nolanes,
224 const std::string& streetName,
225 const std::string& origID,
241 init(nolanes, tryIgnoreNodePositions, origID);
270 if (to == tpl->
myTo) {
279 SUMOReal speed,
unsigned int nolanes,
int priority,
281 const std::string& streetName,
283 bool tryIgnoreNodePositions) {
305 const std::vector<Lane> oldLanes =
myLanes;
306 init(nolanes, tryIgnoreNodePositions, oldLanes.empty() ?
"" : oldLanes[0].origID);
307 for (
int i = 0; i < (int)nolanes; ++i) {
309 myLanes[i] = oldLanes[
MIN2(i, (
int)oldLanes.size() - 1)];
328 if (from == 0 || to == 0) {
329 throw ProcessError(
"At least one of edge's '" +
myID +
"' nodes is not known.");
346 NBEdge::init(
unsigned int noLanes,
bool tryIgnoreNodePositions,
const std::string& origID) {
351 throw ProcessError(
"At least one of edge's '" +
myID +
"' nodes is not known.");
357 if (!tryIgnoreNodePositions ||
myGeom.size() < 2) {
372 WRITE_ERROR(
"Edge's '" +
myID +
"' from- and to-node are at the same position.");
380 assert(
myGeom.size() >= 2);
381 if (
myLanes.size() > noLanes) {
384 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
385 for (
int lane = noLanes; lane < (int)
myLanes.size(); ++lane) {
386 (*i)->removeFromConnections(
this, -1, lane);
391 for (
unsigned int i = 0; i < noLanes; i++) {
406 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
407 myLanes[i].shape.add(xoff, yoff, 0);
416 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
420 (*i).shape.mirrorX();
421 (*i).viaShape.mirrorX();
465 if (shape.size() >= 2) {
476 assert(shape.size() >= 2);
477 assert(shape.
length() > 0);
493 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
498 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
499 assert(
myLanes[i].shape.length() > 0);
500 avgLength +=
myLanes[i].shape.length();
516 assert(pbv.size() > 0);
524 ns[0].set(ns[0].x(), ns[0].y(), startNode->
getPosition().
z());
525 assert(ns.size() >= 2);
530 assert(pbv.size() > 0);
584 NBEdge* currentEdge =
this;
585 for (
int i = 1; i < (int)
myGeom.size() - 1; i++) {
587 if (i != (
int)
myGeom.size() - 2) {
588 std::string nodename =
myID +
"_in_between#" +
toString(i);
590 throw ProcessError(
"Error on adding in-between node '" + nodename +
"'.");
598 currentEdge->
myTo = newTo;
601 std::string edgename =
myID +
"[" +
toString(i - 1) +
"]";
605 if (!ec.
insert(currentEdge,
true)) {
606 throw ProcessError(
"Error on adding splitted edge '" + edgename +
"'.");
631 std::vector<SUMOReal> angles;
633 for (
int i = 0; i < (int)
myGeom.size() - 1; ++i) {
638 for (
int i = 0; i < (int)angles.size() - 1; ++i) {
641 if (maxAngle > 0 && relAngle > maxAngle) {
647 if (i == 0 || i == (
int)angles.size() - 2) {
648 const bool start = i == 0;
652 if (minRadius > 0 && r < minRadius) {
655 (start ?
"start" :
"end") +
" of edge '" +
getID() +
"'.");
661 (start ?
"start" :
"end") +
" of edge '" +
getID() +
"'.");
698 bool mayUseSameDestination,
699 bool mayDefinitelyPass,
714 return setConnection(from, dest, toLane, type, mayUseSameDestination, mayDefinitelyPass, keepClear, contPos);
720 NBEdge* dest,
unsigned int toLane,
722 bool invalidatePrevious,
723 bool mayDefinitelyPass) {
724 if (invalidatePrevious) {
728 for (
unsigned int i = 0; i < no && ok; i++) {
738 bool mayUseSameDestination,
739 bool mayDefinitelyPass,
766 if ((*i).toEdge == destEdge && ((*i).fromLane == -1 || (*i).toLane == -1)) {
773 if (mayDefinitelyPass) {
796 std::vector<NBEdge::Connection>
798 std::vector<NBEdge::Connection> ret;
800 if ((*i).fromLane == lane) {
812 (*i).fromLane == fromLane
814 && (*i).toLane == toLane) {
819 +
" to " + to->
getID() +
"_" +
toString(toLane) +
" not found");
850 if (find(outgoing.begin(), outgoing.end(), (*i).toEdge) == outgoing.end()) {
851 outgoing.push_back((*i).toEdge);
856 if (it->fromLane < 0 && it->toLane < 0) {
858 EdgeVector::iterator forbidden = find(outgoing.begin(), outgoing.end(), it->toEdge);
859 if (forbidden != outgoing.end()) {
860 outgoing.erase(forbidden);
865 unsigned int size = (
unsigned int) outgoing.size();
867 edges->reserve(size);
868 for (EdgeVector::const_iterator i = outgoing.begin(); i != outgoing.end(); i++) {
871 edges->push_back(outedge);
883 if (find(ret.begin(), ret.end(), (*i).toEdge) == ret.end()) {
884 ret.push_back((*i).toEdge);
893 std::vector<int> ret;
896 if ((*i).toEdge == currentOutgoing) {
897 ret.push_back((*i).fromLane);
920 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
925 for (EdgeVector::iterator j = connected.begin(); j != connected.end(); j++) {
939 && (fromLane < 0 || c.
fromLane == fromLane)
940 && (toLane < 0 || c.
toLane == toLane)) {
964 if (reallowSetting) {
976 if ((*i).toEdge == which) {
978 (*i).toLane += laneOff;
989 std::map<int, int> laneMap;
993 bool wasConnected =
false;
995 if ((*i).toEdge != which) {
999 if ((*i).fromLane != -1) {
1000 int fromLane = (*i).fromLane;
1001 laneMap[(*i).toLane] = fromLane;
1002 if (minLane == -1 || minLane > fromLane) {
1005 if (maxLane == -1 || maxLane < fromLane) {
1010 if (!wasConnected) {
1016 std::vector<NBEdge::Connection> conns = origConns;
1017 for (std::vector<NBEdge::Connection>::iterator i = conns.begin(); i != conns.end(); ++i) {
1018 if ((*i).toEdge == which) {
1021 int fromLane = (*i).fromLane;
1023 if (laneMap.find(fromLane) == laneMap.end()) {
1024 if (fromLane >= 0 && fromLane <= minLane) {
1027 if (fromLane >= 0 && fromLane >= maxLane) {
1031 toUse = laneMap[fromLane];
1059 unsigned int index = 0;
1065 std::vector<Connection>::iterator i =
myConnections.begin() + index;
1088 std::string innerID =
":" + n.
getID();
1090 unsigned int edgeIndex = linkIndex;
1091 unsigned int internalLaneIndex = 0;
1098 if (con.
toEdge != toEdge) {
1101 edgeIndex = linkIndex;
1102 toEdge = (*i).toEdge;
1103 internalLaneIndex = 0;
1106 std::vector<unsigned int> foeInternalLinks;
1116 std::pair<SUMOReal, std::vector<unsigned int> > crossingPositions(-1, std::vector<unsigned int>());
1117 std::set<std::string> tmpFoeIncomingLanes;
1124 unsigned int index = 0;
1126 for (EdgeVector::const_iterator i2 = incoming.begin(); i2 != incoming.end(); ++i2) {
1127 const std::vector<Connection>& elv = (*i2)->getConnections();
1128 for (std::vector<NBEdge::Connection>::const_iterator k2 = elv.begin(); k2 != elv.end(); k2++) {
1129 if ((*k2).toEdge == 0) {
1132 bool needsCont = n.
needsCont(
this, *i2, con, *k2);
1135 crossingPositions.second.push_back(index);
1139 SUMOReal width2 = (*k2).toEdge->getLaneWidth((*k2).toLane);
1140 if ((*k2).toEdge->getPermissions((*k2).toLane) !=
SVC_BICYCLE) {
1146 if (crossingPositions.first < 0 || crossingPositions.first > minDV) {
1147 crossingPositions.first = minDV;
1152 this, con.
toEdge, con.
fromLane, (*i2), (*k2).toEdge, (*k2).fromLane);
1154 if (n.
foes(
this, con.
toEdge, *i2, (*k2).toEdge) || rightTurnConflict) {
1155 foeInternalLinks.push_back(index);
1159 if ((n.
forbids(*i2, (*k2).toEdge,
this, con.
toEdge, signalised) || rightTurnConflict) && (needsCont || dir ==
LINKDIR_TURN)) {
1160 tmpFoeIncomingLanes.insert((*i2)->getID() +
"_" +
toString((*k2).fromLane));
1166 const std::vector<NBNode::Crossing>& crossings = n.
getCrossings();
1167 for (std::vector<NBNode::Crossing>::const_iterator it_c = crossings.begin(); it_c != crossings.end(); ++it_c) {
1169 for (EdgeVector::const_iterator it_e = crossing.
edges.begin(); it_e != crossing.
edges.end(); ++it_e) {
1170 const NBEdge* edge = *it_e;
1172 if (
this == edge || con.
toEdge == edge) {
1173 foeInternalLinks.push_back(index);
1174 if (con.
toEdge == edge &&
1182 if (crossingPositions.first < 0 || crossingPositions.first > minDV) {
1183 crossingPositions.first = minDV;
1206 crossingPositions.first = -1;
1209 crossingPositions.first = con.
contPos;
1227 assert(shape.size() >= 2);
1229 if (crossingPositions.first >= 0) {
1230 std::pair<PositionVector, PositionVector>
split = shape.
splitAt(crossingPositions.first);
1231 con.
id = innerID +
"_" +
toString(edgeIndex);
1232 con.
shape = split.first;
1235 con.
viaID = innerID +
"_" +
toString(splitIndex + noInternalNoSplits);
1241 con.
id = innerID +
"_" +
toString(edgeIndex);
1246 ++internalLaneIndex;
1266 if (tmp.size() > 0) {
1267 intersect =
MIN2(intersect, tmp[0]);
1270 if (tmp.size() > 0) {
1271 intersect =
MIN2(intersect, tmp[0]);
1304 assert(atNode ==
myTo);
1319 assert(atNode ==
myTo);
1327 if (!onlyPossible) {
1347 std::vector<SUMOReal> offsets;
1348 for (
unsigned int i = 0; i <
myLanes.size(); ++i) {
1349 offsets.push_back(0);
1352 for (
int i = (
int)
myLanes.size() - 2; i >= 0; --i) {
1354 offsets[i] = offset;
1361 for (
unsigned int i = 0; i <
myLanes.size(); ++i) {
1367 for (
unsigned int i = 0; i <
myLanes.size(); ++i) {
1368 offsets[i] += offset;
1372 for (
unsigned int i = 0; i <
myLanes.size(); ++i) {
1376 WRITE_WARNING(
"In edge '" +
getID() +
"': lane shape could not be determined (" + e.what() +
").");
1447 for (std::vector<Lane>::const_iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
1448 if ((*i).permissions !=
SVCAll) {
1458 std::vector<Lane>::const_iterator i =
myLanes.begin();
1461 for (; i !=
myLanes.end(); ++i) {
1462 if (i->permissions != firstLanePermissions) {
1472 for (std::vector<Lane>::const_iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
1483 for (std::vector<Lane>::const_iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
1484 if (i->width !=
myLanes.begin()->width) {
1494 for (std::vector<Lane>::const_iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
1495 if (i->endOffset !=
myLanes.begin()->endOffset) {
1519 for (EdgeVector::const_iterator i = o.begin(); i != o.end(); ++i) {
1557 std::vector<unsigned int> connNumbersPerLane(
myLanes.size(), 0);
1559 if ((*i).toEdge == 0 || (*i).fromLane < 0 || (*i).toLane < 0) {
1562 if ((*i).fromLane >= 0) {
1563 ++connNumbersPerLane[(*i).fromLane];
1574 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
1590 }
else if (common == 0) {
1593 const int origToLane = c.
toLane;
1595 int toLane = origToLane;
1608 int toLane = origToLane;
1643 if (outgoing->size() == 0) {
1655 #ifdef DEBUG_CONNECTION_GUESSING 1657 std::cout <<
" divideOnEdges " <<
getID() <<
" outgoing=" <<
toString(*outgoing) <<
" prios=" <<
toString(*priorities) <<
"\n";
1662 std::vector<int> availableLanes;
1663 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1665 availableLanes.push_back(i);
1668 if (availableLanes.size() > 0) {
1672 availableLanes.clear();
1673 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1678 availableLanes.push_back(i);
1680 if (availableLanes.size() > 0) {
1684 availableLanes.clear();
1685 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1690 availableLanes.push_back(i);
1692 if (availableLanes.size() > 0) {
1696 availableLanes.clear();
1697 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1702 availableLanes.push_back(i);
1704 if (availableLanes.size() > 0) {
1709 if ((*i).fromLane == -1) {
1728 const int numOutgoing = (int) outgoing->size();
1729 std::vector<SUMOReal> resultingLanes;
1730 resultingLanes.reserve(numOutgoing);
1733 for (
int i = 0; i < numOutgoing; i++) {
1740 if (res > availableLanes.size()) {
1741 res = (
SUMOReal) availableLanes.size();
1744 resultingLanes.push_back(res);
1745 sumResulting += res;
1746 if (minResulting > res && res > 0) {
1758 transition.reserve(numOutgoing);
1759 for (
int i = 0; i < numOutgoing; i++) {
1762 assert(i < (
int)resultingLanes.size());
1763 const int tmpNum = (int)std::ceil(resultingLanes[i] / minResulting);
1764 numVirtual += tmpNum;
1765 for (
SUMOReal j = 0; j < tmpNum; j++) {
1766 transition.push_back((*outgoing)[i]);
1769 #ifdef DEBUG_CONNECTION_GUESSING 1771 std::cout <<
" prioSum=" << prioSum <<
" sumResulting=" << sumResulting <<
" minResulting=" << minResulting <<
" numVirtual=" << numVirtual <<
" availLanes=" <<
toString(availableLanes) <<
" resLanes=" <<
toString(resultingLanes) <<
" transition=" <<
toString(transition) <<
"\n";
1778 Bresenham::compute(&adder, static_cast<unsigned int>(availableLanes.size()), numVirtual);
1779 const std::map<NBEdge*, std::vector<unsigned int> >& l2eConns = adder.
getBuiltConnections();
1780 for (EdgeVector::const_iterator i = outgoing->begin(); i != outgoing->end(); ++i) {
1782 assert(l2eConns.find(target) != l2eConns.end());
1783 const std::vector<unsigned int> lanes = (l2eConns.find(target))->second;
1784 for (std::vector<unsigned int>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
1785 const int fromIndex = availableLanes[*j];
1804 if (numConsToTarget >= targetLanes) {
1809 for (
unsigned int ii = 0; ii <
myLanes.size(); ++ii) {
1819 #ifdef DEBUG_CONNECTION_GUESSING 1821 std::cout <<
" request connection from " <<
getID() <<
"_" << fromIndex <<
" to " << target->
getID() <<
"\n";
1834 const int numOutgoing = (int) outgoing->size();
1836 NBEdge* rightOfTarget = 0;
1837 NBEdge* leftOfTarget = 0;
1839 for (
int i = 0; i < numOutgoing; i++) {
1840 if (maxPrio < (*priorities)[i]) {
1843 maxPrio = (*priorities)[i];
1844 target = (*outgoing)[i];
1845 rightOfTarget = i == 0 ? outgoing->back() : (*outgoing)[i - 1];
1846 leftOfTarget = i + 1 == numOutgoing ? outgoing->front() : (*outgoing)[i + 1];
1858 const int numDesiredConsToTarget =
MIN2(targetLanes, (
int)availableLanes.size());
1859 #ifdef DEBUG_CONNECTION_GUESSING 1861 std::cout <<
" checking extra lanes for target=" << target->
getID() <<
" cons=" << numConsToTarget <<
" desired=" << numDesiredConsToTarget <<
"\n";
1864 std::vector<int>::const_iterator it_avail = availableLanes.begin();
1865 while (numConsToTarget < numDesiredConsToTarget && it_avail != availableLanes.end()) {
1866 const int fromIndex = *it_avail;
1875 #ifdef DEBUG_CONNECTION_GUESSING 1877 std::cout <<
" candidate from " <<
getID() <<
"_" << fromIndex <<
" to " << target->
getID() <<
"\n";
1886 #ifdef DEBUG_CONNECTION_GUESSING 1888 std::cout <<
" request additional connection from " <<
getID() <<
"_" << fromIndex <<
" to " << target->
getID() <<
"\n";
1894 #ifdef DEBUG_CONNECTION_GUESSING 1899 <<
" rightOfTarget=" << rightOfTarget->
getID()
1900 <<
" leftOfTarget=" << leftOfTarget->
getID()
1914 std::vector<int>* priorities =
new std::vector<int>();
1915 if (outgoing->size() == 0) {
1918 priorities->reserve(outgoing->size());
1919 EdgeVector::const_iterator i;
1920 for (i = outgoing->begin(); i != outgoing->end(); i++) {
1923 assert((prio + 1) * 2 > 0);
1924 prio = (prio + 1) * 2;
1925 priorities->push_back(prio);
1932 i = find(outgoing->begin(), outgoing->end(), *(tmp.begin()));
1933 unsigned int dist = (
unsigned int) distance(outgoing->begin(), i);
1935 #ifdef DEBUG_CONNECTION_GUESSING 1937 <<
" outgoing=" <<
toString(*outgoing)
1938 <<
" priorities1=" <<
toString(*priorities)
1945 assert(priorities->size() > 0);
1946 (*priorities)[0] /= 2;
1947 #ifdef DEBUG_CONNECTION_GUESSING 1949 std::cout <<
" priorities2=" <<
toString(*priorities) <<
"\n";
1956 if (mainDirections.
empty()) {
1957 assert(dist < priorities->size());
1958 (*priorities)[dist] *= 2;
1959 #ifdef DEBUG_CONNECTION_GUESSING 1961 std::cout <<
" priorities3=" <<
toString(*priorities) <<
"\n";
1966 (*priorities)[dist] += 1;
1970 (*priorities)[0] /= 4;
1971 (*priorities)[(int)priorities->size() - 1] /= 2;
1972 #ifdef DEBUG_CONNECTION_GUESSING 1974 std::cout <<
" priorities6=" <<
toString(*priorities) <<
"\n";
1981 (*priorities)[dist] *= 2;
1982 #ifdef DEBUG_CONNECTION_GUESSING 1984 std::cout <<
" priorities4=" <<
toString(*priorities) <<
"\n";
1988 (*priorities)[dist] *= 3;
1989 #ifdef DEBUG_CONNECTION_GUESSING 1991 std::cout <<
" priorities5=" <<
toString(*priorities) <<
"\n";
2004 for (std::vector<int>::const_iterator i = priorities.begin(); i != priorities.end(); i++) {
2022 const int fromLane = (int)
myLanes.size() - 1;
2024 if (checkPermissions) {
2055 if (pos < tolerance) {
2069 for (
unsigned int i = 0; i < lanes; i++) {
2071 for (std::vector<NBEdge::Connection>::iterator j = elv.begin(); j != elv.end(); j++) {
2073 assert(el.
tlID ==
"");
2119 assert(fromLane < 0 || fromLane < (
int)
myLanes.size());
2121 if (fromLane >= 0 && toLane >= 0) {
2123 std::vector<Connection>::iterator i =
2131 connection.
tlID = tlID;
2138 unsigned int no = 0;
2139 bool hadError =
false;
2141 if ((*i).toEdge != toEdge) {
2144 if (fromLane >= 0 && fromLane != (*i).fromLane) {
2147 if (toLane >= 0 && toLane != (*i).toLane) {
2150 if ((*i).tlID ==
"") {
2152 (*i).tlLinkNo = tlIndex;
2155 if ((*i).tlID != tlID && (*i).tlLinkNo == tlIndex) {
2156 WRITE_WARNING(
"The lane '" + toString<int>((*i).fromLane) +
"' on edge '" +
getID() +
"' already had a traffic light signal.");
2161 if (hadError && no == 0) {
2162 WRITE_WARNING(
"Could not set any signal of the tlLogic '" + tlID +
"' (unknown group)");
2196 ret =
myLanes.back().shape.reverse();
2214 ret =
myLanes[0].shape.reverse();
2245 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2247 myLanes[i].permissions != possContinuation->
myLanes[i].permissions ||
2273 if (find(conn.begin(), conn.end(), possContinuation) == conn.end()) {
2289 if (conns.size() !=
myLanes.size() - offset) {
2305 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2332 if ((*i).toEdge == e && (*i).tlID !=
"") {
2364 assert(distances.size() > 0);
2371 assert(index <=
myLanes.size());
2375 int templateIndex = index > 0 ? index - 1 : index + 1;
2386 for (EdgeVector::const_iterator i = incs.begin(); i != incs.end(); ++i) {
2387 (*i)->invalidateConnections(
true);
2395 unsigned int newLaneNo = (
unsigned int)
myLanes.size() + by;
2396 while (
myLanes.size() < newLaneNo) {
2406 assert(index <
myLanes.size());
2411 for (EdgeVector::const_iterator i = incs.begin(); i != incs.end(); ++i) {
2412 (*i)->invalidateConnections(
true);
2421 unsigned int newLaneNo = (
unsigned int)
myLanes.size() - by;
2422 assert(newLaneNo > 0);
2423 while (
myLanes.size() > newLaneNo) {
2441 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2445 assert(lane < (
int)
myLanes.size());
2446 myLanes[lane].permissions |= vclass;
2454 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2458 assert(lane < (
int)
myLanes.size());
2459 myLanes[lane].permissions &= ~vclass;
2467 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2471 assert(lane < (
int)
myLanes.size());
2472 myLanes[lane].preferred |= vclass;
2482 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2488 assert(lane < (
int)
myLanes.size());
2504 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2521 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2527 assert(lane < (
int)
myLanes.size());
2528 myLanes[lane].endOffset = offset;
2537 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2543 assert(lane < (
int)
myLanes.size());
2551 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2556 assert(lane < (
int)
myLanes.size());
2557 myLanes[lane].permissions = permissions;
2565 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2570 assert(lane < (
int)
myLanes.size());
2571 myLanes[lane].preferred = permissions;
2580 for (
unsigned int i = 0; i <
myLanes.size(); i++) {
2585 assert(lane < (
int)
myLanes.size());
2586 return myLanes[lane].permissions;
2599 for (std::vector<Lane>::iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
2600 (*i).permissions =
SVCAll;
2623 for (
int i = start; i != end; i += direction) {
2635 std::set<SVCPermissions>
2637 std::set<SVCPermissions> result;
2641 for (
int i = iStart; i < iEnd; ++i) {
2658 std::cout <<
getID() <<
" angle=" <<
getAngleAtNode(node) <<
" convAngle=" << angle <<
"\n";
2688 if (
myLanes[0].permissions == vclass) {
2700 myLanes[0].permissions = vclass;
2711 for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); ++it) {
2712 (*it)->shiftToLanesToEdge(
this, 1);
2724 if ((*it).toEdge == to && (*it).toLane >= 0) {
2725 (*it).toLane += laneOff;
2734 const int i = (node ==
myTo ? -1 : 0);
2735 const int i2 = (node ==
myTo ? 0 : -1);
2741 if (dist < neededOffset && dist2 < neededOffset2) {
2749 WRITE_WARNING(
"Could not avoid overlapping shape at node '" + node->
getID() +
"' for edge '" +
getID() +
"'");
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
bool gDebugFlag1
global utility flags for debugging
void invalidateConnections(bool reallowSetting=false)
int tlLinkNo
The index of this connection within the controlling traffic light.
The link is a partial left direction.
const PositionVector & getLaneShape(unsigned int i) const
Returns the shape of the nth lane.
std::vector< Lane > myLanes
Lane information.
bool includes(Direction d) const
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
bool hasConnectionTo(NBEdge *destEdge, unsigned int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
const std::string & getTypeID() const
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
void divideOnEdges(const EdgeVector *outgoing)
A structure which describes a connection between edges or lanes.
int toLane
The lane the connections yields in.
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
SUMOReal width
This lane's width.
std::string foeIncomingLanes
const SUMOReal SUMO_const_laneWidth
SUMOReal myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
std::vector< TLSDisabledConnection > myTLSDisabledConnections
static const SUMOReal UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
PositionVector getSubpart2D(SUMOReal beginOffset, SUMOReal endOffset) const
get subpart of a position vector in two dimensions (Z is ignored)
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
NBEdge * toEdge
The edge the connections yields in.
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset)
patches loaded signal plans by modifying lane indices
void mirrorX()
mirror coordinates along the x-axis
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
The relationships between edges are computed/loaded.
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
void setLaneWidth(int lane, SUMOReal width)
set lane specific width (negative lane implies set for all lanes)
bool isTLControlled() const
Returns whether this node is controlled by any tls.
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
Some static methods for string processing.
void moveOutgoingConnectionsFrom(NBEdge *e, unsigned int laneOff)
const SUMOReal SUMO_const_laneWidthAndOffset
void addSidewalk(SUMOReal width)
add a pedestrian sidewalk of the given width and shift existing connctions
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
The representation of a single edge during network building.
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
void clearControllingTLInformation()
clears tlID for all connections
Lane2LaneInfoType
Modes of setting connections between lanes.
std::vector< int > * prepareEdgePriorities(const EdgeVector *outgoing)
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
The link is a 180 degree turn.
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
int getFromLane() const
returns the from-lane
void incLaneNo(unsigned int by)
PositionVector getCCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going counter-clock-wise around the given node ...
bool intersects(const Position &p1, const Position &p2) const
Returns the information whether this list of points interesects the given line.
bool addLane2LaneConnection(unsigned int fromLane, NBEdge *dest, unsigned int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, SUMOReal contPos=UNSPECIFIED_CONTPOS)
Adds a connection between the specified this edge's lane and an approached one.
const std::vector< Crossing > & getCrossings() const
return this junctions pedestrian crossings
bool addLane2LaneConnections(unsigned int fromLane, NBEdge *dest, unsigned int toLane, unsigned int no, Lane2LaneInfoType type, bool invalidatePrevious=false, bool mayDefinitelyPass=false)
Builds no connections starting at the given lanes.
static const SUMOReal UNSPECIFIED_SPEED
unspecified lane speed
std::vector< Direction > myDirs
void buildInnerEdges(const NBNode &n, unsigned int noInternalNoSplits, unsigned int &linkIndex, unsigned int &splitIndex)
void markAsInLane2LaneState()
SUMOReal getTotalWidth() const
Returns the combined width of all lanes of this edge.
Lanes to lanes - relationships are computed; should be recheked.
SUMOReal getLaneWidth() const
Returns the default width of lanes of this edge.
std::string getLaneIDInsecure(unsigned int lane) const
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given ...
PositionVector shape
The lane's shape.
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
PositionVector getSubpartByIndex(int beginIndex, int count) const
get subpart of a position vector using index and a cout
SUMOReal getShapeStartAngle() const
Returns the angle at the start of the edge (only using edge shape)
PositionVector myGeom
The geometry for the edge.
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission is a forbidden edge.
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
static const SUMOReal UNSPECIFIED_CONTPOS
unspecified internal junction position
const SUMOReal SUMO_const_laneOffset
bool around(const Position &p, SUMOReal offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point...
bool setConnection(unsigned int lane, NBEdge *destEdge, unsigned int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, SUMOReal contPos=UNSPECIFIED_CONTPOS)
Adds a connection to a certain lane of a certain edge.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
const SVCPermissions SVCAll
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
SUMOReal beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position ...
static SUMOReal angleDiff(const SUMOReal angle1, const SUMOReal angle2)
Returns the difference of the second angle to the first angle in radiants.
SUMOReal x() const
Returns the x-position.
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
Position positionAtOffset2D(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
static SUMOReal firstIntersection(const PositionVector &v1, const PositionVector &v2, SUMOReal width2)
The link is a (hard) left direction.
#define WRITE_WARNING(msg)
The connection was computed and validated.
SUMOReal distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector) ...
static OptionsCont & getOptions()
Retrieves the options.
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode) const
static bool rightTurnConflict(const NBEdge *from, const NBEdge *to, int fromLane, const NBEdge *prohibitorFrom, const NBEdge *prohibitorTo, int prohibitorFromLane, bool lefthand=false)
return whether the given laneToLane connection is a right turn which must yield to a bicycle crossing...
PositionVector reverse() const
reverse position vector
The edge has been loaded, nothing is computed yet.
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
The link is a straight direction.
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
void moveConnectionToRight(unsigned int lane)
bool hasPermissions() const
whether at least one lane has restrictions
SUMOReal getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
An (internal) definition of a single lane of an edge.
const std::string & getID() const
Returns the id.
SUMOReal length2D() const
Returns the length.
SUMOReal mySpeed
The maximal speed.
std::vector< SUMOReal > distances(const PositionVector &s, bool perpendicular=false) const
distances of all my points to s and all of s points to myself
bool needsCont(const NBEdge *fromE, const NBEdge *otherFromE, const NBEdge::Connection &c, const NBEdge::Connection &otherC) const
whether an internal junction should be built at from and respect other
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
bool isConnectedTo(NBEdge *e)
Returns the information whethe a connection to the given edge has been added (or computed) ...
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
void push_front_noDoublePos(const Position &p)
insert in front a non double position
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the edge.
const Position & getPosition() const
Returns the position of this node.
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
const std::map< NBEdge *, std::vector< unsigned int > > & getBuiltConnections() const
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Connection getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection This method goes through "myConnections" and returns the specified o...
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
int getPriority() const
Returns the priority of the edge.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
void checkGeometry(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
Check the angles of successive geometry segments.
std::string getLaneID(unsigned int lane) const
void moveConnectionToLeft(unsigned int lane)
static SUMOReal legacyDegree(const SUMOReal angle, const bool positive=false)
static const int FORWARD
edge directions (for pedestrian related stuff)
std::string tlID
The id of the traffic light that controls this connection.
std::string getInternalLaneID() const
int fromLane
The lane the connections starts at.
A point in 2D or 3D with translation and scaling methods.
void add(SUMOReal xoff, SUMOReal yoff, SUMOReal zoff)
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
bool lanesWereAssigned() const
static int computePrioritySum(const std::vector< int > &priorities)
static bool connections_sorter(const Connection &c1, const Connection &c2)
std::vector< unsigned int > foeInternalLinks
SUMOReal z() const
Returns the z-position.
SumoXMLNodeType getType() const
Returns the type of this node.
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
bool hasLoadedLength() const
Returns whether a length was set explicitly.
int getNumLanes() const
Returns the number of lanes.
bool canMoveConnection(const Connection &con, unsigned int newFromLane) const
whether the connection can originate on newFromLane
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
SUMOReal contPos
custom position for internal junction on this connection
SUMOReal myLaneWidth
This width of this edge's lanes.
int myPriority
The priority of the edge.
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Storage for edges, including some functionality operating on multiple edges.
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
The link is a (hard) right direction.
EdgeBuildingStep myStep
The building step.
SUMOReal getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
std::vector< Connection > myConnections
List of connections to following edges.
void setLoadedLength(SUMOReal val)
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
The connection was given by the user.
const PositionVector & getShape() const
retrieve the junction shape
SUMOReal getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
The link is a partial right direction.
static void compute(BresenhamCallBack *callBack, const unsigned int val1, const unsigned int val2)
SUMOReal getEndOffset() const
Returns the offset to the destination node.
vehicle is a passenger car (a "normal" car)
bool myAmInnerEdge
Information whether this is a junction-inner edge.
bool isLeftMover(const NBEdge *const from, const NBEdge *const to) const
Computes whether the given connection is a left mover across the junction.
Base class for objects which have an id.
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
SUMOReal myLoadedLength
An optional length to use (-1 if not valid)
std::pair< PositionVector, PositionVector > splitAt(SUMOReal where) const
Returns the two lists made when this list vector is splitted at the given point.
static std::string convertUmlaute(std::string str)
Converts german "Umlaute" to their latin-version.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
SUMOReal getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
SUMOReal length() const
Returns the length.
void addRestrictedLane(SUMOReal width, SUMOVehicleClass vclass)
add a lane of the given width, restricted to the given class and shift existing connctions ...
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
static const int BACKWARD
void addBikeLane(SUMOReal width)
add a bicycle lane of the given width and shift existing connctions
void decLaneNo(unsigned int by)
std::string myID
The name of the object.
NBNode * getToNode() const
Returns the destination node of the edge.
PositionVector computeInternalLaneShape(NBEdge *fromE, const NBEdge::Connection &con, int numPoints) const
Compute the shape for an internal lane.
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
void removeDoublePoints(SUMOReal minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
void execute(const unsigned int lane, const unsigned int virtEdge)
executes a bresenham - step
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
add some straight connections
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
SUMOReal angleAt2D(int pos) const
get angle in certain position of position vector
SUMOReal getMaxLaneOffset()
static const SUMOReal UNSPECIFIED_LOADED_LENGTH
no length override given
void deleteLane(unsigned int index, bool recompute=true)
std::vector< NBEdge * > EdgeVector
SUMOReal myLength
The length of the edge.
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
const PositionVector & getGeometry() const
Returns the geometry of the edge.
The edge has been loaded and connections shall not be added.
int getToLane() const
returns the to-lane
SUMOReal y() const
Returns the y-position.
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
PositionVector computeLaneShape(unsigned int lane, SUMOReal offset) const
Computes the shape for the given lane.
void reduceGeometry(const SUMOReal minDist)
Removes points with a distance lesser than the given.
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
void replaceInConnections(NBEdge *which, NBEdge *by, unsigned int laneOff)
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
SUMOReal mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
std::string myType
The type of the edge.
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
void append(NBEdge *continuation)
NBEdge * getTo() const
returns the to-edge (end of the connection)
SUMOReal getLaneSpeed(unsigned int lane) const
void shiftToLanesToEdge(NBEdge *to, unsigned int laneOff)
modifify the toLane for all connections to the given edge
NBNode * tryGetNodeAtPosition(SUMOReal pos, SUMOReal tolerance=5.0) const
Returns the node at the given edges length (using an epsilon) When no node is existing at the given p...
The connection was computed.
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
SUMOReal myStartAngle
The angles of the edge.
EdgeVector edges
The edges being crossed.
Represents a single node (junction) during network building.
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to, int indexOfStraightest)
constructor
void dismissVehicleClassInformation()
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
A definition of a pedestrian crossing.
void move2side(SUMOReal amount)
move position vector to side using certain ammount
bool hasLaneSpecificWidth() const
whether lanes differ in width
void setEndOffset(int lane, SUMOReal offset)
set lane specific end-offset (negative lane implies set for all lanes)
void appendTurnaround(bool noTLSControlled, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
Direction
enum of possible directions
bool isNearEnough2BeJoined2(NBEdge *e, SUMOReal threshold) const
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
void push_back_noDoublePos(const Position &p)
insert in back a non double position
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
SUMOReal getShapeEndAngle() const
Returns the angle at the end of the edge (only using edge shape) The angle is computed in computeAngl...
void computeAngle()
computes the angle of this edge and stores it in myAngle
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Container for nodes during the netbuilding process.
SUMOReal getFinalLength() const
length that will be assigned to the lanes in the final network
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
static T maxValue(const std::vector< T > &v)
unsigned int internalLaneIndex
The lane index of this internal lane within the internal edge.
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
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 setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
NBEdge(const std::string &id, NBNode *from, NBNode *to, std::string type, SUMOReal speed, unsigned int nolanes, int priority, SUMOReal width, SUMOReal offset, const std::string &streetName="", LaneSpreadFunction spread=LANESPREAD_RIGHT)
Constructor.
#define WRITE_MESSAGE(msg)
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > *priorities)
std::vector< SUMOReal > intersectsAtLengths2D(const PositionVector &other) const
For all intersections between this vector and other, return the 2D-length of the subvector from this ...
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
Lanes to edges - relationships are computed/loaded.
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
const std::string & getStreetName() const
Returns the street name of this edge.
void addLane(unsigned int index, bool recompute=true)
NBNode * myFrom
The source and the destination node.
bool expandableBy(NBEdge *possContinuation) const
NBEdge * getTurnDestination(bool possibleDestination=false) const
void init(unsigned int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
PositionVector getSubpart(SUMOReal beginOffset, SUMOReal endOffset) const
get subpart of a position vector
~MainDirections()
destructor
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
SUMOReal angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position ...
void append(const PositionVector &v, SUMOReal sameThreshold=2.0)
void extrapolate(const SUMOReal val, const bool onlyFirst=false)
extrapolate position vector
void copyConnectionsFrom(NBEdge *src)
void reinit(NBNode *from, NBNode *to, const std::string &type, SUMOReal speed, unsigned int nolanes, int priority, PositionVector geom, SUMOReal width, SUMOReal offset, const std::string &streetName, LaneSpreadFunction spread=LANESPREAD_RIGHT, bool tryIgnoreNodePositions=false)
Resets initial values.
static const SUMOReal ANGLE_LOOKAHEAD
the distance at which to take the default angle
SUMOReal getLength() const
Returns the computed length of the edge.
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
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.
NBNode * getFromNode() const
Returns the origin node of the edge.
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.