Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
SUMOAbstractRouter< E, V > Class Template Referenceabstract

#include <SUMOAbstractRouter.h>

Inheritance diagram for SUMOAbstractRouter< E, V >:
[legend]
Collaboration diagram for SUMOAbstractRouter< E, V >:
[legend]

Data Structures

class  EdgeInfo

Public Types

typedef double(* Operation) (const E *const, const V *const, double)
 Type of the function that is used to retrieve the edge effort.
typedef std::map< const E *, double > Prohibitions
 Prohibitions and their estimated end time.

Public Member Functions

void buildPathFrom (const typename SUMOAbstractRouter< E, V >::EdgeInfo *rbegin, std::vector< const E * > &edges)
 Builds the path from marked edges.
virtual SUMOAbstractRouterclone ()=0
virtual bool compute (const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)=0
 Builds the route between the given edges using the minimum effort at the given time The definition of the effort depends on the wished routing scheme.
bool compute (const E *from, double fromPos, const E *to, double toPos, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)
 Builds the route between the given edges using the minimum effort at the given time, also taking into account position along the edges to ensure currect handling of looped routes The definition of the effort depends on the wished routing scheme.
bool computeLooped (const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)
 Builds the route between the given edges using the minimum effort at the given time if from == to, return the shortest looped route.
void endQuery (int visits)
const SUMOAbstractRouter< E, V >::EdgeInfogetEdgeInfo (int index) const
double getEffort (const E *const e, const V *const v, double t) const
double getTravelTime (const E *const e, const V *const v, const double t, const double effort) const
const std::string & getType () const
void init (const int edgeID, const SUMOTime msTime)
bool isProhibited (const E *const edge, const V *const vehicle) const
bool isValid (const std::vector< const E * > &edges, const V *const v) const
virtual void prohibit (const Prohibitions &toProhibit)
virtual double recomputeCosts (const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
double recomputeCostsPos (const std::vector< const E * > &edges, const V *const v, double fromPos, double toPos, SUMOTime msTime, double *lengthp=nullptr) const
virtual void reset (const V *const vehicle)
 reset internal caches, used by CHRouter
void setAutoBulkMode (const bool mode)
virtual void setBulkMode (const bool mode)
double setHint (const typename std::vector< const E * >::const_iterator routeBegin, const typename std::vector< const E * >::const_iterator routeEnd, const V *const v, SUMOTime msTime)
void startQuery ()
 SUMOAbstractRouter (const std::string &type, bool unbuildIsWarning, Operation operation, Operation ttOperation, const bool havePermissions, const bool haveRestrictions)
 Constructor.
 SUMOAbstractRouter (SUMOAbstractRouter *other)
 Copy Constructor.
void updateViaCost (const E *const prev, const E *const e, const V *const v, double &time, double &effort, double &length) const
void updateViaEdgeCost (const E *viaEdge, const V *const v, double &time, double &effort, double &length) const
virtual ~SUMOAbstractRouter ()
 Destructor.

Protected Attributes

bool myAmClean
 whether we are already initialized
bool myAutoBulkMode
 whether we are currently trying to detect bulk mode automatically
bool myBulkMode
 whether we are currently operating several route queries in a bulk
std::vector< typename SUMOAbstractRouter< E, V >::EdgeInfomyEdgeInfos
 The container of edge information.
MsgHandler *const myErrorMsgHandler
 the handler for routing errors
std::vector< typename SUMOAbstractRouter< E, V >::EdgeInfo * > myFound
 list of visited Edges (for resetting)
std::vector< typename SUMOAbstractRouter< E, V >::EdgeInfo * > myFrontierList
 A container for reusage of the min edge heap.
const bool myHavePermissions
 whether edge permissions need to be considered
const bool myHaveRestrictions
 whether edge restrictions need to be considered
Operation myOperation
 The object's operation to perform.
Prohibitions myProhibited
 The list of explicitly prohibited edges and estimated end time of prohibition.
Operation myTTOperation
 The object's operation to perform for travel times.

Private Member Functions

SUMOAbstractRouteroperator= (const SUMOAbstractRouter &s)=delete
 Invalidated assignment operator.

Private Attributes

long long int myNumQueries
long long int myQueryStartTime
 the time spent querying in milliseconds
long long int myQueryTimeSum
long long int myQueryVisits
 counters for performance logging
const std::string myType
 the type of this router

Detailed Description

template<class E, class V>
class SUMOAbstractRouter< E, V >

The interface for routing the vehicles over the network.

Definition at line 46 of file SUMOAbstractRouter.h.

Member Typedef Documentation

◆ Operation

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

Type of the function that is used to retrieve the edge effort.

Definition at line 95 of file SUMOAbstractRouter.h.

◆ Prohibitions

template<class E, class V>
typedef std::map<const E*, double> SUMOAbstractRouter< E, V >::Prohibitions

Prohibitions and their estimated end time.

Definition at line 98 of file SUMOAbstractRouter.h.

Constructor & Destructor Documentation

◆ SUMOAbstractRouter() [1/2]

◆ SUMOAbstractRouter() [2/2]

template<class E, class V>
SUMOAbstractRouter< E, V >::SUMOAbstractRouter ( SUMOAbstractRouter< E, V > * other)
inline

Copy Constructor.

Definition at line 118 of file SUMOAbstractRouter.h.

◆ ~SUMOAbstractRouter()

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

Destructor.

Definition at line 135 of file SUMOAbstractRouter.h.

Member Function Documentation

◆ buildPathFrom()

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

Builds the path from marked edges.

Definition at line 382 of file SUMOAbstractRouter.h.

Referenced by AFRouter< E, N, V, M >::compute(), AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), and Node2EdgeRouter< E, N, V, M >::computeNode2Edge().

