42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
55 for(std::map<std::string, NBNode*>::const_iterator i=nc.
begin(); i!=nc.
end(); ++i) {
64 std::vector<Combination> combinations;
65 for(std::vector<NBEdge*>::const_iterator j=outgoing.begin(); j!=outgoing.end(); ++j) {
67 for(std::vector<NBEdge*>::const_iterator k=incoming.begin(); k!=incoming.end(); ++k) {
101 combinations.push_back(c);
106 std::set<NBEdge*> seen;
107 bool haveWarned =
false;
108 for(std::vector<Combination>::const_iterator j=combinations.begin(); j!=combinations.end(); ++j) {
109 if(seen.find((*j).from)!=seen.end() || seen.find((*j).to)!=seen.end() ) {
111 if((*j).angle>360&&!haveWarned) {
112 WRITE_WARNING(
"Ambiguity in turnarounds computation at node '" + node->
getID() +
"'.");
118 seen.insert((*j).from);
119 seen.insert((*j).to);
121 (*j).from->setTurningDestination((*j).to);
131 for(std::map<std::string, NBNode*>::const_iterator i=nc.
begin(); i!=nc.
end(); ++i) {
136 std::vector<NBEdge*> &allEdges = (*i).second->
myAllEdges;
137 std::vector<NBEdge*> &incoming = (*i).second->myIncomingEdges;
138 std::vector<NBEdge*> &outgoing = (*i).second->myOutgoingEdges;
143 std::vector<NBEdge*>::iterator j;
144 for (j = allEdges.begin(); j != allEdges.end() - 1 && j != allEdges.end(); ++j) {
147 if (allEdges.size() > 1 && j != allEdges.end()) {
156 const std::vector<NBEdge*>::iterator& i1,
157 const std::vector<NBEdge*>::iterator& i2) {
179 for(std::map<std::string, NBNode*>::const_iterator i=nc.
begin(); i!=nc.
end(); ++i) {
198 for (EdgeVector::const_iterator j = i + 1; j != n->
myIncomingEdges.end(); j++) {
223 for(std::map<std::string, NBNode*>::const_iterator i=nc.
begin(); i!=nc.
end(); ++i) {
227 (*j)->setJunctionPriority(n, 0);
253 NBEdge* best = incoming[0];
254 while (incoming.size() > 0 &&
samePriority(best, incoming[0])) {
255 bestIncoming.push_back(*incoming.begin());
256 incoming.erase(incoming.begin());
259 assert(outgoing.size() != 0);
263 while (outgoing.size() > 0 &&
samePriority(best, outgoing[0])) {
264 bestOutgoing.push_back(*outgoing.begin());
265 outgoing.erase(outgoing.begin());
270 EdgeVector::iterator i;
271 std::map<NBEdge*, NBEdge*> counterIncomingEdges;
272 std::map<NBEdge*, NBEdge*> counterOutgoingEdges;
275 for (i = bestIncoming.begin(); i != bestIncoming.end(); ++i) {
277 counterIncomingEdges[*i] = *incoming.begin();
279 counterOutgoingEdges[*i] = *outgoing.begin();
283 if (bestIncoming.size() == 1) {
286 if(counterIncomingEdges.find(best1)!=counterIncomingEdges.end()) {
290 NBEdge *s = counterIncomingEdges.find(best1)->second;
295 if (bestOutgoing.size() != 0) {
299 if(counterOutgoingEdges.find(best1)!=counterOutgoingEdges.end()) {
300 NBEdge *s = counterOutgoingEdges.find(best1)->second;
316 bool hadBest =
false;
317 for (i = bestIncoming.begin(); i != bestIncoming.end(); ++i) {
318 EdgeVector::iterator j;
324 for (j = i + 1; j != bestIncoming.end(); ++j) {
331 if (!hadBest || angle > bestAngle) {
341 if (bestOutgoing.size() != 0) {
346 if (bestOutgoing.size() != 0) {