Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/thor/timedistancebssmatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ bool TimeDistanceBSSMatrix::UpdateDestinations(
// Subtract the partial remaining cost and distance along the edge.
float remainder = dest_edge->second;
Cost newcost = pred.cost() - (pedestrian_costing_->EdgeCost(edge, tile) * remainder);
if (newcost.cost < dest.best_cost.cost) {
if (newcost.cost > 0 && newcost.cost < dest.best_cost.cost) {
dest.best_cost = newcost;
dest.distance = pred.path_distance() - (edge->length() * remainder);
}
Expand Down
2 changes: 1 addition & 1 deletion src/thor/timedistancematrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ bool TimeDistanceMatrix::UpdateDestinations(
float remainder = dest_edge->second;
Cost newcost =
pred.cost() - (costing_->EdgeCost(edge, tile, time_info, flow_sources) * remainder);
if (newcost.cost < dest.best_cost.cost) {
if (newcost.cost > 0 && newcost.cost < dest.best_cost.cost) {
dest.best_cost = newcost;
dest.distance = pred.path_distance() - (edge->length() * remainder);
}
Expand Down
Loading