Rename {id|edge_id} to turn_id

This commit is contained in:
Michael Krasnyk
2017-03-10 10:57:07 +01:00
parent c370ddd89a
commit 43a7e8e08a
8 changed files with 41 additions and 42 deletions
+3 -3
View File
@@ -139,13 +139,13 @@ class GraphContractor
if (!data.is_original_via_node_ID && !orig_node_id_from_new_node_id_map.empty())
{
// tranlate the _node id_ of the shortcutted node
new_edge.data.id = orig_node_id_from_new_node_id_map[data.id];
new_edge.data.turn_id = orig_node_id_from_new_node_id_map[data.id];
}
else
{
new_edge.data.id = data.id;
new_edge.data.turn_id = data.id;
}
BOOST_ASSERT_MSG(new_edge.data.id != INT_MAX, // 2^31
BOOST_ASSERT_MSG(new_edge.data.turn_id != INT_MAX, // 2^31
"edge id invalid");
new_edge.data.forward = data.forward;
new_edge.data.backward = data.backward;
@@ -38,7 +38,7 @@ std::vector<ContractorEdge> adaptToContractorInput(InputEdgeContainer input_edge
std::max(input_edge.data.weight, 1),
input_edge.data.duration,
1,
input_edge.data.edge_id,
input_edge.data.turn_id,
false,
input_edge.data.forward ? true : false,
input_edge.data.backward ? true : false);
@@ -48,7 +48,7 @@ std::vector<ContractorEdge> adaptToContractorInput(InputEdgeContainer input_edge
std::max(input_edge.data.weight, 1),
input_edge.data.duration,
1,
input_edge.data.edge_id,
input_edge.data.turn_id,
false,
input_edge.data.backward ? true : false,
input_edge.data.forward ? true : false);
+4 -4
View File
@@ -17,7 +17,7 @@ struct QueryEdge
struct EdgeData
{
explicit EdgeData()
: id(0), shortcut(false), weight(0), duration(0), forward(false), backward(false)
: turn_id(0), shortcut(false), weight(0), duration(0), forward(false), backward(false)
{
}
@@ -26,14 +26,14 @@ struct QueryEdge
weight = other.weight;
duration = other.duration;
shortcut = other.shortcut;
id = other.id;
turn_id = other.id;
forward = other.forward;
backward = other.backward;
}
// this ID is either the middle node of the shortcut, or the ID of the edge based node (node
// based edge) storing the appropriate data. If `shortcut` is set to true, we get the middle
// node. Otherwise we see the edge based node to access node data.
NodeID id : 31;
NodeID turn_id : 31;
bool shortcut : 1;
EdgeWeight weight;
EdgeWeight duration : 30;
@@ -58,7 +58,7 @@ struct QueryEdge
return (source == right.source && target == right.target &&
data.weight == right.data.weight && data.duration == right.data.duration &&
data.shortcut == right.data.shortcut && data.forward == right.data.forward &&
data.backward == right.data.backward && data.id == right.data.id);
data.backward == right.data.backward && data.turn_id == right.data.turn_id);
}
};
}