Eclipse SUMO - Simulation of Urban MObility
|
Builds the flags for (multi-level) arc flag routing (Hilger et al.) in its multi-level variant (also called "stripped SHARC" by Delling et al.) More...
#include <AFBuild.h>
Public Types | |
typedef AFInfo< FlippedEdge< E, N, V > >::ArcInfo | ArcInfo |
typedef KDTreePartition< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V >::Cell | Cell |
typedef AFInfo< E >::FlagInfo | FlagInfo |
typedef AbstractLookupTable< FlippedEdge< E, N, V >, V > | FlippedLookupTable |
Public Member Functions | |
AFBuild (const std::vector< FlippedEdge< E, N, V > * > &flippedEdges, const KDTreePartition< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V > *const flippedPartition, int numberOfLevels, bool unbuildIsWarning, typename SUMOAbstractRouter< FlippedEdge< E, N, V >, V >::Operation flippedOperation, const std::shared_ptr< const FlippedLookupTable > flippedLookup=nullptr, const bool havePermissions=false, const bool haveRestrictions=false, const std::vector< FlippedEdge< E, N, V > * > *toProhibit=nullptr) | |
Constructor. | |
const std::shared_ptr< const FlippedLookupTable > | getFlippedLookup () |
Returns the lookup table for the backward graph with flipped edges. | |
SUMOAbstractRouter< FlippedEdge< E, N, V >, V >::Operation | getFlippedOperation () |
Returns the operation for a backward graph with flipped edges. | |
void | init (SUMOTime time, const V *const vehicle, std::vector< FlagInfo * > &flagInfos) |
Initialize the arc flag build. | |
int | partitionLevel2SHARCLevel (int partitionLevel) |
Converts a partition level number to a SHARC level number. | |
void | setFlippedPartition (const KDTreePartition< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V > *flippedPartition) |
Set the flipped partition param[in] flippedPartition The flipped partition. | |
int | sHARCLevel2PartitionLevel (int sHARCLevel) |
Converts a SHARC level number to a partition level number. | |
~AFBuild () | |
Destructor. | |
Data Fields | |
const double | EPS = 0.009 |
Maximum difference of two path lengths considered to be equal. | |
Protected Member Functions | |
void | computeArcFlags (SUMOTime msTime, const int sHARCLevel, const Cell *cell, const V *const vehicle) |
Computes the arc flags for a given cell. | |
void | computeArcFlags (SUMOTime msTime, int sHARCLevel, const V *const vehicle) |
Computes the arc flags for all cells at a given level. | |
void | computeArcFlagsNaive (SUMOTime msTime, const int sHARCLevel, const Cell *cell, const V *const vehicle) |
Computes the arc flags for a given cell (naive version) | |
void | putArcFlag (ArcInfo *arcInfo, const int sHARCLevel, const bool isLeftOrLowerCell) |
Put the arc flag of the edge in arcInfo. | |
Protected Attributes | |
std::vector< ArcInfo * > | myArcInfos |
The container of arc informations (for the centralized shortest path tree) | |
AFCentralizedSPTree< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V > * | myCentralizedSPTree |
A Dijkstra based centralized label-correcting algorithm. | |
MsgHandler *const | myErrorMsgHandler |
The handler for routing errors. | |
const std::vector< FlippedEdge< E, N, V > * > & | myFlippedEdges |
The flipped edges. | |
const std::shared_ptr< const FlippedLookupTable > | myFlippedLookupTable |
The lookup table for travel time heuristics. | |
SUMOAbstractRouter< FlippedEdge< E, N, V >, V >::Operation | myFlippedOperation |
The object's operation to perform on a backward graph with flipped edges. | |
const KDTreePartition< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V > * | myFlippedPartition |
The partition for the backward graph with flipped edges. | |
const bool | myHavePermissions |
The boolean flag indicating whether edge permissions need to be considered or not. | |
const bool | myHaveRestrictions |
The boolean flag indicating whether edge restrictions need to be considered or not. | |
Node2EdgeRouter< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V > * | myNode2EdgeRouter |
The node-to-edge router (for a backward graph with flipped edges) | |
const int | myNumberOfLevels |
The number of levels. | |
const std::vector< FlippedEdge< E, N, V > * > * | myProhibited |
The list of explicitly prohibited edges. | |
Private Member Functions | |
void | computeArcFlagsAux (SUMOTime msTime, const int sHARCLevel, const Cell *cell, const V *const vehicle) |
Helper method for computeArcFlags(), which computes the arc flags for a given cell. | |
void | initBoundaryEdges (const std::unordered_set< const FlippedEdge< E, N, V > * > &boundaryEdges) |
Initialize the boundary edges param[in] boundaryEdges The boundary edges. | |
void | initSupercellEdges (const Cell *supercell, const std::unordered_set< const FlippedEdge< E, N, V > * > &boundaryEdges, size_t numberOfBoundaryNodes) |
Initialize the supercell edges. | |
Builds the flags for (multi-level) arc flag routing (Hilger et al.) in its multi-level variant (also called "stripped SHARC" by Delling et al.)
The template parameters are:
E | The edge class to use (MSEdge/ROEdge ) |
N | The node class to use (MSJunction/RONode) |
V | The vehicle class to use (MSVehicle/ROVehicle) |
typedef AFInfo<FlippedEdge<E,N,V>>::ArcInfo AFBuild< E, N, V >::ArcInfo |
typedef KDTreePartition<FlippedEdge<E,N,V>,FlippedNode<E,N,V>,V>::Cell AFBuild< E, N, V >::Cell |
typedef AbstractLookupTable<FlippedEdge<E, N, V>, V> AFBuild< E, N, V >::FlippedLookupTable |
|
inline |
Constructor.
[in] | flippedEdges | The flipped (aka reversed / backward) edges |
[in] | flippedPartition | The k-d tree partition of the backward graph with flipped edges |
[in] | numberOfLevels | The number of levels |
[in] | unbuildIsWarning | The flag indicating whether network unbuilds should issue warnings or errors |
[in] | flippedOperation | The operation for a backward graph with flipped edges |
[in] | flippedLookup | The lookup table for a backward graph with flipped edges |
[in] | havePermissions | The boolean flag indicating whether edge permissions need to be considered or not |
[in] | haveRestrictions | The boolean flag indicating whether edge restrictions need to be considered or not |
[in] | toProhibit | The list of explicitly prohibited edges |
Definition at line 102 of file AFBuild.h.
References AFBuild< E, N, V >::myArcInfos, AFBuild< E, N, V >::myCentralizedSPTree, AFBuild< E, N, V >::myFlippedEdges, AFBuild< E, N, V >::myHavePermissions, AFBuild< E, N, V >::myHaveRestrictions, AFBuild< E, N, V >::myNode2EdgeRouter, and SUMOAbstractRouter< E, V >::prohibit().
Destructor.
Definition at line 129 of file AFBuild.h.
References AFBuild< E, N, V >::myCentralizedSPTree, and AFBuild< E, N, V >::myNode2EdgeRouter.
|
protected |
Computes the arc flags for a given cell.
[in] | msTime | The start time of the routes in milliseconds |
sHARCLevel | The SHARC level | |
[in] | cell | The cell |
[in] | vehicle | The vehicle |
Definition at line 392 of file AFBuild.h.
References AFInfo< E >::ArcInfo::effortsToBoundaryNodes, elapsedMs2string(), SysUtils::getCurrentMillis(), and UNREACHABLE.
|
private |
Helper method for computeArcFlags(), which computes the arc flags for a given cell.
[in] | msTime | The start time of the routes in milliseconds |
[in] | sHARCLevel | The SHARC level |
[in] | cell | The cell |
[in] | vehicle | The vehicle |
Definition at line 462 of file AFBuild.h.
References AFInfo< E >::FlagInfo::edge, AFInfo< E >::ArcInfo::effortsToBoundaryNodes, elapsedMs2string(), SysUtils::getCurrentMillis(), Named::getIDSecure(), STEPS2TIME, SVC_IGNORING, and UNREACHABLE.
|
protected |
Computes the arc flags for a given cell (naive version)
[in] | msTime | The start time of the routes in milliseconds |
sHARCLevel | The SHARC level | |
[in] | cell | The cell |
[in] | vehicle | The vehicle |
Definition at line 324 of file AFBuild.h.
References AFInfo< E >::ArcInfo::effortsToBoundaryNodes, elapsedMs2string(), SysUtils::getCurrentMillis(), and UNREACHABLE.
|
inline |
Returns the lookup table for the backward graph with flipped edges.
Definition at line 139 of file AFBuild.h.
References AFBuild< E, N, V >::myFlippedLookupTable.
|
inline |
Returns the operation for a backward graph with flipped edges.
Definition at line 135 of file AFBuild.h.
References AFBuild< E, N, V >::myFlippedOperation.
|
private |
Initialize the boundary edges param[in] boundaryEdges The boundary edges.
Definition at line 663 of file AFBuild.h.
References AFInfo< E >::ArcInfoBase::arcFlags, and AFInfo< E >::ArcInfo::effortsToBoundaryNodes.
|
private |
Initialize the supercell edges.
[in] | supercell | The supercell |
[in] | boundaryEdges | The boundary edges |
[in] | numberOfBoundaryNodes | The number of boundary nodes |
Definition at line 678 of file AFBuild.h.
References AFInfo< E >::ArcInfoBase::arcFlags, and AFInfo< E >::ArcInfo::effortsToBoundaryNodes.
|
inline |
Converts a partition level number to a SHARC level number.
[in] | partitionLevel | The partition level |
Definition at line 158 of file AFBuild.h.
References AFBuild< E, N, V >::myNumberOfLevels, and AFRouter< E, N, V >::partitionLevel2SHARCLevel().
|
protected |
Put the arc flag of the edge in arcInfo.
[in] | arcInfo | The arc information |
[in] | sHARCLevel | The SHARC level |
[in] | isLeftOrLowerCell | The boolean flag indicating whether the respective cell is a left or lower one or not |
Definition at line 657 of file AFBuild.h.
References AFInfo< E >::ArcInfoBase::arcFlags.
|
inline |
Set the flipped partition param[in] flippedPartition The flipped partition.
Definition at line 151 of file AFBuild.h.
References AFBuild< E, N, V >::myFlippedPartition.
|
inline |
Converts a SHARC level number to a partition level number.
[in] | sHARCLevel | The SHARC level |
Definition at line 165 of file AFBuild.h.
References AFBuild< E, N, V >::myNumberOfLevels, and AFRouter< E, N, V >::sHARCLevel2PartitionLevel().
The container of arc informations (for the centralized shortest path tree)
Definition at line 222 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::AFBuild().
|
protected |
A Dijkstra based centralized label-correcting algorithm.
Definition at line 220 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::AFBuild(), and AFBuild< E, N, V >::~AFBuild().
|
protected |
|
protected |
The flipped edges.
Definition at line 198 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::AFBuild().
|
protected |
The lookup table for travel time heuristics.
Definition at line 208 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::getFlippedLookup().
|
protected |
The object's operation to perform on a backward graph with flipped edges.
Definition at line 206 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::getFlippedOperation().
|
protected |
The partition for the backward graph with flipped edges.
Definition at line 200 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::setFlippedPartition().
The boolean flag indicating whether edge permissions need to be considered or not.
Definition at line 210 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::AFBuild().
The boolean flag indicating whether edge restrictions need to be considered or not.
Definition at line 212 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::AFBuild().
|
protected |
The node-to-edge router (for a backward graph with flipped edges)
Definition at line 216 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::AFBuild(), and AFBuild< E, N, V >::~AFBuild().
The number of levels.
Definition at line 202 of file AFBuild.h.
Referenced by AFBuild< E, N, V >::partitionLevel2SHARCLevel(), and AFBuild< E, N, V >::sHARCLevel2PartitionLevel().
|
protected |