Here is the caller graph for this function:

◆ clone()

◆ compute() [1/2]

template<class E, class V>
virtual bool SUMOAbstractRouter< E, V >::compute ( const E * from,
const E * to,
const V *const vehicle,
SUMOTime msTime,
std::vector< const E * > & into,
bool silent = false )
pure virtual

◆ compute() [2/2]

template<class E, class V>
bool SUMOAbstractRouter< E, V >::compute ( const E * from,
double fromPos,
const E * to,
double toPos,
const V *const vehicle,
SUMOTime msTime,
std::vector< const E * > & into,
bool silent = false )
inline

Builds the route between the given edges using the minimum effort at the given time, also taking into account position along the edges to ensure currect handling of looped routes The definition of the effort depends on the wished routing scheme.

Definition at line 191 of file SUMOAbstractRouter.h.

◆ computeLooped()

template<class E, class V>
bool SUMOAbstractRouter< E, V >::computeLooped ( const E * from,
const E * to,
const V *const vehicle,
SUMOTime msTime,
std::vector< const E * > & into,
bool silent = false )
inline

Builds the route between the given edges using the minimum effort at the given time if from == to, return the shortest looped route.

Definition at line 206 of file SUMOAbstractRouter.h.

Referenced by SUMOAbstractRouter< MSEdge, SUMOVehicle >::compute(), MSBaseVehicle::optimizeSkipped(), MSBaseVehicle::reroute(), and MSBaseVehicle::routeAlongStops().

Here is the caller graph for this function:

◆ endQuery()

template<class E, class V>
void SUMOAbstractRouter< E, V >::endQuery ( int visits)
inline

◆ getEdgeInfo()

template<class E, class V>
const SUMOAbstractRouter< E, V >::EdgeInfo & SUMOAbstractRouter< E, V >::getEdgeInfo ( int index) const
inline

Definition at line 177 of file SUMOAbstractRouter.h.

◆ getEffort()

◆ getTravelTime()

template<class E, class V>
double SUMOAbstractRouter< E, V >::getTravelTime ( const E *const e,
const V *const v,
const double t,
const double effort ) const
inline

◆ getType()

template<class E, class V>
const std::string & SUMOAbstractRouter< E, V >::getType ( ) const
inline

Definition at line 173 of file SUMOAbstractRouter.h.

◆ init()

template<class E, class V>
void SUMOAbstractRouter< E, V >::init ( const int edgeID,
const SUMOTime msTime )
inline

Definition at line 144 of file SUMOAbstractRouter.h.

Referenced by AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::setHint().

Here is the caller graph for this function:

◆ isProhibited()

template<class E, class V>
bool SUMOAbstractRouter< E, V >::isProhibited ( const E *const edge,
const V *const vehicle ) const
inline

Definition at line 235 of file SUMOAbstractRouter.h.

