Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsnolde committed Mar 20, 2024
1 parent 274400a commit b0662ec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
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 not_thru_pruning_ && !(pred.not_thru_pruning() && meta.edge->not_thru());
return !(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 not_thru_pruning_ && !(pred.not_thru_pruning() && meta.edge->not_thru());
return !(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, false,
path_distance, restriction_idx,
(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, false,
path_distance, restriction_idx,
(pred.closure_pruning() || !(costing_->IsClosed(opp_edge, t2))),
0 != (flow_sources & kDefaultFlowMask),
costing_->TurnType(directededge->localedgeidx(), nodeinfo, opp_edge,
Expand Down
1 change: 1 addition & 0 deletions valhalla/sif/costfactory.h
Expand Up @@ -101,6 +101,7 @@ class CostFactory {

mode_costing_t CreateModeCosting(const Options& options, TravelMode& mode) {
mode_costing_t mode_costing;
mode = TravelMode::kMaxTravelMode;
// Set travel mode and construct costing(s) for this type
for (const auto& costing : kCostingTypeMapping.at(options.costing_type())) {
valhalla::sif::cost_ptr_t cost = Create(options.costings().find(costing)->second);
Expand Down

0 comments on commit b0662ec

Please sign in to comment.