SUMO - Simulation of Urban MObility
|
Computes the shortest path through a network using the dijkstra algorithm. More...
#include <TraCIDijkstraRouter.h>
Data Structures | |
struct | EdgeInfo |
class | EdgeInfoByEffortComperator |
class | EdgeInfoCont |
Public Member Functions | |
void | buildPathFrom (EdgeInfo *rbegin, std::vector< const E * > &edges) |
Builds the path from marked edges. | |
virtual void | compute (const E *from, const E *to, const MSVehicle *const vehicle, SUMOTime msTime, std::vector< const E * > &into) |
Builds the route between the given edges using the minimum effort at the given time The definition of the effort depends on the wished routing scheme. | |
void | endQuery (int visits) |
virtual SUMOReal | getEffort (const E *const e, SUMOReal t) const |
virtual void | prepare (const E *, const MSVehicle *, bool) |
SUMOReal | recomputeCosts (const std::vector< const E * > &edges, const MSVehicle *const v, SUMOTime msTime) const |
void | startQuery () |
TraCIDijkstraRouter (size_t noE) | |
Constructor. | |
virtual | ~TraCIDijkstraRouter () |
Destructor. | |
Protected Member Functions | |
void | clearTemporaryStorages (std::vector< bool > *edgeList, EdgeInfoCont *consecutionList) |
Saves the temporary storages for further usage. | |
Protected Attributes | |
size_t | myNoE |
The network to use. | |
InstancePool< EdgeInfoCont > | myReusableEdgeInfoLists |
A container for reusage of edge consecution lists. | |
InstancePool< std::vector< bool > > | myReusableEdgeLists |
A container for reusage of examined edges lists. |
Computes the shortest path through a network using the dijkstra algorithm.
The template parameters are:
E | The edge class to use (MSEdge/ROEdge) |
This router is basically the same as the SUMODijkstraRouter, except for the following: If start and destination edge are the same, the computed route does not consist of just the starting edge. Instead, if there is a path from the starting edge through the network back to itself, the route will consist of this path, containing the same edge both at the beginning and at the end. Furthermore, no vehicle is regarded to determine the efforts of the edges, therefore no prohibition function is used.
Definition at line 62 of file TraCIDijkstraRouter.h.
TraCIDijkstraRouter< E >::TraCIDijkstraRouter | ( | size_t | noE | ) | [inline] |
Constructor.
Definition at line 65 of file TraCIDijkstraRouter.h.
virtual TraCIDijkstraRouter< E >::~TraCIDijkstraRouter | ( | ) | [inline, virtual] |
Destructor.
Definition at line 70 of file TraCIDijkstraRouter.h.
void TraCIDijkstraRouter< E >::buildPathFrom | ( | EdgeInfo * | rbegin, |
std::vector< const E * > & | edges | ||
) | [inline] |
Builds the path from marked edges.
Definition at line 218 of file TraCIDijkstraRouter.h.
References TraCIDijkstraRouter< E >::EdgeInfo::edge, and TraCIDijkstraRouter< E >::EdgeInfo::prev.
Referenced by TraCIDijkstraRouter< E >::compute().
void TraCIDijkstraRouter< E >::clearTemporaryStorages | ( | std::vector< bool > * | edgeList, |
EdgeInfoCont * | consecutionList | ||
) | [inline, protected] |
Saves the temporary storages for further usage.
Definition at line 292 of file TraCIDijkstraRouter.h.
References InstancePool< T >::addFreeInstance(), TraCIDijkstraRouter< E >::myReusableEdgeInfoLists, and TraCIDijkstraRouter< E >::myReusableEdgeLists.
Referenced by TraCIDijkstraRouter< E >::compute().
virtual void TraCIDijkstraRouter< E >::compute | ( | const E * | from, |
const E * | to, | ||
const MSVehicle *const | vehicle, | ||
SUMOTime | msTime, | ||
std::vector< const E * > & | into | ||
) | [inline, virtual] |
Builds the route between the given edges using the minimum effort at the given time The definition of the effort depends on the wished routing scheme.
Implements SUMOAbstractRouter< E, MSVehicle >.
Definition at line 136 of file TraCIDijkstraRouter.h.
References TraCIDijkstraRouter< E >::EdgeInfoCont::add(), TraCIDijkstraRouter< E >::buildPathFrom(), TraCIDijkstraRouter< E >::clearTemporaryStorages(), TraCIDijkstraRouter< E >::EdgeInfo::edge, TraCIDijkstraRouter< E >::EdgeInfo::effort, TraCIDijkstraRouter< E >::getEffort(), TraCIDijkstraRouter< E >::EdgeInfoCont::getEffort(), InstancePool< T >::getFreeInstance(), TraCIDijkstraRouter< E >::myNoE, TraCIDijkstraRouter< E >::myReusableEdgeInfoLists, TraCIDijkstraRouter< E >::myReusableEdgeLists, TraCIDijkstraRouter< E >::EdgeInfoCont::reset(), STEPS2TIME, SUMOReal, and UNUSED_PARAMETER.
Referenced by TraCIServerAPI_Simulation::commandDistanceRequest().
void SUMOAbstractRouter< E, MSVehicle >::endQuery | ( | int | visits | ) | [inline, inherited] |
Definition at line 89 of file SUMOAbstractRouter.h.
References SysUtils::getCurrentMillis(), SUMOAbstractRouter< E, V >::myQueryStartTime, SUMOAbstractRouter< E, V >::myQueryTimeSum, and SUMOAbstractRouter< E, V >::myQueryVisits.
virtual SUMOReal TraCIDijkstraRouter< E >::getEffort | ( | const E *const | e, |
SUMOReal | t | ||
) | const [inline, virtual] |
Definition at line 124 of file TraCIDijkstraRouter.h.
References MSNet::getInstance(), MSLane::getLength(), MSLane::getMaxSpeed(), and SUMOReal.
Referenced by TraCIDijkstraRouter< E >::compute(), and TraCIDijkstraRouter< E >::recomputeCosts().
virtual void SUMOAbstractRouter< E, MSVehicle >::prepare | ( | const E * | , |
const MSVehicle * | , | ||
bool | |||
) | [inline, virtual, inherited] |
Definition at line 80 of file SUMOAbstractRouter.h.
SUMOReal TraCIDijkstraRouter< E >::recomputeCosts | ( | const std::vector< const E * > & | edges, |
const MSVehicle *const | v, | ||
SUMOTime | msTime | ||
) | const [inline, virtual] |
Implements SUMOAbstractRouter< E, MSVehicle >.
Definition at line 206 of file TraCIDijkstraRouter.h.
References TraCIDijkstraRouter< E >::getEffort(), STEPS2TIME, SUMOReal, and UNUSED_PARAMETER.
void SUMOAbstractRouter< E, MSVehicle >::startQuery | ( | ) | [inline, inherited] |
Definition at line 84 of file SUMOAbstractRouter.h.
References SysUtils::getCurrentMillis(), SUMOAbstractRouter< E, V >::myNumQueries, and SUMOAbstractRouter< E, V >::myQueryStartTime.
size_t TraCIDijkstraRouter< E >::myNoE [protected] |
The network to use.
Definition at line 301 of file TraCIDijkstraRouter.h.
Referenced by TraCIDijkstraRouter< E >::compute().
InstancePool<EdgeInfoCont> TraCIDijkstraRouter< E >::myReusableEdgeInfoLists [protected] |
A container for reusage of edge consecution lists.
Definition at line 307 of file TraCIDijkstraRouter.h.
Referenced by TraCIDijkstraRouter< E >::clearTemporaryStorages(), and TraCIDijkstraRouter< E >::compute().
InstancePool<std::vector<bool> > TraCIDijkstraRouter< E >::myReusableEdgeLists [protected] |
A container for reusage of examined edges lists.
Definition at line 304 of file TraCIDijkstraRouter.h.
Referenced by TraCIDijkstraRouter< E >::clearTemporaryStorages(), and TraCIDijkstraRouter< E >::compute().