42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
84 bool haveSavedOneAtLeast =
false;
85 for (std::vector<RODFRouteDesc>::const_iterator j =
myRoutes.begin(); j !=
myRoutes.end(); ++j) {
87 if (find(saved.begin(), saved.end(), desc.
routename) != saved.end()) {
90 saved.push_back((*j).routename);
94 for (std::vector<ROEdge*>::const_iterator k = desc.
edges2Pass.begin(); k != desc.
edges2Pass.end(); k++) {
102 haveSavedOneAtLeast =
true;
104 return haveSavedOneAtLeast;
116 for (std::vector<RODFRouteDesc>::iterator i =
myRoutes.begin(); i !=
myRoutes.end();) {
119 for (std::vector<std::vector<ROEdge*> >::const_iterator j = illegals.begin(); !
remove && j != illegals.end(); ++j) {
121 for (std::vector<ROEdge*>::const_iterator k = (*j).begin(); !
remove && k != (*j).end(); ++k) {
141 std::vector<RODFRouteDesc> newRoutes;
142 for (std::vector<RODFRouteDesc>::iterator i =
myRoutes.begin(); i !=
myRoutes.end(); ++i) {
146 newRoutes.push_back(desc);
153 newRoutes.push_back(ndesc);
163 desc.
routename = c.first->getID() +
"_to_" + c.second->getID();
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
ROEdge * getFollower(unsigned int pos) const
Returns the edge at the given position from the list of reachable edges.
std::vector< RODFRouteDesc > myRoutes
Stored route descriptions.
std::vector< ROEdge * > edges2Pass
The edges the route is made of.
A class for sorting route descriptions by their length.
~RODFRouteCont()
Destructor.
A class for finding a same route (one that passes the same edges)
bool removeRouteDesc(RODFRouteDesc &desc)
Removes the given route description from the container.
void setID(RODFRouteDesc &desc) const
Computes and sets the id of a route.
void sortByDistance()
Sorts routes by their distance (length)
std::map< std::pair< ROEdge *, ROEdge * >, int > myConnectionOccurences
Counts how many routes connecting the key-edges were already stored.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
A route within the DFROUTER.
A basic edge for routing applications.
RODFRouteCont()
Constructor.
void addAllEndFollower()
All routes are replaced by their versions extended by follower edges.
unsigned int getNoFollowing() const
Returns the number of edges this edge is connected to.
std::string routename
The name of the route.
void removeIllegal(const std::vector< std::vector< ROEdge * > > &illegals)
Removes "illegal" routes.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
void addRouteDesc(RODFRouteDesc &desc)
Adds a route to the container.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool save(std::vector< std::string > &saved, const std::string &prependix, OutputDevice &out)
Saves routes.