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 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 LookupTablecreateLookupTable (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< 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 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 71 of file AStarRouter.h.

Member Typedef Documentation

§ LookupTable

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.

§ Operation

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

§ 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 132 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 141 of file AStarRouter.h.

§ ~AStarRouter()

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

Destructor.

Definition at line 151 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 290 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 153 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 184 of file AStarRouter.h.

§ createLookupTable()

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

§ setBulkMode()

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

Definition at line 101 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

§ myOperation


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