Skip to content

Commit

Permalink
some bug fixes ported over from #4638
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsnolde committed Mar 25, 2024
1 parent 962719a commit f6fd150
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/sif/pedestriancost.cc
Expand Up @@ -550,7 +550,6 @@ class PedestrianCost : public DynamicCost {
(edge->use() == baldr::Use::kRailFerry && pred->use() != baldr::Use::kRailFerry);

// Additional penalties without any time cost
c.cost += destination_only_penalty_ * (edge->destonly() && !pred->destonly());
c.cost +=
alley_penalty_ * (edge->use() == baldr::Use::kAlley && pred->use() != baldr::Use::kAlley);
c.cost +=
Expand Down
10 changes: 5 additions & 5 deletions src/thor/bidirectional_astar.cc
Expand Up @@ -365,7 +365,7 @@ inline bool BidirectionalAStar::ExpandInner(baldr::GraphReader& graphreader,

// we've just added this edge to the queue, but we won't expand from it if it's a not-thru edge that
// will be pruned. In that case we want to allow uturns.
return !(pred.not_thru_pruning() && meta.edge->not_thru());
return not_thru_pruning_ && !(pred.not_thru_pruning() && meta.edge->not_thru());
}

template <const ExpansionType expansion_direction>
Expand Down Expand Up @@ -428,10 +428,10 @@ void BidirectionalAStar::Expand(baldr::GraphReader& graphreader,
uturn_meta = is_uturn ? meta : uturn_meta;

// Expand but only if this isnt the uturn, we'll try that later if nothing else works out
disable_uturn = (!is_uturn && ExpandInner<expansion_direction>(graphreader, pred, opp_pred_edge,
nodeinfo, pred_idx, meta,
shortcuts, tile, offset_time)) ||
disable_uturn;
disable_uturn =
!is_uturn && ExpandInner<expansion_direction>(graphreader, pred, opp_pred_edge, nodeinfo,
pred_idx, meta, shortcuts, tile, offset_time) ||
disable_uturn;
}

// Handle transitions - expand from the end node of each transition
Expand Down
2 changes: 1 addition & 1 deletion src/thor/costmatrix.cc
Expand Up @@ -552,7 +552,7 @@ bool CostMatrix::ExpandInner(baldr::GraphReader& graphreader,
pred_dist, newcost.cost);
}

return !(pred.not_thru_pruning() && meta.edge->not_thru());
return not_thru_pruning_ && !(pred.not_thru_pruning() && meta.edge->not_thru());
}

template <const MatrixExpansionType expansion_direction, const bool FORWARD>
Expand Down
4 changes: 2 additions & 2 deletions src/thor/timedistancematrix.cc
Expand Up @@ -151,15 +151,15 @@ void TimeDistanceMatrix::Expand(GraphReader& graphreader,
uint32_t idx = edgelabels_.size();
if (FORWARD) {
edgelabels_.emplace_back(pred_idx, edgeid, directededge, newcost, newcost.cost, mode_,
path_distance, restriction_idx,
path_distance, restriction_idx, false,
(pred.closure_pruning() || !(costing_->IsClosed(directededge, tile))),
0 != (flow_sources & kDefaultFlowMask),
costing_->TurnType(pred.opp_local_idx(), nodeinfo, directededge), 0,
directededge->destonly() ||
(costing_->is_hgv() && directededge->destonly_hgv()));
} else {
edgelabels_.emplace_back(pred_idx, edgeid, directededge, newcost, newcost.cost, mode_,
path_distance, restriction_idx,
path_distance, restriction_idx, false,
(pred.closure_pruning() || !(costing_->IsClosed(opp_edge, t2))),
0 != (flow_sources & kDefaultFlowMask),
costing_->TurnType(directededge->localedgeidx(), nodeinfo, opp_edge,
Expand Down

0 comments on commit f6fd150

Please sign in to comment.