@@ -182,16 +182,15 @@ void relaxOutgoingEdges(const DataFacade<mld::Algorithm> &facade,
182182 }
183183
184184 const auto turn_id = data.turn_id ;
185- const auto node_weight =
186- facade.GetNodeWeight (DIRECTION == FORWARD_DIRECTION ? node : to);
187- const auto node_duration = facade.GetNodeDuration (
188- DIRECTION == FORWARD_DIRECTION ? node : to); // TODO: remove later
189- const auto edge_weight = node_weight + facade.GetWeightPenaltyForEdgeID (turn_id);
190- const auto edge_duration = node_duration + facade.GetDurationPenaltyForEdgeID (turn_id);
185+ const auto node_id = DIRECTION == FORWARD_DIRECTION ? node : facade.GetTarget (edge);
186+ const auto node_weight = facade.GetNodeWeight (node_id);
187+ const auto node_duration = facade.GetNodeDuration (node_id);
188+ const auto turn_weight = node_weight + facade.GetWeightPenaltyForEdgeID (turn_id);
189+ const auto turn_duration = node_duration + facade.GetDurationPenaltyForEdgeID (turn_id);
191190
192- BOOST_ASSERT_MSG (edge_weight > 0 , " edge_weight invalid" );
193- const auto to_weight = weight + edge_weight ;
194- const auto to_duration = duration + edge_duration ;
191+ BOOST_ASSERT_MSG (node_weight + turn_weight > 0 , " edge weight is invalid" );
192+ const auto to_weight = weight + turn_weight ;
193+ const auto to_duration = duration + turn_duration ;
195194
196195 // New Node discovered -> Add to Heap + Node Info Storage
197196 if (!query_heap.WasInserted (to))
@@ -315,15 +314,10 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
315314 : facade.IsBackwardEdge (edge))
316315 {
317316 const auto turn_id = data.turn_id ;
318- const auto edge_weight =
319- initial_weight +
320- facade.GetNodeWeight (DIRECTION == FORWARD_DIRECTION ? node
321- : facade.GetTarget (edge)) +
322- facade.GetWeightPenaltyForEdgeID (turn_id);
323- const auto edge_duration = initial_duration +
324- +facade.GetNodeDuration (DIRECTION == FORWARD_DIRECTION
325- ? node
326- : facade.GetTarget (edge)) +
317+ const auto node_id = DIRECTION == FORWARD_DIRECTION ? node : facade.GetTarget (edge);
318+ const auto edge_weight = initial_weight + facade.GetNodeWeight (node_id) +
319+ facade.GetWeightPenaltyForEdgeID (turn_id);
320+ const auto edge_duration = initial_duration + facade.GetNodeDuration (node_id) +
327321 facade.GetDurationPenaltyForEdgeID (turn_id);
328322
329323 query_heap.Insert (facade.GetTarget (edge), edge_weight, {node, edge_duration});
0 commit comments