Skip to content

Commit

Permalink
Only use finishLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
michaz committed Apr 6, 2020
1 parent 3af512e commit 13d72e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public String toString() {
private PriorityQueue<IsoLabel> fromHeap;
private IsoLabel currEdge;
private int visitedNodes;
public double limit = -1;
private double finishLimit = -1;
private ExploreType exploreType = TIME;
private final boolean reverseFlow;
Expand All @@ -89,19 +88,17 @@ public Path calcPath(int from, int to) {
*/
public void setTimeLimit(double limit) {
exploreType = TIME;
this.limit = limit;
// we explore until all spt-entries are '>timeLimitInSeconds'
// we explore until all spt-entries are '>timeLimitInSeconds'
// and add some more into this bucket for car we need a bit more as
// we otherwise get artifacts for motorway endings
this.finishLimit = this.limit + Math.max(this.limit * 0.14, 200_000);
this.finishLimit = limit + Math.max(limit * 0.14, 200_000);
}

/**
* Distance limit in meter
*/
public void setDistanceLimit(double limit) {
exploreType = DISTANCE;
this.limit = limit;
this.finishLimit = limit + Math.max(limit * 0.14, 2_000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ public Response doGet(
Collections.singletonList(point), hintsMap, DefaultEdgeFilter.allEdges(encoder)));
ShortestPathTree shortestPathTree = new ShortestPathTree(queryGraph, weighting, reverseFlow);

double limit;
if (distanceInMeter > 0) {
shortestPathTree.setDistanceLimit(distanceInMeter);
limit = distanceInMeter;
shortestPathTree.setDistanceLimit(limit);
} else {
shortestPathTree.setTimeLimit(timeLimitInSeconds * 1000);
limit = timeLimitInSeconds * 1000;
shortestPathTree.setTimeLimit(limit);
}

final double bucketSize = shortestPathTree.limit / nBuckets;
final double bucketSize = limit / nBuckets;
final List<List<Coordinate>> buckets = new ArrayList<>(nBuckets);

for (int i1 = 0; i1 < nBuckets + 1; i1++) {
Expand Down

0 comments on commit 13d72e9

Please sign in to comment.