forked from graphhopper/graphhopper
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RSPS-1243: Implement fail fast option for matrix calculation (#28)
* Temporal changes * Work in progress * Add errors * Add fail fast support for matrix calculation * Improvement tests * Fix sonar warnings * Fix sonar warnings --------- Co-authored-by: jp-lopez <[email protected]>
- Loading branch information
Showing
11 changed files
with
233 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
core/src/main/java/com/graphhopper/routing/matrix/MatrixSnapResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.graphhopper.routing.matrix; | ||
|
||
import com.carrotsearch.hppc.IntArrayList; | ||
import com.graphhopper.storage.index.Snap; | ||
|
||
import java.util.List; | ||
|
||
|
||
public class MatrixSnapResult { | ||
|
||
List<Snap> snaps; | ||
private IntArrayList pointsNotFound = new IntArrayList(); | ||
|
||
int size; | ||
|
||
public MatrixSnapResult(List<Snap> snaps, IntArrayList pointsNotFound) { | ||
this.snaps = snaps; | ||
this.pointsNotFound = pointsNotFound; | ||
this.size = snaps.size() + pointsNotFound.size(); | ||
} | ||
|
||
public int size(){ | ||
return size; | ||
} | ||
|
||
public Snap get(int idx){ | ||
return this.snaps.get(idx); | ||
} | ||
|
||
public boolean isNotFound(int idx){ | ||
return this.getPointsNotFound().contains(idx); | ||
} | ||
|
||
public boolean isFound(int idx){ | ||
return !isNotFound(idx); | ||
} | ||
|
||
|
||
public IntArrayList getPointsNotFound() { | ||
return pointsNotFound; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.