This commit is contained in:
Huyen Chau Nguyen
2018-09-09 22:49:32 +03:00
parent 91a24bf537
commit 4a4d7ac62f
12 changed files with 71 additions and 60 deletions
+7 -9
View File
@@ -46,15 +46,14 @@ namespace engine
struct PhantomNode
{
PhantomNode()
: forward_segment_id{SPECIAL_SEGMENTID, false}, reverse_segment_id{SPECIAL_SEGMENTID,
false},
forward_weight(INVALID_EDGE_WEIGHT), reverse_weight(INVALID_EDGE_WEIGHT),
forward_weight_offset(0), reverse_weight_offset(0),
: forward_segment_id{SPECIAL_SEGMENTID, false},
reverse_segment_id{SPECIAL_SEGMENTID, false}, forward_weight(INVALID_EDGE_WEIGHT),
reverse_weight(INVALID_EDGE_WEIGHT), forward_weight_offset(0), reverse_weight_offset(0),
forward_distance(INVALID_EDGE_DISTANCE), reverse_distance(INVALID_EDGE_DISTANCE),
forward_distance_offset(0), reverse_distance_offset(0),
forward_duration(MAXIMAL_EDGE_DURATION), reverse_duration(MAXIMAL_EDGE_DURATION),
forward_duration_offset(0), reverse_duration_offset(0),
fwd_segment_position(0), is_valid_forward_source{false}, is_valid_forward_target{false},
forward_duration_offset(0), reverse_duration_offset(0), fwd_segment_position(0),
is_valid_forward_source{false}, is_valid_forward_target{false},
is_valid_reverse_source{false}, is_valid_reverse_target{false}, bearing(0)
{
@@ -112,9 +111,8 @@ struct PhantomNode
bool IsValid(const unsigned number_of_nodes) const
{
return location.IsValid() &&
((forward_segment_id.id < number_of_nodes) ||
(reverse_segment_id.id < number_of_nodes)) &&
return location.IsValid() && ((forward_segment_id.id < number_of_nodes) ||
(reverse_segment_id.id < number_of_nodes)) &&
((forward_weight != INVALID_EDGE_WEIGHT) ||
(reverse_weight != INVALID_EDGE_WEIGHT)) &&
((forward_duration != MAXIMAL_EDGE_DURATION) ||
@@ -186,7 +186,7 @@ void routingStep(const DataFacade<Algorithm> &facade,
}
template <bool UseDuration>
std::tuple<EdgeWeight,EdgeDistance> getLoopWeight(const DataFacade<Algorithm> &facade, NodeID node)
std::tuple<EdgeWeight, EdgeDistance> getLoopWeight(const DataFacade<Algorithm> &facade, NodeID node)
{
EdgeWeight loop_weight = UseDuration ? MAXIMAL_EDGE_DURATION : INVALID_EDGE_WEIGHT;
EdgeDistance loop_distance = MAXIMAL_EDGE_DISTANCE;
+3 -3
View File
@@ -9,8 +9,8 @@
#include <tbb/parallel_sort.h>
#include <memory>
#include <iostream>
#include <memory>
#include <utility>
namespace osrm
@@ -88,10 +88,10 @@ NodeBasedDynamicGraphFromEdges(NodeID number_of_nodes,
output_edge.data.flags = input_edge.flags;
output_edge.data.annotation_data = input_edge.annotation_data;
BOOST_ASSERT(output_edge.data.weight >= 0);
BOOST_ASSERT(output_edge.data.duration >= 0);
if (output_edge.data.distance <= 0) {
if (output_edge.data.distance <= 0)
{
std::cout << "output_edge.data.distance " << output_edge.data.distance << std::endl;
}
BOOST_ASSERT(output_edge.data.distance >= 0);