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

Computes the shortest path through a network using the Dijkstra algorithm. More...

#include <AStarRouter.h>

Inheritance diagram for AStarRouter< E, V, PF >:
SUMOAbstractRouter< E, V > PF

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 (size_t noE, bool unbuildIsWarning, Operation operation, const LookupTable *const lookup=0)
 Constructor. More...
 
void buildPathFrom (EdgeInfo *rbegin, std::vector< const E * > &edges)
 Builds the path from marked edges. More...
 
virtual SUMOAbstractRouter< E, V > * clone () const
 
virtual void 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 ()
 
virtual void prepare (const E *, const V *, bool)
 
SUMOReal recomputeCosts (const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const
 
void startQuery ()
 
virtual ~AStarRouter ()
 Destructor. More...
 

Static Public Member Functions

static LookupTablecreateLookupTable (const std::string &filename, const int size)
 

Protected Attributes

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...
 
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 Dijkstra 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_withRestrictions/prohibited_noRestrictions)
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 71 of file AStarRouter.h.

Member Typedef Documentation

template<class E, class V, class PF>
typedef std::vector<std::vector<SUMOReal> > AStarRouter< E, V, PF >::LookupTable

Definition at line 75 of file AStarRouter.h.

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

Definition at line 74 of file AStarRouter.h.

Constructor & Destructor Documentation

template<class E, class V, class PF>
AStarRouter< E, V, PF >::AStarRouter ( size_t  noE,
bool  unbuildIsWarning,
Operation  operation,
const LookupTable *const  lookup = 0 
)
inline

Constructor.

Definition at line 77 of file AStarRouter.h.

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

Destructor.

Definition at line 87 of file AStarRouter.h.

Member Function Documentation

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

Builds the path from marked edges.

Definition at line 263 of file AStarRouter.h.

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

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

Implements SUMOAbstractRouter< E, V >.

Definition at line 89 of file AStarRouter.h.

template<class E, class V, class PF>
virtual void 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 174 of file AStarRouter.h.

template<class E, class V, class PF>
static LookupTable* AStarRouter< E, V, PF >::createLookupTable ( const std::string &  filename,
const int  size 
)
inlinestatic

Definition at line 93 of file AStarRouter.h.

template<class E, class V, class PF>
void AStarRouter< E, V, PF >::init ( )
inline
template<class E, class V>
virtual void SUMOAbstractRouter< E, V >::prepare ( const E *  ,
const V *  ,
bool   
)
inlinevirtualinherited

Reimplemented in BulkStarRouter< E, V, PF >.

Definition at line 87 of file SUMOAbstractRouter.h.

Referenced by RORouteAggregator::processAllRoutes().

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

Implements SUMOAbstractRouter< E, V >.

Definition at line 249 of file AStarRouter.h.

Field Documentation

template<class E, class V, class PF>
EdgeInfoComparator AStarRouter< E, V, PF >::myComparator
protected
template<class E, class V, class PF>
MsgHandler* const AStarRouter< E, V, PF >::myErrorMsgHandler
protected
template<class E, class V, class PF>
std::vector<EdgeInfo*> AStarRouter< E, V, PF >::myFound
protected
template<class E, class V, class PF>
std::vector<EdgeInfo*> AStarRouter< E, V, PF >::myFrontierList
protected
template<class E, class V, class PF>
const LookupTable* const AStarRouter< E, V, PF >::myLookupTable
protected

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