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

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

#include <AStarRouter.h>

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

Data Structures

class  EdgeInfoComparator
 

Public Types

typedef FullLookupTable< E, V > FLT
 
typedef LandmarkLookupTable< E, V > LMLT
 
typedef AbstractLookupTable< E, V > LookupTable
 

Public Member Functions

 AStarRouter (const std::vector< E *> &edges, bool unbuildIsWarning, typename BASE::Operation operation, const std::shared_ptr< const LookupTable > lookup=0)
 Constructor. More...
 
 AStarRouter (const std::vector< typename BASE::EdgeInfo > &edgeInfos, bool unbuildIsWarning, typename BASE::Operation operation, const std::shared_ptr< const LookupTable > lookup=0)
 
void buildPathFrom (const typename BASE::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 init ()
 
virtual ~AStarRouter ()
 Destructor. More...
 

Protected Attributes

EdgeInfoComparator myComparator
 
std::vector< typename BASE::EdgeInfo > myEdgeInfos
 The container of edge information. More...
 
MsgHandler *const myErrorMsgHandler
 the handler for routing errors More...
 
std::vector< typename BASE::EdgeInfo * > myFound
 list of visited Edges (for resetting) More...
 
std::vector< typename BASE::EdgeInfo * > myFrontierList
 A container for reusage of the min edge heap. More...
 
const std::shared_ptr< const LookupTablemyLookupTable
 the lookup table for travel time heuristics More...
 
double myMaxSpeed
 maximum speed in the network More...
 

Detailed Description

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

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)
BASEThe base class to use (SUMOAbstractRouterPermissions/SUMOAbstractRouter)

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 78 of file AStarRouter.h.

Member Typedef Documentation

◆ FLT

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

Definition at line 81 of file AStarRouter.h.

◆ LMLT

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

Definition at line 82 of file AStarRouter.h.

◆ LookupTable

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

Definition at line 80 of file AStarRouter.h.

Constructor & Destructor Documentation

◆ AStarRouter() [1/2]

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

Constructor.

Definition at line 100 of file AStarRouter.h.

◆ AStarRouter() [2/2]

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

Definition at line 111 of file AStarRouter.h.

◆ ~AStarRouter()

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

Destructor.

Definition at line 123 of file AStarRouter.h.

Member Function Documentation

◆ buildPathFrom()

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

Builds the path from marked edges.

Definition at line 293 of file AStarRouter.h.

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

◆ clone()

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

Definition at line 125 of file AStarRouter.h.

◆ compute()

template<class E, class V, class BASE>
virtual bool AStarRouter< E, V, BASE >::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.

Definition at line 143 of file AStarRouter.h.

◆ init()

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

Field Documentation

◆ myComparator

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

◆ myEdgeInfos

◆ myErrorMsgHandler

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

◆ myFound

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

◆ myFrontierList

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

◆ myLookupTable

template<class E, class V, class BASE>
const std::shared_ptr<const LookupTable> AStarRouter< E, V, BASE >::myLookupTable
protected

◆ myMaxSpeed

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

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