Skip to content
Snippets Groups Projects
Commit 05f770cc authored by Guylaine Prat's avatar Guylaine Prat
Browse files

Reset properly the number of calls in case of second try

Issue #376
parent 72c3988c
No related branches found
No related tags found
No related merge requests found
...@@ -54,9 +54,6 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { ...@@ -54,9 +54,6 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
/** Flag for flat-body hypothesis. */ /** Flag for flat-body hypothesis. */
private final boolean flatBody; private final boolean flatBody;
/** Nb times cell intersection (with DEM) is performed for null intersection (used to avoid infinite loop). */
private int nbCall = 0;
/** Simple constructor. /** Simple constructor.
* @param updater updater used to load Digital Elevation Model tiles * @param updater updater used to load Digital Elevation Model tiles
* @param maxCachedTiles maximum number of tiles stored in the cache * @param maxCachedTiles maximum number of tiles stored in the cache
...@@ -191,8 +188,14 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { ...@@ -191,8 +188,14 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
} else { // with a DEM } else { // with a DEM
final NormalizedGeodeticPoint currentGuess0 = currentGuess; // Keep the initial guess
final NormalizedGeodeticPoint currentGuess0 = closeGuess;
// number of times cell intersection (with DEM) is performed for null intersection (used to avoid infinite loop)
int nbCall = 0;
// Shift for s to find the solution if foundIntersection is null
double deltaS = -1.; double deltaS = -1.;
// if the shifts in one way was not successful, try the other way
boolean secondChance = false; boolean secondChance = false;
while (foundIntersection == null && (nbCall < NB_TIME_CELL_INTERSECTION)) { while (foundIntersection == null && (nbCall < NB_TIME_CELL_INTERSECTION)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment