Add duration to edges and use it in table plugin

This commit is contained in:
Michael Krasnyk
2017-01-19 22:52:09 +01:00
committed by Patrick Niklaus
parent c059d15cb9
commit 25baf51a2c
24 changed files with 312 additions and 126 deletions
+9 -2
View File
@@ -544,8 +544,15 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
auto turn_id = m_edge_based_edge_list.size();
auto weight =
boost::numeric_cast<EdgeWeight>(edge_data1.weight + weight_penalty);
m_edge_based_edge_list.emplace_back(
edge_data1.edge_id, edge_data2.edge_id, turn_id, weight, true, false);
auto duration =
boost::numeric_cast<EdgeWeight>(edge_data1.duration + duration_penalty);
m_edge_based_edge_list.emplace_back(edge_data1.edge_id,
edge_data2.edge_id,
turn_id,
weight,
duration,
true,
false);
BOOST_ASSERT(original_edges_counter == m_edge_based_edge_list.size());
BOOST_ASSERT(turn_weight_penalties.size() == turn_id);
+3 -2
View File
@@ -324,6 +324,7 @@ void Extractor::FindComponents(unsigned max_edge_id,
{
struct UncontractedEdgeData
{
EdgeWeight duration;
};
struct InputEdge
{
@@ -353,12 +354,12 @@ void Extractor::FindComponents(unsigned max_edge_id,
BOOST_ASSERT(edge.target <= max_edge_id);
if (edge.forward)
{
edges.push_back({edge.source, edge.target, {}});
edges.push_back({edge.source, edge.target, {edge.duration}});
}
if (edge.backward)
{
edges.push_back({edge.target, edge.source, {}});
edges.push_back({edge.target, edge.source, {edge.duration}});
}
}