Eclipse SUMO - Simulation of Urban MObility
|
A container for DFROUTER-routes. More...
#include <RODFRouteCont.h>
Data Structures | |
class | by_distance_sorter |
A class for sorting route descriptions by their length. More... | |
class | route_finder |
A class for finding a same route (one that passes the same edges) More... | |
Public Member Functions | |
void | addRouteDesc (RODFRouteDesc &desc) |
Adds a route to the container. | |
std::vector< RODFRouteDesc > & | get () |
Returns the container of stored routes. | |
void | removeIllegal (const std::vector< ROEdgeVector > &illegals) |
Removes "illegal" routes. | |
bool | removeRouteDesc (RODFRouteDesc &desc) |
Removes the given route description from the container. | |
RODFRouteCont () | |
Constructor. | |
bool | save (std::vector< std::string > &saved, const std::string &prependix, OutputDevice &out) |
Saves routes. | |
void | sortByDistance () |
Sorts routes by their distance (length) | |
~RODFRouteCont () | |
Destructor. | |
Protected Member Functions | |
void | setID (RODFRouteDesc &desc) const |
Computes and sets the id of a route. | |
Protected Attributes | |
std::map< std::pair< ROEdge *, ROEdge * >, int > | myConnectionOccurrences |
Counts how many routes connecting the key-edges were already stored. | |
std::vector< RODFRouteDesc > | myRoutes |
Stored route descriptions. | |
A container for DFROUTER-routes.
The route id is (re)set as soon as the route is added.
As sometimes several routes can be used between two edges and have to be identified, the number of routes connecting them is stored for each edge pair "myConnectionOccurrences" and the route is named using this information,
Definition at line 53 of file RODFRouteCont.h.
RODFRouteCont::RODFRouteCont | ( | ) |
Constructor.
Definition at line 37 of file RODFRouteCont.cpp.
RODFRouteCont::~RODFRouteCont | ( | ) |
Destructor.
Definition at line 40 of file RODFRouteCont.cpp.
void RODFRouteCont::addRouteDesc | ( | RODFRouteDesc & | desc | ) |
Adds a route to the container.
If the same route is already known, its "overallProb" is increased by the value stored in the given route.
An id for the route is generated if it is unset, yet. The id is computed and set via "setID".
[in] | desc | The route description to add |
Definition at line 45 of file RODFRouteCont.cpp.
References myRoutes, RODFRouteDesc::overallProb, and setID().
Referenced by RODFDetector::addRoute(), and RODFNet::computeRoutesFor().
|
inline |
Returns the container of stored routes.
Definition at line 103 of file RODFRouteCont.h.
References myRoutes.
Referenced by RODFDetector::buildDestinationDistribution(), RODFNet::buildRoutes(), RODFDetector::computeSplitProbabilities(), RODFDetector::getRouteVector(), RODFDetector::hasRoutes(), and RODFDetector::writeEmitterDefinition().
void RODFRouteCont::removeIllegal | ( | const std::vector< ROEdgeVector > & | illegals | ) |
Removes "illegal" routes.
"illegal" routes means edge combinations that shall not be passed.
[in] | illegals | List of edge combinations that shall not be passed |
Definition at line 102 of file RODFRouteCont.cpp.
References RODFRouteDesc::edges2Pass, and myRoutes.
bool RODFRouteCont::removeRouteDesc | ( | RODFRouteDesc & | desc | ) |
Removes the given route description from the container.
All routes are regarded as being same if they pass the same edges. This is done via the "route_finder".
[in] | desc | The route description to remove |
Definition at line 59 of file RODFRouteCont.cpp.
References myRoutes.
Referenced by RODFNet::computeRoutesFor().
bool RODFRouteCont::save | ( | std::vector< std::string > & | saved, |
const std::string & | prependix, | ||
OutputDevice & | out | ||
) |
Saves routes.
[in,out] | saved | The list of ids of routes that shall not be saved (were saved before) |
[in] | prependix | The prependix for route names |
[out] | out | The device the routes shall written to |
IOError | not yet implemented |
Definition at line 69 of file RODFRouteCont.cpp.
References OutputDevice::closeTag(), RODFRouteDesc::edges2Pass, myRoutes, OutputDevice::openTag(), RODFRouteDesc::routename, SUMO_ATTR_ID, SUMO_TAG_ROUTE, and OutputDevice::writeAttr().
Referenced by RODFDetector::writeRoutes().
|
protected |
Computes and sets the id of a route.
The id is <FIRST_EDGE>to<LAST_EDGE>_<RUNNING> where <RUNNING> is the number of routes which connect <FIRST_EDGE> and <LAST_EDGE>.
[in] | desc | The route description to add |
Definition at line 127 of file RODFRouteCont.cpp.
References RODFRouteDesc::edges2Pass, myConnectionOccurrences, RODFRouteDesc::routename, and toString().
Referenced by addRouteDesc().
void RODFRouteCont::sortByDistance | ( | ) |
Sorts routes by their distance (length)
Done using by_distance_sorter.
Definition at line 96 of file RODFRouteCont.cpp.
References myRoutes.
Counts how many routes connecting the key-edges were already stored.
Definition at line 173 of file RODFRouteCont.h.
Referenced by setID().
|
protected |
Stored route descriptions.
Definition at line 170 of file RODFRouteCont.h.
Referenced by addRouteDesc(), get(), removeIllegal(), removeRouteDesc(), save(), and sortByDistance().