implements #949, wrong duration on first segment
This commit is contained in:
@@ -307,10 +307,10 @@ template <class DataFacadeT> class AlternativeRouting : private BasicRoutingInte
|
||||
{
|
||||
BOOST_ASSERT(!packed_shortest_path.empty());
|
||||
raw_route_data.unpacked_path_segments.resize(1);
|
||||
raw_route_data.source_traversed_in_reverse =
|
||||
(packed_shortest_path.front() != phantom_node_pair.source_phantom.forward_node_id);
|
||||
raw_route_data.target_traversed_in_reverse =
|
||||
(packed_shortest_path.back() != phantom_node_pair.target_phantom.forward_node_id);
|
||||
raw_route_data.source_traversed_in_reverse.push_back(
|
||||
(packed_shortest_path.front() != phantom_node_pair.source_phantom.forward_node_id));
|
||||
raw_route_data.target_traversed_in_reverse.push_back(
|
||||
(packed_shortest_path.back() != phantom_node_pair.target_phantom.forward_node_id));
|
||||
|
||||
super::UnpackPath(
|
||||
// -- packed input
|
||||
@@ -334,16 +334,19 @@ template <class DataFacadeT> class AlternativeRouting : private BasicRoutingInte
|
||||
v_t_middle,
|
||||
packed_alternate_path);
|
||||
|
||||
raw_route_data.source_traversed_in_reverse =
|
||||
(packed_alternate_path.front() != phantom_node_pair.source_phantom.forward_node_id);
|
||||
raw_route_data.target_traversed_in_reverse =
|
||||
(packed_alternate_path.back() != phantom_node_pair.target_phantom.forward_node_id);
|
||||
raw_route_data.alt_source_traversed_in_reverse.push_back(
|
||||
(packed_alternate_path.front() != phantom_node_pair.source_phantom.forward_node_id));
|
||||
raw_route_data.alt_target_traversed_in_reverse.push_back(
|
||||
(packed_alternate_path.back() != phantom_node_pair.target_phantom.forward_node_id));
|
||||
|
||||
// unpack the alternate path
|
||||
super::UnpackPath(
|
||||
packed_alternate_path, phantom_node_pair, raw_route_data.unpacked_alternative);
|
||||
|
||||
raw_route_data.alternative_path_length = length_of_via_path;
|
||||
SimpleLogger().Write() << "length of via path: " << length_of_via_path << " & selected_via_node: " << selected_via_node;
|
||||
} else {
|
||||
BOOST_ASSERT(raw_route_data.alternative_path_length == INVALID_EDGE_WEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -231,8 +231,7 @@ template <class DataFacadeT> class BasicRoutingInterface
|
||||
BOOST_ASSERT(start_index <= end_index);
|
||||
for (int i = start_index; i < end_index; ++i)
|
||||
{
|
||||
unpacked_path.emplace_back(PathData{
|
||||
id_vector[i], name_index, TurnInstruction::NoTurn, 0});
|
||||
unpacked_path.emplace_back(id_vector[i], name_index, TurnInstruction::NoTurn, 0);
|
||||
}
|
||||
unpacked_path.back().turn_instruction = turn_instruction;
|
||||
unpacked_path.back().segment_duration = ed.distance;
|
||||
|
||||
@@ -292,13 +292,6 @@ template <class DataFacadeT> class ShortestPathRouting : public BasicRoutingInte
|
||||
}
|
||||
raw_route_data.unpacked_path_segments.resize(packed_legs1.size());
|
||||
|
||||
raw_route_data.source_traversed_in_reverse =
|
||||
(packed_legs1.front().front() !=
|
||||
phantom_nodes_vector.front().source_phantom.forward_node_id);
|
||||
raw_route_data.target_traversed_in_reverse =
|
||||
(packed_legs1.back().back() !=
|
||||
phantom_nodes_vector.back().target_phantom.forward_node_id);
|
||||
|
||||
for (unsigned i = 0; i < packed_legs1.size(); ++i)
|
||||
{
|
||||
BOOST_ASSERT(!phantom_nodes_vector.empty());
|
||||
@@ -312,6 +305,11 @@ template <class DataFacadeT> class ShortestPathRouting : public BasicRoutingInte
|
||||
unpack_phantom_node_pair,
|
||||
// -- unpacked output
|
||||
raw_route_data.unpacked_path_segments[i]);
|
||||
|
||||
raw_route_data.source_traversed_in_reverse.push_back(
|
||||
(packed_legs1[i].front() != phantom_nodes_vector[i].source_phantom.forward_node_id));
|
||||
raw_route_data.target_traversed_in_reverse.push_back(
|
||||
(packed_legs1[i].back() != phantom_nodes_vector[i].target_phantom.forward_node_id));
|
||||
}
|
||||
raw_route_data.shortest_path_length = std::min(distance1, distance2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user