-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make edge weight a strongly defined type #3601
Comments
Yes, yes please. I poked @danpat often enough some time ago that we ended up building and incorporating https://github.com/Project-OSRM/osrm-backend/blob/master/include/util/strong_typedef.hpp#L43 which is similar to the one in Boost, except that it does not allow implicit conversions. |
@oxidase yeah, you want to take a look and see if It should be fully optimized away under |
This has no clear priority right now. We should have a look at this when we got some downtime for refactors. |
Currently OSRM parses traffic signal nodes without consideration for the direction in which the signal applies. This can lead to duplicated routing penalties, especially when a forward and backward signal are in close proximity on a way. This commit adds support for directed signals to the extraction and graph creation. Signal penalties are only applied in the direction specified by the OSM tag. We add the assignment of traffic directions to the lua scripts, maintaining backwards compatibility with the existing boolean traffic states. As part of the changes to the internal structures used for tracking traffic signals during extraction, we stop serialising/deserialising signals to the `.osrm` file. The traffic signals are only used by `osrm-extract` so whilst this is a data format change, it will not break any existing user processes.
Working on #2399 found different weight types
unsigned
osrm-backend/include/contractor/contractor_graph.hpp
Line 29 in a5d0707
std::int32_t
osrm-backend/src/engine/routing_algorithms/routing_base.cpp
Line 23 in a5d0707
int
osrm-backend/src/engine/routing_algorithms/many_to_many.cpp
Line 131 in a5d0707
PR #2399 unifies weight types as
EdgeWeight
but compile-time type checking is required to check all places.It would also good to define strongly typed
EdgeDuration
,TurnWeight
andTurnDuration
to have compile-type checks and avoid problems by mixing edge/turn weights and durations.The text was updated successfully, but these errors were encountered: