SUMO - Simulation of Urban MObility
|
Computes the shortest path through a network using the A* algorithm. More...
#include <AStarRouter.h>
Data Structures | |
struct | EdgeInfo |
class | EdgeInfoComparator |
Public Types | |
typedef std::vector < std::vector< SUMOReal > > | LookupTable |
typedef SUMOReal(* | Operation )(const E *const, const V *const, SUMOReal) |
Public Member Functions | |
AStarRouter (const std::vector< E * > &edges, bool unbuildIsWarning, Operation operation, const LookupTable *const lookup=0) | |
Constructor. More... | |
AStarRouter (const std::vector< EdgeInfo > &edgeInfos, bool unbuildIsWarning, Operation operation, const LookupTable *const lookup=0) | |
void | buildPathFrom (const EdgeInfo *rbegin, std::vector< const E * > &edges) |
Builds the path from marked edges. More... | |
virtual SUMOAbstractRouter< E, V > * | clone () |
virtual bool | compute (const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into) |
Builds the route between the given edges using the minimum travel time. More... | |
void | endQuery (int visits) |
SUMOReal | getEffort (const E *const e, const V *const v, SUMOReal t) const |
void | init () |
SUMOReal | recomputeCosts (const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const |
void | setBulkMode (const bool mode) |
void | startQuery () |
virtual | ~AStarRouter () |
Destructor. More... | |
Static Public Member Functions | |
static LookupTable * | createLookupTable (const std::string &filename, const int size) |
Protected Attributes | |
bool | myBulkMode |
whether we are currently operating several route queries in a bulk More... | |
EdgeInfoComparator | myComparator |
std::vector< EdgeInfo > | myEdgeInfos |
The container of edge information. More... | |
MsgHandler *const | myErrorMsgHandler |
the handler for routing errors More... | |
std::vector< EdgeInfo * > | myFound |
list of visited Edges (for resetting) More... | |
std::vector< EdgeInfo * > | myFrontierList |
A container for reusage of the min edge heap. More... | |
const LookupTable *const | myLookupTable |
the lookup table for travel time heuristics More... | |
Operation | myOperation |
The object's operation to perform. More... | |
Computes the shortest path through a network using the A* algorithm.
The template parameters are:
E | The edge class to use (MSEdge/ROEdge) |
V | The vehicle class to use (MSVehicle/ROVehicle) |
PF | The prohibition function to use (prohibited_withPermissions/noProhibitions) |
EC | The class to retrieve the effort for an edge from |
The router is edge-based. It must know the number of edges for internal reasons and whether a missing connection between two given edges (unbuild route) shall be reported as an error or as a warning.
Definition at line 71 of file AStarRouter.h.
typedef std::vector<std::vector<SUMOReal> > AStarRouter< E, V, PF >::LookupTable |
Definition at line 75 of file AStarRouter.h.
typedef SUMOReal(* AStarRouter< E, V, PF >::Operation)(const E *const, const V *const, SUMOReal) |
Definition at line 74 of file AStarRouter.h.
|
inline |
Constructor.
Definition at line 132 of file AStarRouter.h.
|
inline |
Definition at line 141 of file AStarRouter.h.
|
inlinevirtual |
Destructor.
Definition at line 151 of file AStarRouter.h.
|
inline |
Builds the path from marked edges.
Definition at line 290 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute().
|
inlinevirtual |
Implements SUMOAbstractRouter< E, V >.
Definition at line 153 of file AStarRouter.h.
|
inlinevirtual |
Builds the route between the given edges using the minimum travel time.
Implements SUMOAbstractRouter< E, V >.
Definition at line 184 of file AStarRouter.h.
|
inlinestatic |
Definition at line 157 of file AStarRouter.h.
|
inlineinherited |
Definition at line 96 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), and CHRouter< E, V, PF >::compute().
|
inlineinherited |
Definition at line 87 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), CHRouterWrapper< E, V, PF >::recomputeCosts(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::recomputeCosts(), DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::recomputeCosts(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::recomputeCosts(), CHRouter< E, V, PF >::recomputeCosts(), and CHRouter< E, V, PF >::synchronize().
|
inline |
Definition at line 170 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute().
|
inlinevirtual |
Implements SUMOAbstractRouter< E, V >.
Definition at line 276 of file AStarRouter.h.
|
inlineinherited |
Definition at line 101 of file SUMOAbstractRouter.h.
Referenced by ROMAAssignments::incremental().
|
inlineinherited |
Definition at line 91 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), and CHRouter< E, V, PF >::compute().
|
protectedinherited |
whether we are currently operating several route queries in a bulk
Definition at line 110 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), and SUMOAbstractRouter< E, IntermodalTrip< E, N, V > >::setBulkMode().
|
protected |
Definition at line 308 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute().
|
protected |
The container of edge information.
Definition at line 301 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::AStarRouter(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::clone(), and AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute().
|
protected |
the handler for routing errors
Definition at line 311 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::clone(), and AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute().
|
protected |
list of visited Edges (for resetting)
Definition at line 306 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), and AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::init().
|
protected |
A container for reusage of the min edge heap.
Definition at line 304 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), and AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::init().
|
protected |
the lookup table for travel time heuristics
Definition at line 314 of file AStarRouter.h.
Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::clone(), and AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute().
|
protectedinherited |
The object's operation to perform.
Definition at line 107 of file SUMOAbstractRouter.h.
Referenced by CHRouterWrapper< E, V, PF >::clone(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::clone(), DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::clone(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::clone(), CHRouter< E, V, PF >::clone(), and SUMOAbstractRouter< E, IntermodalTrip< E, N, V > >::getEffort().