Referenced by SUMOAbstractRouter< MSEdge, SUMOVehicle >::isValid(), Node2EdgeRouter< E, N, V, M >::recomputeCostsNoLastEdge(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::setHint().

Here is the caller graph for this function:

◆ isValid()

template<class E, class V>
bool SUMOAbstractRouter< E, V >::isValid ( const std::vector< const E * > & edges,
const V *const v ) const
inline

Definition at line 268 of file SUMOAbstractRouter.h.

Referenced by RORouteDef::addAlternative().

Here is the caller graph for this function:

◆ operator=()

template<class E, class V>
SUMOAbstractRouter & SUMOAbstractRouter< E, V >::operator= ( const SUMOAbstractRouter< E, V > & s)
privatedelete

Invalidated assignment operator.

◆ prohibit()

template<class E, class V>
virtual void SUMOAbstractRouter< E, V >::prohibit ( const Prohibitions & toProhibit)
inlinevirtual

◆ recomputeCosts()

◆ recomputeCostsPos()

template<class E, class V>
double SUMOAbstractRouter< E, V >::recomputeCostsPos ( const std::vector< const E * > & edges,
const V *const v,
double fromPos,
double toPos,
SUMOTime msTime,
double * lengthp = nullptr ) const
inline

Definition at line 295 of file SUMOAbstractRouter.h.

Referenced by MSDispatch::computeDetourTime(), MSBaseVehicle::optimizeSkipped(), MSBaseVehicle::reroute(), and MSBaseVehicle::routeAlongStops().

Here is the caller graph for this function:

◆ reset()

template<class E, class V>
virtual void SUMOAbstractRouter< E, V >::reset ( const V *const vehicle)
inlinevirtual

reset internal caches, used by CHRouter

Reimplemented in AFRouter< E, N, V, M >, CHRouter< E, V >, Node2EdgeRouter< E, N, V, M >, and Node2EdgeRouter< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V, M >.

Definition at line 169 of file SUMOAbstractRouter.h.

Referenced by computeRoutes().

Here is the caller graph for this function:

◆ setAutoBulkMode()

template<class E, class V>
void SUMOAbstractRouter< E, V >::setAutoBulkMode ( const bool mode)
inline

Definition at line 361 of file SUMOAbstractRouter.h.

Referenced by LandmarkLookupTable< E, V, M >::LandmarkLookupTable().

Here is the caller graph for this function:

◆ setBulkMode()

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

◆ setHint()

template<class E, class V>
double SUMOAbstractRouter< E, V >::setHint ( const typename std::vector< const E * >::const_iterator routeBegin,
const typename std::vector< const E * >::const_iterator routeEnd,
const V *const v,
SUMOTime msTime )
inline

Definition at line 307 of file SUMOAbstractRouter.h.

◆ startQuery()

template<class E, class V>
void SUMOAbstractRouter< E, V >::startQuery ( )
inline

◆ updateViaCost()

template<class E, class V>
void SUMOAbstractRouter< E, V >::updateViaCost ( const E *const prev,
const E *const e,
const V *const v,
double & time,
double & effort,
double & length ) const
inline

Definition at line 253 of file SUMOAbstractRouter.h.

Referenced by RailwayRouter< E, V >::recomputeCosts(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::recomputeCosts(), Node2EdgeRouter< E, N, V, M >::recomputeCostsNoLastEdge(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::setHint().

Here is the caller graph for this function:

◆ updateViaEdgeCost()

template<class E, class V>
void SUMOAbstractRouter< E, V >::updateViaEdgeCost ( const E * viaEdge,
const V *const v,
double & time,
double & effort,
double & length ) const
inline

Field Documentation

◆ myAmClean

template<class E, class V>
bool SUMOAbstractRouter< E, V >::myAmClean
protected

◆ myAutoBulkMode

template<class E, class V>
bool SUMOAbstractRouter< E, V >::myAutoBulkMode
protected

whether we are currently trying to detect bulk mode automatically

Definition at line 405 of file SUMOAbstractRouter.h.

◆ myBulkMode

template<class E, class V>
bool SUMOAbstractRouter< E, V >::myBulkMode
protected

whether we are currently operating several route queries in a bulk

Definition at line 402 of file SUMOAbstractRouter.h.

◆ myEdgeInfos

◆ myErrorMsgHandler

◆ myFound

◆ myFrontierList

◆ myHavePermissions

template<class E, class V>
const bool SUMOAbstractRouter< E, V >::myHavePermissions
protected

◆ myHaveRestrictions

template<class E, class V>
const bool SUMOAbstractRouter< E, V >::myHaveRestrictions
protected

◆ myNumQueries

template<class E, class V>
long long int SUMOAbstractRouter< E, V >::myNumQueries
private

Definition at line 433 of file SUMOAbstractRouter.h.

◆ myOperation

◆ myProhibited

template<class E, class V>
Prohibitions SUMOAbstractRouter< E, V >::myProhibited
protected

The list of explicitly prohibited edges and estimated end time of prohibition.

Definition at line 417 of file SUMOAbstractRouter.h.

Referenced by RailwayRouter< E, V >::_compute(), and RailwayRouter< E, V >::prohibit().

◆ myQueryStartTime

template<class E, class V>
long long int SUMOAbstractRouter< E, V >::myQueryStartTime
private

the time spent querying in milliseconds

Definition at line 435 of file SUMOAbstractRouter.h.

◆ myQueryTimeSum

template<class E, class V>
long long int SUMOAbstractRouter< E, V >::myQueryTimeSum
private

Definition at line 436 of file SUMOAbstractRouter.h.

◆ myQueryVisits

template<class E, class V>
long long int SUMOAbstractRouter< E, V >::myQueryVisits
private

counters for performance logging

Definition at line 432 of file SUMOAbstractRouter.h.

◆ myTTOperation

template<class E, class V>
Operation SUMOAbstractRouter< E, V >::myTTOperation
protected

The object's operation to perform for travel times.

Definition at line 399 of file SUMOAbstractRouter.h.

◆ myType

template<class E, class V>
const std::string SUMOAbstractRouter< E, V >::myType
private

the type of this router

Definition at line 429 of file SUMOAbstractRouter.h.


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