44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
61 const bool isPermanent,
const RGBColor*
const c,
62 const std::vector<SUMOVehicleParameter::Stop>& stops)
63 :
Named(id), myEdges(edges), myAmPermanent(isPermanent),
64 myReferenceCounter(isPermanent ? 1 : 0),
65 myColor(c), myStops(stops) {}
87 return (
unsigned)
myEdges.size();
127 myDistDict[id] = std::make_pair(routeDist, permanent);
136 RouteDict::iterator it =
myDict.find(
id);
138 RouteDistDict::iterator it2 =
myDistDict.find(
id);
139 if (it2 ==
myDistDict.end() || it2->second.first->getOverallProb() == 0) {
142 return it2->second.first->get();
150 RouteDistDict::iterator it2 =
myDistDict.find(
id);
154 return it2->second.first;
161 delete i->second.first;
164 for (RouteDict::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
173 RouteDistDict::iterator it =
myDistDict.find(
id);
174 if (it !=
myDistDict.end() && !it->second.second) {
175 const std::vector<const MSRoute*>& routes = it->second.first->getVals();
176 for (std::vector<const MSRoute*>::const_iterator i = routes.begin(); i != routes.end(); ++i) {
179 delete it->second.first;
188 for (RouteDict::const_iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
189 into.push_back((*i).first);
192 into.push_back((*i).first);
200 MSEdgeVector::const_iterator i =
myEdges.begin();
204 for (; i !=
myEdges.end(); ++i) {
210 if (upTo || i !=
myEdges.end() - 1) {
220 std::vector<MSEdge*>::const_iterator i = edgelist.begin();
221 for (; i != edgelist.end(); ++i) {
238 for (RouteDict::iterator it =
myDict.begin(); it !=
myDict.end(); ++it) {
256 for (MSEdgeVector::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
257 ret += (*i)->getLength();
265 bool isFirstIteration =
true;
267 MSEdgeVector::const_iterator it = std::find(
myEdges.begin(),
myEdges.end(), fromEdge);
273 if (fromEdge == toEdge) {
275 if (fromPos <= toPos) {
276 return toPos - fromPos;
277 }
else if (std::find(it + 1,
myEdges.end(), toEdge) ==
myEdges.end()) {
282 for (; it !=
end(); ++it) {
283 if ((*it) == toEdge && !isFirstIteration) {
287 const std::vector<MSLane*>& lanes = (*it)->getLanes();
288 distance += lanes[0]->getLength();
289 #ifdef HAVE_INTERNAL_LANES
291 for (std::vector<MSLane*>::const_iterator laneIt = lanes.begin(); laneIt != lanes.end(); ++laneIt) {
292 const MSLinkCont& links = (*laneIt)->getLinkCont();
293 for (MSLinkCont::const_iterator linkIt = links.begin(); linkIt != links.end(); ++linkIt) {
294 if ((*linkIt) == 0 || (*linkIt)->getLane() == 0) {
297 std::string succLaneId = (*(it + 1))->getLanes()[0]->getID();
298 if ((*linkIt)->getLane()->getID().compare(succLaneId) == 0) {
299 distance += (*linkIt)->getLength();
305 isFirstIteration =
false;
320 const std::vector<SUMOVehicleParameter::Stop>&