SUMO - Simulation of Urban MObility
AStarRouter< E, V, PF > Class Template Reference

Computes the shortest path through a network using the A* algorithm. More...

#include <AStarRouter.h>

Inheritance diagram for AStarRouter< E, V, PF >:
Inheritance graph
Collaboration diagram for AStarRouter< E, V, PF >:
Collaboration graph

Data Structures

struct  EdgeInfo
 
class  EdgeInfoComparator
 

Public Types

typedef FullLookupTable< E, V > FLT
 
typedef LandmarkLookupTable< E, V > LMLT
 
typedef AbstractLookupTable< E, V > LookupTable
 
typedef double(* Operation) (const E *const, const V *const, double)
 

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)
 
double getEffort (const E *const e, const V *const v, double t) const
 
void init ()
 
double 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...
 

Protected Attributes

bool myBulkMode
 whether we are currently operating several route queries in a bulk More...
 
EdgeInfoComparator myComparator
 
std::vector< EdgeInfomyEdgeInfos
 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...
 
double myMaxSpeed
 maximum speed in the network More...
 
Operation myOperation
 The object's operation to perform. More...
 

Detailed Description

template<class E, class V, class PF>
class AStarRouter< E, V, PF >

Computes the shortest path through a network using the A* algorithm.

The template parameters are:

Parameters
EThe edge class to use (MSEdge/ROEdge)
VThe vehicle class to use (MSVehicle/ROVehicle)
PFThe prohibition function to use (prohibited_withPermissions/noProhibitions)
ECThe 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 84 of file AStarRouter.h.

Member Typedef Documentation

◆ FLT

template<class E, class V, class PF>
typedef FullLookupTable<E, V> AStarRouter< E, V, PF >::FLT

Definition at line 88 of file AStarRouter.h.

◆ LMLT

template<class E, class V, class PF>
typedef LandmarkLookupTable<E, V> AStarRouter< E, V, PF >::LMLT

Definition at line 89 of file AStarRouter.h.

◆ LookupTable

template<class E, class V, class PF>
typedef AbstractLookupTable<E, V> AStarRouter< E, V, PF >::LookupTable

Definition at line 87 of file AStarRouter.h.

◆ Operation

template<class E, class V, class PF>
typedef double(* AStarRouter< E, V, PF >::Operation) (const E *const, const V *const, double)

Definition at line 90 of file AStarRouter.h.

Constructor & Destructor Documentation

◆ AStarRouter() [1/2]

template<class E, class V, class PF>
AStarRouter< E, V, PF >::AStarRouter ( const std::vector< E *> &  edges,
bool  unbuildIsWarning,
Operation  operation,
const LookupTable *const  lookup = 0 
)
inline

Constructor.

Definition at line 149 of file AStarRouter.h.

◆ AStarRouter() [2/2]

template<class E, class V, class PF>
AStarRouter< E, V, PF >::AStarRouter ( const std::vector< EdgeInfo > &  edgeInfos,
bool  unbuildIsWarning,
Operation  operation,
const LookupTable *const  lookup = 0 
)
inline

Definition at line 160 of file AStarRouter.h.

◆ ~AStarRouter()

template<class E, class V, class PF>
virtual AStarRouter< E, V, PF >::~AStarRouter ( )
inlinevirtual

Destructor.

Definition at line 172 of file AStarRouter.h.

Member Function Documentation

◆ buildPathFrom()

template<class E, class V, class PF>
void AStarRouter< E, V, PF >::buildPathFrom ( const EdgeInfo rbegin,
std::vector< const E *> &  edges 
)
inline

Builds the path from marked edges.

Definition at line 343 of file AStarRouter.h.

Referenced by AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute().

◆ clone()

template<class E, class V, class PF>
virtual SUMOAbstractRouter<E, V>* AStarRouter< E, V, PF >::clone ( )
inlinevirtual

Implements SUMOAbstractRouter< E, V >.

Definition at line 174 of file AStarRouter.h.

◆ compute()

template<class E, class V, class PF>
virtual bool AStarRouter< E, V, PF >::compute ( const E *  from,
const E *  to,
const V *const  vehicle,
SUMOTime  msTime,
std::vector< const E *> &  into 
)
inlinevirtual

Builds the route between the given edges using the minimum travel time.

Implements SUMOAbstractRouter< E, V >.

Definition at line 192 of file AStarRouter.h.

◆ endQuery()

◆ getEffort()

◆ init()

template<class E, class V, class PF>
void AStarRouter< E, V, PF >::init ( )
inline

◆ recomputeCosts()

template<class E, class V, class PF>
double AStarRouter< E, V, PF >::recomputeCosts ( const std::vector< const E *> &  edges,
const V *const  v,
SUMOTime  msTime 
) const
inlinevirtual

◆ setBulkMode()

template<class E, class V>
void SUMOAbstractRouter< E, V >::setBulkMode ( const bool  mode)
inlineinherited

Definition at line 100 of file SUMOAbstractRouter.h.

Referenced by ROMAAssignments::incremental().

◆ startQuery()

Field Documentation

◆ myBulkMode

◆ myComparator

template<class E, class V, class PF>
EdgeInfoComparator AStarRouter< E, V, PF >::myComparator
protected

◆ myEdgeInfos

◆ myErrorMsgHandler

template<class E, class V, class PF>
MsgHandler* const AStarRouter< E, V, PF >::myErrorMsgHandler
protected

◆ myFound

template<class E, class V, class PF>
std::vector<EdgeInfo*> AStarRouter< E, V, PF >::myFound
protected

◆ myFrontierList

template<class E, class V, class PF>
std::vector<EdgeInfo*> AStarRouter< E, V, PF >::myFrontierList
protected

◆ myLookupTable

template<class E, class V, class PF>
const LookupTable* const AStarRouter< E, V, PF >::myLookupTable
protected

◆ myMaxSpeed

template<class E, class V, class PF>
double AStarRouter< E, V, PF >::myMaxSpeed
protected

◆ myOperation


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