Skip to content

Commit

Permalink
disable not_thru pruning for algos which don't have a second pass
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsnolde committed Mar 20, 2024
1 parent 9a5be0a commit 7abd7f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 3 additions & 7 deletions src/thor/timedistancebssmatrix.cc
Expand Up @@ -136,11 +136,11 @@ void TimeDistanceBSSMatrix::Expand(GraphReader& graphreader,
}

// Add to the adjacency list and edge labels.
// TODO(nils): enable not_thru pruning if we ever get a second pass for this algo
uint32_t idx = edgelabels_.size();
edgelabels_.emplace_back(pred_idx, edgeid, directededge, newcost, newcost.cost, mode,
path_distance, restriction_idx,
pred.not_thru_pruning() || !directededge->not_thru(), false, false,
false, InternalTurn::kNoTurn);
path_distance, restriction_idx, false, false, false, false,
InternalTurn::kNoTurn);
*es = {EdgeSet::kTemporary, idx};
adjacencylist_.add(idx);
}
Expand Down Expand Up @@ -332,10 +332,6 @@ void TimeDistanceBSSMatrix::SetOrigin(GraphReader& graphreader, const valhalla::
// TODO: assumes 1m/s which is a maximum penalty this could vary per costing model
cost.cost += edge.distance();

// not_thru is the same for both trees
// TODO(nils): EdgeLabel should care about not_thru_pruning
// bool not_thru_pruning = pred.not_thru_pruning() || !meta.edge->not_thru();

// Add EdgeLabel to the adjacency list (but do not set its status).
// Set the predecessor edge index to invalid to indicate the origin
// of the path. Set the origin flag
Expand Down
7 changes: 4 additions & 3 deletions src/thor/timedistancematrix.cc
Expand Up @@ -151,13 +151,14 @@ void TimeDistanceMatrix::Expand(GraphReader& graphreader,
uint32_t idx = edgelabels_.size();

// not_thru is the same for both trees
bool not_thru_pruning = pred.not_thru_pruning() || !directededge->not_thru();
// TODO(nils): enable not_thru pruning if we ever get a second pass for this algo
// bool not_thru_pruning = pred.not_thru_pruning() || !directededge->not_thru();

if (FORWARD) {
bool is_destonly =
directededge->destonly() || (costing_->is_hgv() && directededge->destonly_hgv());
edgelabels_.emplace_back(pred_idx, edgeid, directededge, newcost, newcost.cost, mode_,
path_distance, restriction_idx, not_thru_pruning,
path_distance, restriction_idx, false,
(pred.closure_pruning() || !(costing_->IsClosed(directededge, tile))),
pred.destonly_pruning() || !is_destonly,
0 != (flow_sources & kDefaultFlowMask),
Expand All @@ -166,7 +167,7 @@ void TimeDistanceMatrix::Expand(GraphReader& graphreader,
} else {
bool is_destonly = opp_edge->destonly() || (costing_->is_hgv() && opp_edge->destonly_hgv());
edgelabels_.emplace_back(pred_idx, edgeid, directededge, newcost, newcost.cost, mode_,
path_distance, restriction_idx, not_thru_pruning,
path_distance, restriction_idx, false,
(pred.closure_pruning() || !(costing_->IsClosed(opp_edge, t2))),
pred.destonly_pruning() || !is_destonly,
0 != (flow_sources & kDefaultFlowMask),
Expand Down

0 comments on commit 7abd7f3

Please sign in to comment.