Weight-ifies alternatives related code-paths

This commit is contained in:
Daniel J. Hofmann
2017-05-11 16:36:37 +02:00
parent f8002480c2
commit e12c7756d9
6 changed files with 73 additions and 81 deletions
+4 -11
View File
@@ -16,8 +16,6 @@ namespace osrm
namespace engine
{
const constexpr unsigned INVALID_EXIT_NR = 0;
struct PathData
{
// id of via node of the turn
@@ -55,22 +53,17 @@ struct InternalRouteResult
std::vector<bool> target_traversed_in_reverse;
std::vector<bool> alt_source_traversed_in_reverse;
std::vector<bool> alt_target_traversed_in_reverse;
int shortest_path_length;
int alternative_path_length;
EdgeWeight shortest_path_weight = INVALID_EDGE_WEIGHT;
EdgeWeight alternative_path_weight = INVALID_EDGE_WEIGHT;
bool is_valid() const { return INVALID_EDGE_WEIGHT != shortest_path_length; }
bool is_valid() const { return INVALID_EDGE_WEIGHT != shortest_path_weight; }
bool has_alternative() const { return INVALID_EDGE_WEIGHT != alternative_path_length; }
bool has_alternative() const { return INVALID_EDGE_WEIGHT != alternative_path_weight; }
bool is_via_leg(const std::size_t leg) const
{
return (leg != unpacked_path_segments.size() - 1);
}
InternalRouteResult()
: shortest_path_length(INVALID_EDGE_WEIGHT), alternative_path_length(INVALID_EDGE_WEIGHT)
{
}
};
}
}