Rename increasingly inaccuratly named distance member of QueryEdge to weight

This commit is contained in:
Patrick Niklaus
2016-05-12 18:50:10 +02:00
committed by Patrick Niklaus
parent 1d994da12b
commit b8795c7341
13 changed files with 253 additions and 260 deletions
+3 -3
View File
@@ -780,7 +780,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph(
edge_segment_byte_ptr += sizeof(extractor::lookup::SegmentHeaderBlock);
auto previous_osm_node_id = header->previous_osm_node_id;
int new_weight = 0;
EdgeWeight new_weight = 0;
int compressed_edge_nodes = static_cast<int>(header->num_osm_nodes);
auto segmentblocks =
@@ -996,12 +996,12 @@ Contractor::WriteContractedGraph(unsigned max_node_id,
// every target needs to be valid
BOOST_ASSERT(current_edge.target <= max_used_node_id);
#ifndef NDEBUG
if (current_edge.data.distance <= 0)
if (current_edge.data.weight <= 0)
{
util::SimpleLogger().Write(logWARNING)
<< "Edge: " << edge << ",source: " << contracted_edge_list[edge].source
<< ", target: " << contracted_edge_list[edge].target
<< ", dist: " << current_edge.data.distance;
<< ", weight: " << current_edge.data.weight;
util::SimpleLogger().Write(logWARNING) << "Failed at adjacency list of node "
<< contracted_edge_list[edge].source << "/"
+3 -3
View File
@@ -540,13 +540,13 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
const auto sum_node_weight = std::accumulate(
forward_weight_vector.begin(), forward_weight_vector.end(), EdgeWeight{0});
// The edge.distance is the whole edge weight, which includes the turn cost.
// The turn cost is the edge.distance minus the sum of the individual road
// The edge.weight is the whole edge weight, which includes the turn cost.
// The turn cost is the edge.weight minus the sum of the individual road
// segment weights. This might not be 100% accurate, because some
// intersections include stop signs, traffic signals and other penalties,
// but at this stage, we can't divide those out, so we just treat the whole
// lot as the "turn cost" that we'll stick on the map.
const auto turn_cost = data.distance - sum_node_weight;
const auto turn_cost = data.weight - sum_node_weight;
// Find the three nodes that make up the turn movement)
const auto node_from = first_geometry.size() > 1