Functions | |
| void | recheckForLoops (std::vector< const ROEdge * > &edges) throw () |
| Computes the costs (travel time) for the given list of edges. | |
| void ROHelper::recheckForLoops | ( | std::vector< const ROEdge * > & | edges | ) | throw () |
Computes the costs (travel time) for the given list of edges.
| [in] | edges | The edges to pass |
| [in] | v | The vehicle that passes the edges |
| [in] | time | The time at which the vehicle begins to pass the edges |
| [in] | edges | The list of edges to remove loops from |
Definition at line 58 of file ROHelper.cpp.
Referenced by RORoute::recheckForLoops().
00058 { 00059 RONode* start = edges[0]->getFromNode(); 00060 unsigned lastStart = 0; 00061 for (unsigned i=1; i<edges.size(); i++) { 00062 if (edges[i]->getFromNode() == start) { 00063 lastStart = i; 00064 } 00065 } 00066 if (lastStart > 0) { 00067 edges.erase(edges.begin(), edges.begin() + lastStart - 1); 00068 } 00069 RONode* end = edges.back()->getToNode(); 00070 size_t firstEnd = edges.size()-1; 00071 for (unsigned i=0; i<firstEnd; i++) { 00072 if (edges[i]->getToNode() == end) { 00073 firstEnd = i; 00074 } 00075 } 00076 if (firstEnd < edges.size()-1) { 00077 edges.erase(edges.begin() + firstEnd + 2, edges.end()); 00078 } 00079 }
1.5.6