Add duration to edges and use it in table plugin
This commit is contained in:
committed by
Patrick Niklaus
parent
c059d15cb9
commit
25baf51a2c
@@ -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);
|
||||
|
||||
@@ -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}});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user