Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
RODFRouteCont Class Reference

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< RODFRouteDescmyRoutes
 Stored route descriptions.
 

Detailed Description

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,

See also
addRouteDesc.
RODFRouteDesc

Definition at line 53 of file RODFRouteCont.h.

Constructor & Destructor Documentation

◆ RODFRouteCont()

RODFRouteCont::RODFRouteCont ( )

Constructor.

Definition at line 37 of file RODFRouteCont.cpp.

◆ ~RODFRouteCont()

RODFRouteCont::~RODFRouteCont ( )

Destructor.

Definition at line 40 of file RODFRouteCont.cpp.

Member Function Documentation

◆ addRouteDesc()

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".

Parameters
[in]descThe route description to add
See also
setID

Definition at line 45 of file RODFRouteCont.cpp.

References myRoutes, RODFRouteDesc::overallProb, and setID().

Referenced by RODFDetector::addRoute(), and RODFNet::computeRoutesFor().

Here is the caller graph for this function:

◆ get()

std::vector< RODFRouteDesc > & RODFRouteCont::get ( )
inline

Returns the container of stored routes.

Returns
The 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().

Here is the caller graph for this function:

◆ removeIllegal()

void RODFRouteCont::removeIllegal ( const std::vector< ROEdgeVector > &  illegals)

Removes "illegal" routes.

"illegal" routes means edge combinations that shall not be passed.

Parameters
[in]illegalsList of edge combinations that shall not be passed
Todo:
Not used, yet

Definition at line 102 of file RODFRouteCont.cpp.

References RODFRouteDesc::edges2Pass, and myRoutes.

◆ removeRouteDesc()

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".

Parameters
[in]descThe route description to remove
Returns
Whether the route was removed (a similar was found)
See also
RODFRouteCont::route_finder

Definition at line 59 of file RODFRouteCont.cpp.

References myRoutes.

Referenced by RODFNet::computeRoutesFor().

Here is the caller graph for this function:

◆ save()

bool RODFRouteCont::save ( std::vector< std::string > &  saved,
const std::string &  prependix,
OutputDevice out 
)

Saves routes.

Parameters
[in,out]savedThe list of ids of routes that shall not be saved (were saved before)
[in]prependixThe prependix for route names
[out]outThe device the routes shall written to
Returns
Whether at least one route was saved
Exceptions
IOErrornot 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().

Here is the caller graph for this function:

◆ setID()

void RODFRouteCont::setID ( RODFRouteDesc desc) const
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>.

Parameters
[in]descThe route description to add

Definition at line 127 of file RODFRouteCont.cpp.

References RODFRouteDesc::edges2Pass, myConnectionOccurrences, RODFRouteDesc::routename, and toString().

Referenced by addRouteDesc().

Here is the caller graph for this function:

◆ sortByDistance()

void RODFRouteCont::sortByDistance ( )

Sorts routes by their distance (length)

Done using by_distance_sorter.

See also
RODFRouteCont::by_distance_sorter

Definition at line 96 of file RODFRouteCont.cpp.

References myRoutes.

Field Documentation

◆ myConnectionOccurrences

std::map<std::pair<ROEdge*, ROEdge*>, int> RODFRouteCont::myConnectionOccurrences
mutableprotected

Counts how many routes connecting the key-edges were already stored.

Definition at line 173 of file RODFRouteCont.h.

Referenced by setID().

◆ myRoutes

std::vector<RODFRouteDesc> RODFRouteCont::myRoutes
protected

Stored route descriptions.

Definition at line 170 of file RODFRouteCont.h.

Referenced by addRouteDesc(), get(), removeIllegal(), removeRouteDesc(), save(), and sortByDistance().


The documentation for this class was generated from the following files: