44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
57 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
66 std::vector<Combination> combinations;
67 for (std::vector<NBEdge*>::const_iterator j = outgoing.begin(); j != outgoing.end(); ++j) {
69 for (std::vector<NBEdge*>::const_iterator k = incoming.begin(); k != incoming.end(); ++k) {
103 combinations.push_back(c);
108 std::set<NBEdge*> seen;
109 bool haveWarned =
false;
110 for (std::vector<Combination>::const_iterator j = combinations.begin(); j != combinations.end(); ++j) {
111 if (seen.find((*j).from) != seen.end() || seen.find((*j).to) != seen.end()) {
113 if ((*j).angle > 360 && !haveWarned) {
114 WRITE_WARNING(
"Ambiguity in turnarounds computation at node '" + node->
getID() +
"'.");
120 seen.insert((*j).from);
121 seen.insert((*j).to);
123 (*j).from->setTurningDestination((*j).to);
133 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
139 EdgeVector& incoming = (*i).second->myIncomingEdges;
140 EdgeVector& outgoing = (*i).second->myOutgoingEdges;
141 std::vector<NBNode::Crossing>& crossings = (*i).second->myCrossings;
146 std::vector<NBEdge*>::iterator j;
147 for (j = allEdges.begin(); j != allEdges.end() - 1 && j != allEdges.end(); ++j) {
150 if (allEdges.size() > 1 && j != allEdges.end()) {
170 const std::vector<NBEdge*>::iterator& i1,
171 const std::vector<NBEdge*>::iterator& i2) {
193 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
212 for (EdgeVector::const_iterator j = i + 1; j != n->
myIncomingEdges.end(); j++) {
221 const int p1 = (*i)->getPriority();
222 const int p2 = (*j)->getPriority();
240 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
244 (*j)->setJunctionPriority(n, 0);
270 NBEdge* best = incoming[0];
271 while (incoming.size() > 0 &&
samePriority(best, incoming[0])) {
272 bestIncoming.push_back(*incoming.begin());
273 incoming.erase(incoming.begin());
276 assert(outgoing.size() != 0);
280 while (outgoing.size() > 0 &&
samePriority(best, outgoing[0])) {
281 bestOutgoing.push_back(*outgoing.begin());
282 outgoing.erase(outgoing.begin());
287 EdgeVector::iterator i;
288 std::map<NBEdge*, NBEdge*> counterIncomingEdges;
289 std::map<NBEdge*, NBEdge*> counterOutgoingEdges;
292 for (i = bestIncoming.begin(); i != bestIncoming.end(); ++i) {
294 counterIncomingEdges[*i] = *incoming.begin();
296 counterOutgoingEdges[*i] = *outgoing.begin();
300 if (bestIncoming.size() == 1) {
303 if (counterIncomingEdges.find(best1) != counterIncomingEdges.end()) {
307 NBEdge* s = counterIncomingEdges.find(best1)->second;
312 if (bestOutgoing.size() != 0) {
316 if (counterOutgoingEdges.find(best1) != counterOutgoingEdges.end()) {
317 NBEdge* s = counterOutgoingEdges.find(best1)->second;
333 bool hadBest =
false;
334 for (i = bestIncoming.begin(); i != bestIncoming.end(); ++i) {
335 EdgeVector::iterator j;
341 for (j = i + 1; j != bestIncoming.end(); ++j) {
348 if (!hadBest || angle > bestAngle) {
358 if (bestOutgoing.size() != 0) {
363 if (bestOutgoing.size() != 0) {