Eclipse SUMO - Simulation of Urban MObility
ROJTRRouter Class Referenceabstract

Computes routes using junction turning percentages. More...

#include <ROJTRRouter.h>

Inheritance diagram for ROJTRRouter:
Collaboration diagram for ROJTRRouter:

Public Types

typedef double(* Operation) (const ROEdge *const, const ROVehicle *const, double)
 Type of the function that is used to retrieve the edge effort. More...
 

Public Member Functions

virtual SUMOAbstractRouter< ROEdge, ROVehicle > * clone ()
 
virtual bool compute (const ROEdge *from, const ROEdge *to, const ROVehicle *const vehicle, SUMOTime msTime, std::vector< const ROEdge * > &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. More...
 
bool computeLooped (const ROEdge *from, const ROEdge *to, const ROVehicle *const vehicle, SUMOTime msTime, std::vector< const ROEdge * > &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. More...
 
void endQuery (int visits)
 
double getEffort (const ROEdge *const e, const ROVehicle *const v, double t) const
 
double getTravelTime (const ROEdge *const e, const ROVehicle *const v, const double t, const double effort) const
 
bool isProhibited (const ROEdge *const edge, const ROVehicle *const vehicle) const
 
virtual void prohibit (const std::vector< ROEdge * > &)
 
double recomputeCosts (const std::vector< const ROEdge * > &edges, const ROVehicle *const v, SUMOTime msTime, double *lengthp=nullptr) const
 
 ROJTRRouter (bool unbuildIsWarningOnly, bool acceptAllDestinations, int maxEdges, bool ignoreClasses, bool allowLoops)
 Constructor. More...
 
void setBulkMode (const bool mode)
 
void startQuery ()
 
void updateViaCost (const ROEdge *const prev, const ROEdge *const e, const ROVehicle *const v, double &time, double &effort, double &length) const
 
void updateViaEdgeCost (const ROEdge *viaEdge, const ROVehicle *const v, double &time, double &effort, double &length) const
 
 ~ROJTRRouter ()
 Destructor. More...
 
Implementatios of SUMOAbstractRouter
bool compute (const ROEdge *from, const ROEdge *to, const ROVehicle *const vehicle, SUMOTime time, ConstROEdgeVector &into, bool silent=false)
 Computes a route. More...
 
double recomputeCosts (const ConstROEdgeVector &edges, const ROVehicle *const v, SUMOTime msTime) const
 Recomputes the costs of a route. More...
 

Protected Attributes

bool myBulkMode
 whether we are currently operating several route queries in a bulk More...
 
MsgHandler *const myErrorMsgHandler
 the handler for routing errors More...
 
const bool myHavePermissions
 whether edge permissions need to be considered More...
 
const bool myHaveRestrictions
 whether edge restrictions need to be considered More...
 
Operation myOperation
 The object's operation to perform. More...
 
std::vector< ROEdge * > myProhibited
 
Operation myTTOperation
 The object's operation to perform for travel times. More...
 

Private Attributes

const bool myAcceptAllDestination
 Whether all edges may be used as route end. More...
 
const bool myAllowLoops
 Whether a vehicle may reuse a road. More...
 
const bool myIgnoreClasses
 Whether vehicle class information shall be ignored. More...
 
const int myMaxEdges
 The maximum number of edges a route may have. More...
 
long long int myNumQueries
 
long long int myQueryStartTime
 the time spent querying in milliseconds More...
 
long long int myQueryTimeSum
 
long long int myQueryVisits
 counters for performance logging More...
 
const std::string myType
 the type of this router More...
 
const bool myUnbuildIsWarningOnly
 Whether unbuildable routes shall be reported as warniings, not errors. More...
 

Detailed Description

Computes routes using junction turning percentages.

Definition at line 45 of file ROJTRRouter.h.

Member Typedef Documentation

◆ Operation

typedef double(* SUMOAbstractRouter< ROEdge , ROVehicle >::Operation) (const ROEdge *const, const ROVehicle *const, double)
inherited

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

Definition at line 96 of file SUMOAbstractRouter.h.

Constructor & Destructor Documentation

◆ ROJTRRouter()

ROJTRRouter::ROJTRRouter ( bool  unbuildIsWarningOnly,
bool  acceptAllDestinations,
int  maxEdges,
bool  ignoreClasses,
bool  allowLoops 
)

Constructor.

Parameters
[in]unbuildIsWarningOnlyWhether not closed routes shall not yield in an error
[in]acceptAllDestinationsIf false, only sinks will be used as final edges
[in]maxEdgesThe maximum number of edges a route may have
[in]ignoreClassesWhether routing shall be done without regarding vehicle classes
[in]allowLoopsWhether a vehicle may reuse a road

Definition at line 34 of file ROJTRRouter.cpp.

Referenced by clone().

◆ ~ROJTRRouter()

ROJTRRouter::~ROJTRRouter ( )

Destructor.

Definition at line 43 of file ROJTRRouter.cpp.

Member Function Documentation

◆ clone()

virtual SUMOAbstractRouter<ROEdge, ROVehicle>* ROJTRRouter::clone ( )
inlinevirtual

◆ compute() [1/2]

virtual bool SUMOAbstractRouter< ROEdge , ROVehicle >::compute ( const ROEdge from,
const ROEdge to,
const ROVehicle *const  vehicle,
SUMOTime  msTime,
std::vector< const ROEdge * > &  into,
bool  silent = false 
)
pure virtualinherited

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.

◆ compute() [2/2]

bool ROJTRRouter::compute ( const ROEdge from,
const ROEdge to,
const ROVehicle *const  vehicle,
SUMOTime  time,
ConstROEdgeVector into,
bool  silent = false 
)

Computes a route.

The description how routes are computed is given in the user documentation

Parameters
[in]fromThe edge the vehicle starts at
[in]toThe destination edge - invalid here
[in]vehicleThe vehicle to compute the route for
[in]timeThe departure time of the vehicle
[filled]into The list of edges to store the route into

Definition at line 47 of file ROJTRRouter.cpp.

References ROJTREdge::chooseNext(), MsgHandler::getErrorInstance(), Named::getID(), ROEdge::getTravelTime(), MsgHandler::getWarningInstance(), MsgHandler::inform(), ROEdge::isSink(), myAcceptAllDestination, myAllowLoops, myIgnoreClasses, myMaxEdges, myUnbuildIsWarningOnly, ROEdge::prohibits(), and STEPS2TIME.

◆ computeLooped()

bool SUMOAbstractRouter< ROEdge , ROVehicle >::computeLooped ( const ROEdge from,
const ROEdge to,
const ROVehicle *const  vehicle,
SUMOTime  msTime,
std::vector< const ROEdge * > &  into,
bool  silent = false 
)
inlineinherited

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 130 of file SUMOAbstractRouter.h.

◆ endQuery()

void SUMOAbstractRouter< ROEdge , ROVehicle >::endQuery ( int  visits)
inlineinherited

Definition at line 225 of file SUMOAbstractRouter.h.

◆ getEffort()

double SUMOAbstractRouter< ROEdge , ROVehicle >::getEffort ( const ROEdge *const  e,
const ROVehicle *const  v,
double  t 
) const
inlineinherited

Definition at line 216 of file SUMOAbstractRouter.h.

◆ getTravelTime()

double SUMOAbstractRouter< ROEdge , ROVehicle >::getTravelTime ( const ROEdge *const  e,
const ROVehicle *const  v,
const double  t,
const double  effort 
) const
inlineinherited

Definition at line 165 of file SUMOAbstractRouter.h.

◆ isProhibited()

bool SUMOAbstractRouter< ROEdge , ROVehicle >::isProhibited ( const ROEdge *const  edge,
const ROVehicle *const  vehicle 
) const
inlineinherited

Definition at line 159 of file SUMOAbstractRouter.h.

◆ prohibit()

virtual void SUMOAbstractRouter< ROEdge , ROVehicle >::prohibit ( const std::vector< ROEdge * > &  )
inlinevirtualinherited

Definition at line 163 of file SUMOAbstractRouter.h.

◆ recomputeCosts() [1/2]

double ROJTRRouter::recomputeCosts ( const ConstROEdgeVector edges,
const ROVehicle *const  v,
SUMOTime  msTime 
) const

Recomputes the costs of a route.

Parameters
[in]edgesThe route
[in]vThe vehicle that belongs to the route
[in]msTimeThe departure time of the vehicle
Returns
The route costs

◆ recomputeCosts() [2/2]

double SUMOAbstractRouter< ROEdge , ROVehicle >::recomputeCosts ( const std::vector< const ROEdge * > &  edges,
const ROVehicle *const  v,
SUMOTime  msTime,
double *  lengthp = nullptr 
) const
inlineinherited

Definition at line 195 of file SUMOAbstractRouter.h.

◆ setBulkMode()

void SUMOAbstractRouter< ROEdge , ROVehicle >::setBulkMode ( const bool  mode)
inlineinherited

Definition at line 230 of file SUMOAbstractRouter.h.

◆ startQuery()

void SUMOAbstractRouter< ROEdge , ROVehicle >::startQuery ( )
inlineinherited

Definition at line 220 of file SUMOAbstractRouter.h.

◆ updateViaCost()

void SUMOAbstractRouter< ROEdge , ROVehicle >::updateViaCost ( const ROEdge *const  prev,
const ROEdge *const  e,
const ROVehicle *const  v,
double &  time,
double &  effort,
double &  length 
) const
inlineinherited

Definition at line 179 of file SUMOAbstractRouter.h.

◆ updateViaEdgeCost()

void SUMOAbstractRouter< ROEdge , ROVehicle >::updateViaEdgeCost ( const ROEdge viaEdge,
const ROVehicle *const  v,
double &  time,
double &  effort,
double &  length 
) const
inlineinherited

Definition at line 169 of file SUMOAbstractRouter.h.

Field Documentation

◆ myAcceptAllDestination

const bool ROJTRRouter::myAcceptAllDestination
private

Whether all edges may be used as route end.

Definition at line 97 of file ROJTRRouter.h.

Referenced by clone(), and compute().

◆ myAllowLoops

const bool ROJTRRouter::myAllowLoops
private

Whether a vehicle may reuse a road.

Definition at line 106 of file ROJTRRouter.h.

Referenced by clone(), and compute().

◆ myBulkMode

bool SUMOAbstractRouter< ROEdge , ROVehicle >::myBulkMode
protectedinherited

whether we are currently operating several route queries in a bulk

Definition at line 245 of file SUMOAbstractRouter.h.

◆ myErrorMsgHandler

MsgHandler* const SUMOAbstractRouter< ROEdge , ROVehicle >::myErrorMsgHandler
protectedinherited

the handler for routing errors

Definition at line 236 of file SUMOAbstractRouter.h.

◆ myHavePermissions

const bool SUMOAbstractRouter< ROEdge , ROVehicle >::myHavePermissions
protectedinherited

whether edge permissions need to be considered

Definition at line 248 of file SUMOAbstractRouter.h.

◆ myHaveRestrictions

const bool SUMOAbstractRouter< ROEdge , ROVehicle >::myHaveRestrictions
protectedinherited

whether edge restrictions need to be considered

Definition at line 251 of file SUMOAbstractRouter.h.

◆ myIgnoreClasses

const bool ROJTRRouter::myIgnoreClasses
private

Whether vehicle class information shall be ignored.

Definition at line 103 of file ROJTRRouter.h.

Referenced by clone(), and compute().

◆ myMaxEdges

const int ROJTRRouter::myMaxEdges
private

The maximum number of edges a route may have.

Definition at line 100 of file ROJTRRouter.h.

Referenced by clone(), and compute().

◆ myNumQueries

long long int SUMOAbstractRouter< ROEdge , ROVehicle >::myNumQueries
privateinherited

Definition at line 261 of file SUMOAbstractRouter.h.

◆ myOperation

Operation SUMOAbstractRouter< ROEdge , ROVehicle >::myOperation
protectedinherited

The object's operation to perform.

Definition at line 239 of file SUMOAbstractRouter.h.

◆ myProhibited

std::vector<ROEdge *> SUMOAbstractRouter< ROEdge , ROVehicle >::myProhibited
protectedinherited

Definition at line 253 of file SUMOAbstractRouter.h.

◆ myQueryStartTime

long long int SUMOAbstractRouter< ROEdge , ROVehicle >::myQueryStartTime
privateinherited

the time spent querying in milliseconds

Definition at line 263 of file SUMOAbstractRouter.h.

◆ myQueryTimeSum

long long int SUMOAbstractRouter< ROEdge , ROVehicle >::myQueryTimeSum
privateinherited

Definition at line 264 of file SUMOAbstractRouter.h.

◆ myQueryVisits

long long int SUMOAbstractRouter< ROEdge , ROVehicle >::myQueryVisits
privateinherited

counters for performance logging

Definition at line 260 of file SUMOAbstractRouter.h.

◆ myTTOperation

Operation SUMOAbstractRouter< ROEdge , ROVehicle >::myTTOperation
protectedinherited

The object's operation to perform for travel times.

Definition at line 242 of file SUMOAbstractRouter.h.

◆ myType

const std::string SUMOAbstractRouter< ROEdge , ROVehicle >::myType
privateinherited

the type of this router

Definition at line 257 of file SUMOAbstractRouter.h.

◆ myUnbuildIsWarningOnly

const bool ROJTRRouter::myUnbuildIsWarningOnly
private

Whether unbuildable routes shall be reported as warniings, not errors.

Definition at line 94 of file ROJTRRouter.h.

Referenced by clone(), and compute().


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